From b65181d78b61464966da493a635004fbc3161a70 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Fri, 13 Apr 2018 00:03:31 +0100 Subject: [PATCH 1/5] grass: Fix Can't load GDAL library errors on darwin It is required to pass this extra flag to the build to avoid trying to dynamically load the library. --- pkgs/applications/gis/grass/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix index 8353bce1b84..3e0089efa6d 100644 --- a/pkgs/applications/gis/grass/default.nix +++ b/pkgs/applications/gis/grass/default.nix @@ -35,6 +35,9 @@ stdenv.mkDerivation { "--with-blas" ]; + # Otherwise a very confusing "Can't load GDAL library" error + makeFlags = stdenv.lib.optional stdenv.isDarwin "GDAL_DYNAMIC="; + /* Ensures that the python script run at build time are actually executable; * otherwise, patchShebangs ignores them. */ postConfigure = '' From a3de225864018f311ab59f884a27dcd81e60642b Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Fri, 13 Apr 2018 00:04:26 +0100 Subject: [PATCH 2/5] grass: Symlink include/ as well as bin/ --- pkgs/applications/gis/grass/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix index 3e0089efa6d..a8dae562576 100644 --- a/pkgs/applications/gis/grass/default.nix +++ b/pkgs/applications/gis/grass/default.nix @@ -76,6 +76,7 @@ stdenv.mkDerivation { --set GRASS_PYTHON ${python2Packages.python}/bin/${python2Packages.python.executable} \ --suffix LD_LIBRARY_PATH ':' '${gdal}/lib' ln -s $out/grass-*/lib $out/lib + ln -s $out/grass-*/include $out/include ''; enableParallelBuilding = true; From a134b9354b2221dbe111cc0f7be0f5ac5070cc19 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Fri, 13 Apr 2018 00:09:32 +0100 Subject: [PATCH 3/5] QGIS: Allow plugins to find GDAL tools by looking on PATH --- pkgs/applications/gis/qgis/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/gis/qgis/default.nix b/pkgs/applications/gis/qgis/default.nix index 75f980c6781..5d7e70227fc 100644 --- a/pkgs/applications/gis/qgis/default.nix +++ b/pkgs/applications/gis/qgis/default.nix @@ -58,11 +58,13 @@ stdenv.mkDerivation rec { '') + (stdenv.lib.optionalString stdenv.isDarwin '' # Necessary for QGIS to find the correct default GRASS path + # Plugins look for gdal tools like deminfo on the PATH ${stdenv.lib.optionalString withGrass "ln -sf ${grass} $out/QGIS.app/Contents/MacOS/grass"} for file in $(find $out -type f -name "QGIS"); do wrapProgram "$file" \ --prefix DYLD_LIBRARY_PATH : "${qwt}/lib" \ --prefix DYLD_LIBRARY_PATH : "${qscintilla}/lib" \ + --prefix PATH : "${gdal}/bin" \ ${stdenv.lib.optionalString withGrass "--prefix PATH : ${grass}/bin"} \ --set PYTHONPATH $PYTHONPATH done From e84325e6ab7c110681f6971ceea5bb5fa1439093 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Fri, 13 Apr 2018 00:14:03 +0100 Subject: [PATCH 4/5] grass, qgis: Add myself to maintainers list --- pkgs/applications/gis/grass/default.nix | 1 + pkgs/applications/gis/qgis/default.nix | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix index a8dae562576..d4e2043eaa7 100644 --- a/pkgs/applications/gis/grass/default.nix +++ b/pkgs/applications/gis/grass/default.nix @@ -86,5 +86,6 @@ stdenv.mkDerivation { description = "GIS software suite used for geospatial data management and analysis, image processing, graphics and maps production, spatial modeling, and visualization"; license = stdenv.lib.licenses.gpl2Plus; platforms = stdenv.lib.platforms.all; + maintainers = with stdenv.lib.maintainers; [mpickering]; }; } diff --git a/pkgs/applications/gis/qgis/default.nix b/pkgs/applications/gis/qgis/default.nix index 5d7e70227fc..d0b7eb9e892 100644 --- a/pkgs/applications/gis/qgis/default.nix +++ b/pkgs/applications/gis/qgis/default.nix @@ -77,6 +77,6 @@ stdenv.mkDerivation rec { homepage = http://www.qgis.org; license = stdenv.lib.licenses.gpl2Plus; platforms = with stdenv.lib.platforms; unix; - maintainers = with stdenv.lib.maintainers; [viric]; + maintainers = with stdenv.lib.maintainers; [viric mpickering]; }; } From 1fe53b85117b9854298415c40cc555e959c4195e Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Fri, 13 Apr 2018 16:57:02 +0100 Subject: [PATCH 5/5] QGIS: Build with GRASS by default --- pkgs/applications/gis/qgis/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/gis/qgis/default.nix b/pkgs/applications/gis/qgis/default.nix index d0b7eb9e892..896387b1f7f 100644 --- a/pkgs/applications/gis/qgis/default.nix +++ b/pkgs/applications/gis/qgis/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl, fetchpatch, gdal, cmake, qt4, flex, bison, proj, geos, xlibsWrapper, sqlite, gsl , qwt, fcgi, python2Packages, libspatialindex, libspatialite, qscintilla, postgresql, makeWrapper , qjson, qca2, txt2tags, openssl, darwin, pkgconfig -, withGrass ? false, grass, IOKit, ApplicationServices +, withGrass ? true, grass, IOKit, ApplicationServices }: stdenv.mkDerivation rec {