grass: fix build on darwin

This commit is contained in:
Will Cohen 2022-01-26 07:44:26 -05:00
parent c205195d02
commit 8b1103b60e

View File

@ -1,5 +1,5 @@
{ lib, stdenv, fetchFromGitHub, flex, bison, pkg-config, zlib, libtiff, libpng, fftw { lib, stdenv, fetchFromGitHub, flex, bison, pkg-config, zlib, libtiff, libpng, fftw
, cairo, readline, ffmpeg, makeWrapper, wxGTK30, netcdf, blas , cairo, readline, ffmpeg, makeWrapper, wxGTK30, wxmac, netcdf, blas
, proj, gdal, geos, sqlite, postgresql, libmysqlclient, python3Packages, libLAS, proj-datumgrid , proj, gdal, geos, sqlite, postgresql, libmysqlclient, python3Packages, libLAS, proj-datumgrid
, zstd, pdal, wrapGAppsHook , zstd, pdal, wrapGAppsHook
}: }:
@ -16,10 +16,14 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ flex bison zlib proj gdal libtiff libpng fftw sqlite cairo buildInputs = [ flex bison zlib proj gdal libtiff libpng fftw sqlite
readline ffmpeg makeWrapper wxGTK30 netcdf geos postgresql libmysqlclient blas readline ffmpeg makeWrapper netcdf geos postgresql libmysqlclient blas
libLAS proj-datumgrid zstd pdal wrapGAppsHook ] libLAS proj-datumgrid zstd wrapGAppsHook ]
++ (with python3Packages; [ python python-dateutil wxPython_4_1 numpy ]); ++ 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);
# On Darwin the installer tries to symlink the help files into a system # On Darwin the installer tries to symlink the help files into a system
# directory # directory
@ -33,12 +37,11 @@ stdenv.mkDerivation rec {
configureFlags = [ configureFlags = [
"--with-proj-share=${proj}/share/proj" "--with-proj-share=${proj}/share/proj"
"--with-proj-includes=${proj.dev}/include" "--with-proj-includes=${proj.dev}/include"
"--with-proj-lib=${proj}/lib" "--with-proj-libs=${proj}/lib"
"--without-opengl" "--without-opengl"
"--with-readline" "--with-readline"
"--with-wxwidgets" "--with-wxwidgets"
"--with-netcdf" "--with-netcdf"
"--with-pdal"
"--with-geos" "--with-geos"
"--with-postgres" "--with-postgres"
"--with-postgres-libs=${postgresql.lib}/lib/" "--with-postgres-libs=${postgresql.lib}/lib/"
@ -51,6 +54,12 @@ stdenv.mkDerivation rec {
"--with-zstd" "--with-zstd"
"--with-fftw" "--with-fftw"
"--with-pthread" "--with-pthread"
] ++ lib.optionals stdenv.isLinux [
"--with-pdal"
] ++ lib.optionals stdenv.isDarwin [
"--without-cairo"
"--without-freetype"
"--without-x"
]; ];
# Otherwise a very confusing "Can't load GDAL library" error # Otherwise a very confusing "Can't load GDAL library" error