2021-01-27 05:44:43 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, flex, bison, pkg-config, zlib, libtiff, libpng, fftw
|
2022-01-26 12:44:26 +00:00
|
|
|
, cairo, readline, ffmpeg, makeWrapper, wxGTK30, wxmac, netcdf, blas
|
2021-12-06 22:50:18 +00:00
|
|
|
, proj, gdal, geos, sqlite, postgresql, libmysqlclient, python3Packages, libLAS, proj-datumgrid
|
2021-12-07 10:14:11 +00:00
|
|
|
, zstd, pdal, wrapGAppsHook
|
2015-09-18 18:01:01 +01:00
|
|
|
}:
|
|
|
|
|
2019-07-11 21:12:09 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2022-03-22 16:57:23 +00:00
|
|
|
pname = "grass";
|
2021-12-06 22:50:18 +00:00
|
|
|
version = "7.8.6";
|
2019-07-11 21:12:09 +01:00
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
src = with lib; fetchFromGitHub {
|
2019-07-11 21:12:09 +01:00
|
|
|
owner = "OSGeo";
|
|
|
|
repo = "grass";
|
2021-12-06 22:50:18 +00:00
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-zvZqFWuxNyA+hu+NMiRbQVdzzrQPsZrdGdfVB17+SbM=";
|
2015-09-18 18:01:01 +01:00
|
|
|
};
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2022-01-26 12:44:26 +00:00
|
|
|
buildInputs = [ flex bison zlib proj gdal libtiff libpng fftw sqlite
|
|
|
|
readline ffmpeg makeWrapper netcdf geos postgresql libmysqlclient blas
|
|
|
|
libLAS proj-datumgrid zstd wrapGAppsHook ]
|
|
|
|
++ lib.optionals stdenv.isLinux [ cairo pdal wxGTK30 ]
|
|
|
|
++ lib.optional stdenv.isDarwin wxmac
|
|
|
|
++ (with python3Packages; [ python python-dateutil numpy ]
|
|
|
|
++ lib.optional stdenv.isDarwin wxPython_4_0
|
|
|
|
++ lib.optional stdenv.isLinux wxPython_4_1);
|
2015-09-18 18:01:01 +01:00
|
|
|
|
2018-03-13 09:04:18 +00:00
|
|
|
# On Darwin the installer tries to symlink the help files into a system
|
|
|
|
# directory
|
2018-03-20 22:34:17 +00:00
|
|
|
patches = [ ./no_symbolic_links.patch ];
|
2018-03-13 09:04:18 +00:00
|
|
|
|
2019-11-06 07:26:33 +00:00
|
|
|
# Correct mysql_config query
|
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace configure --replace "--libmysqld-libs" "--libs"
|
|
|
|
'';
|
|
|
|
|
2015-09-18 18:01:01 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--with-proj-share=${proj}/share/proj"
|
2019-07-11 21:12:09 +01:00
|
|
|
"--with-proj-includes=${proj.dev}/include"
|
2022-01-26 12:44:26 +00:00
|
|
|
"--with-proj-libs=${proj}/lib"
|
2015-09-18 18:01:01 +01:00
|
|
|
"--without-opengl"
|
|
|
|
"--with-readline"
|
|
|
|
"--with-wxwidgets"
|
|
|
|
"--with-netcdf"
|
|
|
|
"--with-geos"
|
2017-12-28 08:58:46 +00:00
|
|
|
"--with-postgres"
|
|
|
|
"--with-postgres-libs=${postgresql.lib}/lib/"
|
2016-08-01 16:46:30 +01:00
|
|
|
# it complains about missing libmysqld but doesn't really seem to need it
|
2017-12-28 08:58:46 +00:00
|
|
|
"--with-mysql"
|
2020-09-09 20:17:23 +01:00
|
|
|
"--with-mysql-includes=${lib.getDev libmysqlclient}/include/mysql"
|
2019-09-22 08:38:09 +01:00
|
|
|
"--with-mysql-libs=${libmysqlclient}/lib/mysql"
|
2015-09-18 18:01:01 +01:00
|
|
|
"--with-blas"
|
2017-09-07 17:20:55 +01:00
|
|
|
"--with-liblas=${libLAS}/bin/liblas-config"
|
2021-12-06 22:59:45 +00:00
|
|
|
"--with-zstd"
|
|
|
|
"--with-fftw"
|
|
|
|
"--with-pthread"
|
2022-01-26 12:44:26 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
"--with-pdal"
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"--without-cairo"
|
|
|
|
"--without-freetype"
|
|
|
|
"--without-x"
|
2015-09-18 18:01:01 +01:00
|
|
|
];
|
|
|
|
|
2018-04-13 00:03:31 +01:00
|
|
|
# Otherwise a very confusing "Can't load GDAL library" error
|
2021-01-15 13:21:58 +00:00
|
|
|
makeFlags = lib.optional stdenv.isDarwin "GDAL_DYNAMIC=";
|
2018-04-13 00:03:31 +01:00
|
|
|
|
2015-09-18 18:01:01 +01:00
|
|
|
/* Ensures that the python script run at build time are actually executable;
|
|
|
|
* otherwise, patchShebangs ignores them. */
|
|
|
|
postConfigure = ''
|
|
|
|
chmod +x scripts/d.out.file/d.out.file.py \
|
|
|
|
scripts/d.to.rast/d.to.rast.py \
|
|
|
|
scripts/d.what.rast/d.what.rast.py \
|
|
|
|
scripts/d.what.vect/d.what.vect.py \
|
|
|
|
scripts/g.extension/g.extension.py \
|
|
|
|
scripts/g.extension.all/g.extension.all.py \
|
2019-07-11 21:12:09 +01:00
|
|
|
scripts/r.drain/r.drain.py \
|
2015-09-18 18:01:01 +01:00
|
|
|
scripts/r.pack/r.pack.py \
|
2021-12-06 22:50:18 +00:00
|
|
|
scripts/r.import/r.import.py \
|
2015-09-18 18:01:01 +01:00
|
|
|
scripts/r.tileset/r.tileset.py \
|
|
|
|
scripts/r.unpack/r.unpack.py \
|
2019-07-11 21:12:09 +01:00
|
|
|
scripts/v.clip/v.clip.py \
|
2015-09-18 18:01:01 +01:00
|
|
|
scripts/v.rast.stats/v.rast.stats.py \
|
|
|
|
scripts/v.to.lines/v.to.lines.py \
|
|
|
|
scripts/v.what.strds/v.what.strds.py \
|
|
|
|
scripts/v.unpack/v.unpack.py \
|
|
|
|
scripts/wxpyimgview/*.py \
|
|
|
|
gui/wxpython/animation/g.gui.animation.py \
|
2017-12-28 16:28:26 +00:00
|
|
|
gui/wxpython/datacatalog/g.gui.datacatalog.py \
|
2015-09-18 18:01:01 +01:00
|
|
|
gui/wxpython/rlisetup/g.gui.rlisetup.py \
|
|
|
|
gui/wxpython/vdigit/g.gui.vdigit.py \
|
|
|
|
temporal/t.rast.accumulate/t.rast.accumulate.py \
|
|
|
|
temporal/t.rast.accdetect/t.rast.accdetect.py \
|
2017-12-28 16:28:26 +00:00
|
|
|
temporal/t.rast.algebra/t.rast.algebra.py \
|
|
|
|
temporal/t.rast3d.algebra/t.rast3d.algebra.py \
|
|
|
|
temporal/t.vect.algebra/t.vect.algebra.py \
|
2021-12-06 22:50:18 +00:00
|
|
|
temporal/t.downgrade/t.downgrade.py \
|
2015-09-18 18:01:01 +01:00
|
|
|
temporal/t.select/t.select.py
|
|
|
|
for d in gui lib scripts temporal tools; do
|
|
|
|
patchShebangs $d
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2021-12-06 22:50:18 +00:00
|
|
|
wrapProgram $out/bin/grass78 \
|
2015-09-18 18:01:01 +01:00
|
|
|
--set PYTHONPATH $PYTHONPATH \
|
2022-01-25 19:16:18 +00:00
|
|
|
--set GRASS_PYTHON ${python3Packages.python.interpreter} \
|
2016-12-16 15:10:23 +00:00
|
|
|
--suffix LD_LIBRARY_PATH ':' '${gdal}/lib'
|
2019-07-11 21:12:09 +01:00
|
|
|
ln -s $out/grass*/lib $out/lib
|
|
|
|
ln -s $out/grass*/include $out/include
|
2015-09-18 18:01:01 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://grass.osgeo.org/";
|
2015-09-18 18:01:01 +01:00
|
|
|
description = "GIS software suite used for geospatial data management and analysis, image processing, graphics and maps production, spatial modeling, and visualization";
|
2021-01-15 13:21:58 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
maintainers = with lib.maintainers; [mpickering];
|
2015-09-18 18:01:01 +01:00
|
|
|
};
|
|
|
|
}
|