anchor.diff:      })
     ];
   
  +  # 1.9.0-5's tarball contains a binary (src/mkjs) which is executed
  +  # at build time. we will delete and rebuild it.
  +  depsBuildBuild = [ buildPackages.stdenv.cc ];
  +
     postPatch = ''
       for i in doc/*/Makefile* micropython*/xcas/Makefile*; do
         substituteInPlace "$i" --replace "/bin/cp" "cp";
       done;
  -  '' +
  -  # workaround for 1.6.0-47, should not be necessary in future versions
  -  lib.optionalString (!enableMicroPy) ''
  -    sed -i -e 's/micropython-[0-9.]* //' Makefile*
  +    rm src/mkjs
  +    substituteInPlace src/Makefile.am --replace "g++ mkjs.cc" \
  +      "${buildPackages.stdenv.cc.targetPrefix}c++ mkjs.cc"
     '';
   
     nativeBuildInputs = [
  -    texlive.combined.scheme-small bison flex
  +    autoreconfHook texlive.combined.scheme-small bison flex
     ];
   
     # perl is only needed for patchShebangs fixup.
  
positive.code:   ] ++ lib.optionals enableGUI [
      libGL libGLU fltk xorg.libX11
    ] ++ lib.optional enableMicroPy python3;
  
    /* fixes:
    configure:16211: checking for main in -lntl
    configure:16230: g++ -o conftest -g -O2   conftest.cpp -lntl  -llapack -lblas -lgfortran -ldl -lpng16 -lm -lmpfi -lmpfr -lgmp  >&5
    /nix/store/y9c1v4x7y39j2rfbg17agjwqdzxpsn18-ntl-11.3.2/lib/libntl.so: undefined reference to `pthread_key_create'
    */
    NIX_CFLAGS_LINK="-lpthread";
  
    # xcas Phys and Turtle menus are broken with split outputs
    # and interactive use is likely to need docs
  
negative.code: { stdenv, lib, fetchurl, fetchpatch, texlive, bison, flex, lapack, blas
  , autoreconfHook, gmp, mpfr, pari, ntl, gsl, mpfi, ecm, glpk, nauty
  , buildPackages, readline, gettext, libpng, libao, gfortran, perl
  , enableGUI ? false, libGL, libGLU, xorg, fltk
  , enableMicroPy ? false, python3
  }:
  