anchor.diff:        scripts/g.extension.all/g.extension.all.py \
         scripts/r.drain/r.drain.py \
         scripts/r.pack/r.pack.py \
  +      scripts/r.import/r.import.py \
         scripts/r.tileset/r.tileset.py \
         scripts/r.unpack/r.unpack.py \
         scripts/v.clip/v.clip.py \
  
positive.code: { lib, stdenv, fetchFromGitHub, flex, bison, pkg-config, zlib, libtiff, libpng, fftw
  , cairo, readline, ffmpeg_3, makeWrapper, wxGTK30, netcdf, blas
  , proj, gdal, geos, sqlite, postgresql, libmysqlclient, python2Packages, libLAS, proj-datumgrid
  }:
  
  stdenv.mkDerivation rec {
    name = "grass";
    version = "7.6.1";
  
    src = with lib; fetchFromGitHub {
      owner = "OSGeo";
      repo = "grass";
      rev = "${name}_${replaceStrings ["."] ["_"] version}";
      sha256 = "1amjk9rz7vw5ha7nyl5j2bfwj5if9w62nlwx5qbp1x7spldimlll";
    };
  
    nativeBuildInputs = [ pkg-config ];
    buildInputs = [ flex bison zlib proj gdal libtiff libpng fftw sqlite cairo proj
    readline ffmpeg_3 makeWrapper wxGTK30 netcdf geos postgresql libmysqlclient blas
    libLAS proj-datumgrid ]
      ++ (with python2Packages; [ python python-dateutil wxPython30 numpy ]);
  
    # On Darwin the installer tries to symlink the help files into a system
    # directory
  
negative.code:       temporal/t.rast.algebra/t.rast.algebra.py \
        temporal/t.rast3d.algebra/t.rast3d.algebra.py \
        temporal/t.vect.algebra/t.vect.algebra.py \
        temporal/t.downgrade/t.downgrade.py \
        temporal/t.select/t.select.py
      for d in gui lib scripts temporal tools; do
        patchShebangs $d
      done
    '';
  
    postInstall = ''
      wrapProgram $out/bin/grass78 \
      --set PYTHONPATH $PYTHONPATH \
      --set GRASS_PYTHON ${python3Packages.python}/bin/${python3Packages.python.executable} \
      --suffix LD_LIBRARY_PATH ':' '${gdal}/lib'
      ln -s $out/grass*/lib $out/lib
      ln -s $out/grass*/include $out/include
  