8 , withOpenGL ? !stdenv.hostPlatform.isDarwin
41 pyPackages = python311Packages;
44 stdenv.mkDerivation (finalAttrs: {
48 src = fetchFromGitHub {
51 rev = finalAttrs.version;
52 hash = "sha256-NKMshd6pr2O62ZjmQ/oPttmeVBYVD0Nqhh3SwQrhZf8=";
61 gdal # for `gdal-config`
62 geos # for `geos-config`
63 netcdf # for `nc-config`
65 ] ++ (with pyPackages; [ python-dateutil numpy wxpython ]);
79 (libxml2.override { enableHttp = true; })
89 ] ++ lib.optionals withOpenGL [ libGLU ]
90 ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]
91 ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ];
97 "--with-cairo-ldflags=-lfontconfig"
109 "--with-postgres-libs=${postgresql.lib}/lib/"
110 "--with-proj-includes=${proj.dev}/include"
111 "--with-proj-libs=${proj}/lib"
112 "--with-proj-share=${proj}/share/proj"
118 ] ++ lib.optionals (! withOpenGL) [
120 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
126 # Otherwise a very confusing "Can't load GDAL library" error
127 makeFlags = lib.optional stdenv.hostPlatform.isDarwin "GDAL_DYNAMIC=";
129 /* Ensures that the python script run at build time are actually executable;
130 * otherwise, patchShebangs ignores them. */
132 for f in $(find . -name '*.py'); do
140 wrapProgram $out/bin/grass \
141 --set PYTHONPATH $PYTHONPATH \
142 --set GRASS_PYTHON ${pyPackages.python.interpreter} \
143 --suffix LD_LIBRARY_PATH ':' '${gdal}/lib'
144 ln -s $out/grass*/lib $out/lib
145 ln -s $out/grass*/include $out/include
148 enableParallelBuilding = true;
151 grass = callPackage ./tests.nix { grass = finalAttrs.finalPackage; };
155 description = "GIS software suite used for geospatial data management and analysis, image processing, graphics and maps production, spatial modeling, and visualization";
156 homepage = "https://grass.osgeo.org/";
157 license = licenses.gpl2Plus;
158 maintainers = with maintainers; teams.geospatial.members ++ [ mpickering ];
159 platforms = platforms.all;
160 mainProgram = "grass";