8 , withOpenGL ? !stdenv.hostPlatform.isDarwin
40 stdenv.mkDerivation (finalAttrs: {
44 src = fetchFromGitHub {
47 rev = finalAttrs.version;
48 hash = "sha256-NKMshd6pr2O62ZjmQ/oPttmeVBYVD0Nqhh3SwQrhZf8=";
57 gdal # for `gdal-config`
58 geos # for `geos-config`
59 netcdf # for `nc-config`
61 ] ++ (with python3Packages; [ python-dateutil numpy wxpython ]);
75 (libxml2.override { enableHttp = true; })
85 ] ++ lib.optionals withOpenGL [ libGLU ]
86 ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]
87 ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ];
93 "--with-cairo-ldflags=-lfontconfig"
105 "--with-postgres-libs=${postgresql.lib}/lib/"
106 "--with-proj-includes=${proj.dev}/include"
107 "--with-proj-libs=${proj}/lib"
108 "--with-proj-share=${proj}/share/proj"
114 ] ++ lib.optionals (! withOpenGL) [
116 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
122 # Otherwise a very confusing "Can't load GDAL library" error
123 makeFlags = lib.optional stdenv.hostPlatform.isDarwin "GDAL_DYNAMIC=";
125 /* Ensures that the python script run at build time are actually executable;
126 * otherwise, patchShebangs ignores them. */
128 for f in $(find . -name '*.py'); do
136 wrapProgram $out/bin/grass \
137 --set PYTHONPATH $PYTHONPATH \
138 --set GRASS_PYTHON ${python3Packages.python.interpreter} \
139 --suffix LD_LIBRARY_PATH ':' '${gdal}/lib'
140 ln -s $out/grass*/lib $out/lib
141 ln -s $out/grass*/include $out/include
144 enableParallelBuilding = true;
147 grass = callPackage ./tests.nix { grass = finalAttrs.finalPackage; };
151 description = "GIS software suite used for geospatial data management and analysis, image processing, graphics and maps production, spatial modeling, and visualization";
152 homepage = "https://grass.osgeo.org/";
153 license = licenses.gpl2Plus;
154 maintainers = with maintainers; teams.geospatial.members ++ [ mpickering ];
155 platforms = platforms.all;
156 mainProgram = "grass";