anchor.diff:  
   stdenv.mkDerivation rec {
     pname = "giac${lib.optionalString enableGUI "-with-xcas"}";
  -  version = "1.9.0-5"; # TODO try to remove preCheck phase on upgrade
  +  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-EP8wRi8QZPrr1lfKN6da87s1FCy8AuDYbzcvsJCWyLE=";
  +    sha256 = "sha256-9jUVcsrV8jMfqrmnymZ4vIaWlabF9ppCuq7VDlZ5Cw4=";
     };
   
     patches = [
  
positive.code:     "--enable-ao" "--enable-ecm" "--enable-glpk"
    ] ++ lib.optionals enableGUI [
      "--enable-gui" "--with-x"
    ] ++ lib.optional (!enableMicroPy) "--disable-micropy";
  
    postInstall = ''
      # example Makefiles contain the full path to some commands
  
negative.code:       url = "https://git.sagemath.org/sage.git/plain/build/pkgs/giac/patches/pari_2_11.patch?id=21ba7540d385a9864b44850d6987893dfa16bfc0";
        sha256 = "sha256-vEo/5MNzMdYRPWgLFPsDcMT1W80Qzj4EPBjx/B8j68k=";
      })
  
      # giac calls scanf/printf with non-constant first arguments, which
      # the compiler rightfully warns about (with an error nowadays).
      (fetchpatch {
        name = "fix-string-compiler-error.patch";
        url = "https://salsa.debian.org/science-team/giac/-/raw/08cb807ef41f5216b712928886ebf74f69d5ddf6/debian/patches/fix-string-compiler-error.patch";
        sha256 = "sha256-K4KAJY1F9Y4DTZFmVEOCXTnxBmHo4//3A10UR3Wlliw=";
      })
  
      # increase pari stack size for test chk_fhan4
      (fetchpatch {
        name = "increase-pari-stack-size.patch";
        url = "https://salsa.debian.org/science-team/giac/-/raw/08cb807ef41f5216b712928886ebf74f69d5ddf6/debian/patches/increase-pari-size.patch";
        sha256 = "sha256-764P0IJ7ndURap7hotOmYJK0wAhYdqMbQNOnhJxVNt0=";
      })
    ] ++ 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 = "sha256-nAl5q3ufLjK3X9s0qMlGNowdRRf3EaC24eVtJABzdXY=";
      })
    ];
  
  