···22, gmp, mpfr, pari, ntl, gsl, mpfi, ecm, glpk, nauty
33, readline, gettext, libpng, libao, gfortran, perl
44, enableGUI ? false, libGL, libGLU, xorg, fltk
55+, enableMicroPy ? false, python3
56}:
6778assert (!blas.isILP64) && (!lapack.isILP64);
89910stdenv.mkDerivation rec {
1011 pname = "giac${lib.optionalString enableGUI "-with-xcas"}";
1111- version = "1.5.0-87"; # TODO try to remove preCheck phase on upgrade
1212+ version = "1.6.0-47"; # TODO try to remove preCheck phase on upgrade
12131314 src = fetchurl {
1415 url = "https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/giac_${version}.tar.gz";
1515- sha256 = "1d0h1yb7qvh9x7wwv9yrzmcp712f49w1iljkxp4y6g9pzsmg1mmv";
1616+ sha256 = "sha256-c5A9/I6L/o3Y3dxEPoTKpw/fJqYMr6euLldaQ1HWT5c=";
1617 };
17181818- patches = lib.optionals (!enableGUI) [
1919- # when enableGui is false, giac is compiled without fltk. That means some
2020- # outputs differ in the make check. Patch around this:
1919+ patches = [
2120 (fetchpatch {
2222- url = "https://git.sagemath.org/sage.git/plain/build/pkgs/giac/patches/nofltk-check.patch?id=7553a3c8dfa7bcec07241a07e6a4e7dcf5bb4f26";
2121+ name = "pari_2_11.patch";
2222+ url = "https://git.sagemath.org/sage.git/plain/build/pkgs/giac/patches/pari_2_11.patch?id=21ba7540d385a9864b44850d6987893dfa16bfc0";
2323+ sha256 = "sha256-vEo/5MNzMdYRPWgLFPsDcMT1W80Qzj4EPBjx/B8j68k=";
2424+ })
2525+ ] ++ lib.optionals (!enableGUI) [
2626+ # when enableGui is false, giac is compiled without fltk. That
2727+ # means some outputs differ in the make check. Patch around this:
2828+ (fetchpatch {
2929+ name = "nofltk-check.patch";
3030+ url = "https://git.sagemath.org/sage.git/plain/build/pkgs/giac/patches/nofltk-check.patch?id=7553a3c8dfa7bcec07241a07e6a4e7dcf5bb4f26";
2331 sha256 = "0xkmfc028vg5w6va04gp2x2iv31n8v4shd6vbyvk4blzgfmpj2cw";
2432 })
2533 ];
26342735 postPatch = ''
2828- for i in doc/*/Makefile*; do
3636+ for i in doc/*/Makefile* micropython*/xcas/Makefile*; do
2937 substituteInPlace "$i" --replace "/bin/cp" "cp";
3038 done;
3939+ '' +
4040+ # workaround for 1.6.0-47, should not be necessary in future versions
4141+ lib.optionalString (!enableMicroPy) ''
4242+ sed -i -e 's/micropython-[0-9.]* //' Makefile*
3143 '';
32443345 nativeBuildInputs = [
···4456 lapack blas
4557 ] ++ lib.optionals enableGUI [
4658 libGL libGLU fltk xorg.libX11
4747- ];
5959+ ] ++ lib.optional enableMicroPy python3;
48604961 /* fixes:
5062 configure:16211: checking for main in -lntl
···5870 outputs = [ "out" ] ++ lib.optional (!enableGUI) "doc";
59716072 doCheck = true;
6161- preCheck = ''
6262- # One test in this file fails. That test just tests a part of the pari
6363- # interface that isn't actually used in giac. Of course it would be better
6464- # to only remove that one test, but that would require a patch.
6565- # Removing the whole test set should be good enough for now.
6666- # Upstream report: https://xcas.univ-grenoble-alpes.fr/forum/viewtopic.php?f=4&t=2102#p10326
6767- echo > check/chk_fhan11
7373+ preCheck = lib.optionalString (!enableGUI) ''
7474+ # even with the nofltk patch, some changes in src/misc.cc (grep
7575+ # for HAVE_LIBFLTK) made it so that giac behaves differently
7676+ # when fltk is disabled. disable these tests for now.
7777+ echo > check/chk_fhan2
7878+ echo > check/chk_fhan9
6879 '';
69807081 enableParallelBuilding = true;
···7586 "--enable-ao" "--enable-ecm" "--enable-glpk"
7687 ] ++ lib.optionals enableGUI [
7788 "--enable-gui" "--with-x"
7878- ];
8989+ ] ++ lib.optional (!enableMicroPy) "--disable-micropy";
79908091 postInstall = ''
8192 # example Makefiles contain the full path to some commands