Merge pull request #38916 from mpickering/qgis-darwin-pr

QGIS and GRASS fixes
This commit is contained in:
Jörg Thalheim 2018-04-14 10:22:48 +01:00 committed by GitHub
commit 615599c695
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -35,6 +35,9 @@ stdenv.mkDerivation {
"--with-blas" "--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; /* Ensures that the python script run at build time are actually executable;
* otherwise, patchShebangs ignores them. */ * otherwise, patchShebangs ignores them. */
postConfigure = '' postConfigure = ''
@ -73,6 +76,7 @@ stdenv.mkDerivation {
--set GRASS_PYTHON ${python2Packages.python}/bin/${python2Packages.python.executable} \ --set GRASS_PYTHON ${python2Packages.python}/bin/${python2Packages.python.executable} \
--suffix LD_LIBRARY_PATH ':' '${gdal}/lib' --suffix LD_LIBRARY_PATH ':' '${gdal}/lib'
ln -s $out/grass-*/lib $out/lib ln -s $out/grass-*/lib $out/lib
ln -s $out/grass-*/include $out/include
''; '';
enableParallelBuilding = true; enableParallelBuilding = true;
@ -82,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"; 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; license = stdenv.lib.licenses.gpl2Plus;
platforms = stdenv.lib.platforms.all; platforms = stdenv.lib.platforms.all;
maintainers = with stdenv.lib.maintainers; [mpickering];
}; };
} }

View File

@ -1,7 +1,7 @@
{ stdenv, fetchurl, fetchpatch, gdal, cmake, qt4, flex, bison, proj, geos, xlibsWrapper, sqlite, gsl { stdenv, fetchurl, fetchpatch, gdal, cmake, qt4, flex, bison, proj, geos, xlibsWrapper, sqlite, gsl
, qwt, fcgi, python2Packages, libspatialindex, libspatialite, qscintilla, postgresql, makeWrapper , qwt, fcgi, python2Packages, libspatialindex, libspatialite, qscintilla, postgresql, makeWrapper
, qjson, qca2, txt2tags, openssl, darwin, pkgconfig , qjson, qca2, txt2tags, openssl, darwin, pkgconfig
, withGrass ? false, grass, IOKit, ApplicationServices , withGrass ? true, grass, IOKit, ApplicationServices
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -58,11 +58,13 @@ stdenv.mkDerivation rec {
'') + '') +
(stdenv.lib.optionalString stdenv.isDarwin '' (stdenv.lib.optionalString stdenv.isDarwin ''
# Necessary for QGIS to find the correct default GRASS path # 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"} ${stdenv.lib.optionalString withGrass "ln -sf ${grass} $out/QGIS.app/Contents/MacOS/grass"}
for file in $(find $out -type f -name "QGIS"); do for file in $(find $out -type f -name "QGIS"); do
wrapProgram "$file" \ wrapProgram "$file" \
--prefix DYLD_LIBRARY_PATH : "${qwt}/lib" \ --prefix DYLD_LIBRARY_PATH : "${qwt}/lib" \
--prefix DYLD_LIBRARY_PATH : "${qscintilla}/lib" \ --prefix DYLD_LIBRARY_PATH : "${qscintilla}/lib" \
--prefix PATH : "${gdal}/bin" \
${stdenv.lib.optionalString withGrass "--prefix PATH : ${grass}/bin"} \ ${stdenv.lib.optionalString withGrass "--prefix PATH : ${grass}/bin"} \
--set PYTHONPATH $PYTHONPATH --set PYTHONPATH $PYTHONPATH
done done
@ -75,6 +77,6 @@ stdenv.mkDerivation rec {
homepage = http://www.qgis.org; homepage = http://www.qgis.org;
license = stdenv.lib.licenses.gpl2Plus; license = stdenv.lib.licenses.gpl2Plus;
platforms = with stdenv.lib.platforms; unix; platforms = with stdenv.lib.platforms; unix;
maintainers = with stdenv.lib.maintainers; [viric]; maintainers = with stdenv.lib.maintainers; [viric mpickering];
}; };
} }