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"
];
# 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 = ''
@ -73,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;
@ -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";
license = stdenv.lib.licenses.gpl2Plus;
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
, 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 {
@ -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
@ -75,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];
};
}