From e1e44dcf1b703fa2a6ff720456c1562d879c12e1 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Mon, 30 Oct 2017 09:52:29 +0100 Subject: [PATCH] pari: enable darwin build (cherry picked from commit b93df240781617e0008e41dd8f7f735f6d7f5344) --- .../science/math/pari/default.nix | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/science/math/pari/default.nix b/pkgs/applications/science/math/pari/default.nix index 64784facfb964d..86d4d289c2a6c4 100644 --- a/pkgs/applications/science/math/pari/default.nix +++ b/pkgs/applications/science/math/pari/default.nix @@ -14,12 +14,21 @@ stdenv.mkDerivation rec { buildInputs = [ gmp readline libX11 libpthreadstubs tex perl ]; configureScript = "./Configure"; - configureFlags = - "--mt=pthread" + - "--with-gmp=${gmp.dev} " + - "--with-readline=${readline.dev}"; + configureFlags = [ + "--mt=pthread" + "--with-gmp=${gmp.dev}" + "--with-readline=${readline.dev}" + ] ++ stdenv.lib.optional stdenv.isDarwin "--host=x86_64-darwin"; - makeFlags = "all"; + preConfigure = '' + export LD=$CC + ''; + + postConfigure = stdenv.lib.optionalString stdenv.isDarwin '' + echo 'echo x86_64-darwin' > config/arch-osname + ''; + + makeFlags = [ "all" ]; meta = with stdenv.lib; { description = "Computer algebra system for high-performance number theory computations"; @@ -36,12 +45,12 @@ stdenv.mkDerivation rec { Bordeaux I, France), PARI is now under the GPL and maintained by Karim Belabas with the help of many volunteer contributors. - - PARI is a C library, allowing fast computations. + - PARI is a C library, allowing fast computations. - gp is an easy-to-use interactive shell giving access to the PARI functions. - GP is the name of gp's scripting language. - - gp2c, the GP-to-C compiler, combines the best of both worlds - by compiling GP scripts to the C language and transparently loading + - gp2c, the GP-to-C compiler, combines the best of both worlds + by compiling GP scripts to the C language and transparently loading the resulting functions into gp. (gp2c-compiled scripts will typically run 3 or 4 times faster.) gp2c currently only understands a subset of the GP language. @@ -50,7 +59,7 @@ stdenv.mkDerivation rec { downloadPage = "http://pari.math.u-bordeaux.fr/download.html"; license = licenses.gpl2Plus; maintainers = with maintainers; [ ertes raskin AndersonTorres ]; - platforms = platforms.linux; + platforms = platforms.linux ++ platforms.darwin; updateWalker = true; }; }