···2, gmp, mpfr, pari, ntl, gsl, mpfi, ecm, glpk, nauty
3, readline, gettext, libpng, libao, gfortran, perl
4, enableGUI ? false, libGL, libGLU, xorg, fltk
05}:
67assert (!blas.isILP64) && (!lapack.isILP64);
89stdenv.mkDerivation rec {
10 pname = "giac${lib.optionalString enableGUI "-with-xcas"}";
11- version = "1.5.0-87"; # TODO try to remove preCheck phase on upgrade
1213 src = fetchurl {
14 url = "https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/giac_${version}.tar.gz";
15- sha256 = "1d0h1yb7qvh9x7wwv9yrzmcp712f49w1iljkxp4y6g9pzsmg1mmv";
16 };
1718- patches = lib.optionals (!enableGUI) [
19- # when enableGui is false, giac is compiled without fltk. That means some
20- # outputs differ in the make check. Patch around this:
21 (fetchpatch {
22- url = "https://git.sagemath.org/sage.git/plain/build/pkgs/giac/patches/nofltk-check.patch?id=7553a3c8dfa7bcec07241a07e6a4e7dcf5bb4f26";
00000000023 sha256 = "0xkmfc028vg5w6va04gp2x2iv31n8v4shd6vbyvk4blzgfmpj2cw";
24 })
25 ];
2627 postPatch = ''
28- for i in doc/*/Makefile*; do
29 substituteInPlace "$i" --replace "/bin/cp" "cp";
30 done;
000031 '';
3233 nativeBuildInputs = [
···44 lapack blas
45 ] ++ lib.optionals enableGUI [
46 libGL libGLU fltk xorg.libX11
47- ];
4849 /* fixes:
50 configure:16211: checking for main in -lntl
···58 outputs = [ "out" ] ++ lib.optional (!enableGUI) "doc";
5960 doCheck = true;
61- preCheck = ''
62- # One test in this file fails. That test just tests a part of the pari
63- # interface that isn't actually used in giac. Of course it would be better
64- # to only remove that one test, but that would require a patch.
65- # Removing the whole test set should be good enough for now.
66- # Upstream report: https://xcas.univ-grenoble-alpes.fr/forum/viewtopic.php?f=4&t=2102#p10326
67- echo > check/chk_fhan11
68 '';
6970 enableParallelBuilding = true;
···75 "--enable-ao" "--enable-ecm" "--enable-glpk"
76 ] ++ lib.optionals enableGUI [
77 "--enable-gui" "--with-x"
78- ];
7980 postInstall = ''
81 # example Makefiles contain the full path to some commands
···2, gmp, mpfr, pari, ntl, gsl, mpfi, ecm, glpk, nauty
3, readline, gettext, libpng, libao, gfortran, perl
4, enableGUI ? false, libGL, libGLU, xorg, fltk
5+, enableMicroPy ? false, python3
6}:
78assert (!blas.isILP64) && (!lapack.isILP64);
910stdenv.mkDerivation rec {
11 pname = "giac${lib.optionalString enableGUI "-with-xcas"}";
12+ version = "1.6.0-47"; # TODO try to remove preCheck phase on upgrade
1314 src = fetchurl {
15 url = "https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/giac_${version}.tar.gz";
16+ sha256 = "sha256-c5A9/I6L/o3Y3dxEPoTKpw/fJqYMr6euLldaQ1HWT5c=";
17 };
1819+ patches = [
0020 (fetchpatch {
21+ name = "pari_2_11.patch";
22+ url = "https://git.sagemath.org/sage.git/plain/build/pkgs/giac/patches/pari_2_11.patch?id=21ba7540d385a9864b44850d6987893dfa16bfc0";
23+ sha256 = "sha256-vEo/5MNzMdYRPWgLFPsDcMT1W80Qzj4EPBjx/B8j68k=";
24+ })
25+ ] ++ lib.optionals (!enableGUI) [
26+ # when enableGui is false, giac is compiled without fltk. That
27+ # means some outputs differ in the make check. Patch around this:
28+ (fetchpatch {
29+ name = "nofltk-check.patch";
30+ url = "https://git.sagemath.org/sage.git/plain/build/pkgs/giac/patches/nofltk-check.patch?id=7553a3c8dfa7bcec07241a07e6a4e7dcf5bb4f26";
31 sha256 = "0xkmfc028vg5w6va04gp2x2iv31n8v4shd6vbyvk4blzgfmpj2cw";
32 })
33 ];
3435 postPatch = ''
36+ for i in doc/*/Makefile* micropython*/xcas/Makefile*; do
37 substituteInPlace "$i" --replace "/bin/cp" "cp";
38 done;
39+ '' +
40+ # workaround for 1.6.0-47, should not be necessary in future versions
41+ lib.optionalString (!enableMicroPy) ''
42+ sed -i -e 's/micropython-[0-9.]* //' Makefile*
43 '';
4445 nativeBuildInputs = [
···56 lapack blas
57 ] ++ lib.optionals enableGUI [
58 libGL libGLU fltk xorg.libX11
59+ ] ++ lib.optional enableMicroPy python3;
6061 /* fixes:
62 configure:16211: checking for main in -lntl
···70 outputs = [ "out" ] ++ lib.optional (!enableGUI) "doc";
7172 doCheck = true;
73+ preCheck = lib.optionalString (!enableGUI) ''
74+ # even with the nofltk patch, some changes in src/misc.cc (grep
75+ # for HAVE_LIBFLTK) made it so that giac behaves differently
76+ # when fltk is disabled. disable these tests for now.
77+ echo > check/chk_fhan2
78+ echo > check/chk_fhan9
079 '';
8081 enableParallelBuilding = true;
···86 "--enable-ao" "--enable-ecm" "--enable-glpk"
87 ] ++ lib.optionals enableGUI [
88 "--enable-gui" "--with-x"
89+ ] ++ lib.optional (!enableMicroPy) "--disable-micropy";
9091 postInstall = ''
92 # example Makefiles contain the full path to some commands