anchor.diff:      "--enable-ao" "--enable-ecm" "--enable-glpk"
     ] ++ lib.optionals enableGUI [
       "--enable-gui" "--with-x"
  -  ] ++ lib.optional (!enableMicroPy) "--disable-micropy";
  +  ] ++ lib.optionals (!enableGUI) [
  +    "--disable-fltk"
  +  ] ++ lib.optionals (!enableMicroPy) [
  +    "--disable-micropy"
  +  ];
   
     postInstall = ''
       # example Makefiles contain the full path to some commands
  
positive.code:       url = "https://git.sagemath.org/sage.git/plain/build/pkgs/giac/patches/pari_2_11.patch?id=21ba7540d385a9864b44850d6987893dfa16bfc0";
        sha256 = "sha256-vEo/5MNzMdYRPWgLFPsDcMT1W80Qzj4EPBjx/B8j68k=";
      })
    ] ++ lib.optionals (!enableGUI) [
      # when enableGui is false, giac is compiled without fltk. That
      # means some outputs differ in the make check. Patch around this:
      (fetchpatch {
        name = "nofltk-check.patch";
        url = "https://git.sagemath.org/sage.git/plain/build/pkgs/giac/patches/nofltk-check.patch?id=7553a3c8dfa7bcec07241a07e6a4e7dcf5bb4f26";
        sha256 = "0xkmfc028vg5w6va04gp2x2iv31n8v4shd6vbyvk4blzgfmpj2cw";
      })
    ];
  
  
negative.code: 
  stdenv.mkDerivation rec {
    pname = "giac${lib.optionalString enableGUI "-with-xcas"}";
    version = "1.9.0-29"; # TODO try to remove preCheck phase on upgrade
  
    src = fetchurl {
      url = "https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/giac_${version}.tar.gz";
      sha256 = "sha256-9jUVcsrV8jMfqrmnymZ4vIaWlabF9ppCuq7VDlZ5Cw4=";
    };
  
    patches = [
  