From 49182bcd34a73d33fccb9a0e709bd9cc45bfa26f Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Tue, 13 Mar 2018 09:04:18 +0000 Subject: [PATCH] Fix grass build on darwin --- pkgs/applications/gis/grass/default.nix | 6 ++- .../gis/grass/no_symbolic_links.patch | 37 +++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 pkgs/applications/gis/grass/no_symbolic_links.patch diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix index 987b544c55657..5b36c24ab10e2 100644 --- a/pkgs/applications/gis/grass/default.nix +++ b/pkgs/applications/gis/grass/default.nix @@ -1,6 +1,6 @@ { stdenv, fetchurl, flex, bison, pkgconfig, zlib, libtiff, libpng, fftw , cairo, readline, ffmpeg, makeWrapper, wxGTK30, netcdf, blas -, proj, gdal, geos, sqlite, postgresql, mysql, python2Packages +, proj, gdal, geos, sqlite, postgresql, mysql, python2Packages, lib }: stdenv.mkDerivation { @@ -15,6 +15,10 @@ stdenv.mkDerivation { readline ffmpeg makeWrapper wxGTK30 netcdf geos postgresql mysql.connector-c blas ] ++ (with python2Packages; [ python dateutil wxPython30 numpy ]); + # On Darwin the installer tries to symlink the help files into a system + # directory + patches = [] ++ lib.optional stdenv.isDarwin [ ./no_symbolic_links.patch ]; + configureFlags = [ "--with-proj-share=${proj}/share/proj" "--without-opengl" diff --git a/pkgs/applications/gis/grass/no_symbolic_links.patch b/pkgs/applications/gis/grass/no_symbolic_links.patch new file mode 100644 index 0000000000000..ef09b97b70371 --- /dev/null +++ b/pkgs/applications/gis/grass/no_symbolic_links.patch @@ -0,0 +1,37 @@ +diff --git a/include/Make/Install.make b/include/Make/Install.make +index 0aba138..8ba74bc 100644 +--- a/include/Make/Install.make ++++ b/include/Make/Install.make +@@ -116,11 +116,6 @@ real-install: | $(INST_DIR) $(UNIX_BIN) + -$(INSTALL) config.status $(INST_DIR)/config.status + -$(CHMOD) -R a+rX $(INST_DIR) 2>/dev/null + +-ifneq ($(findstring darwin,$(ARCH)),) +- @# enable OSX Help Viewer +- @/bin/ln -sfh "$(INST_DIR)/docs/html" /Library/Documentation/Help/GRASS-$(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR) +-endif +- + $(INST_DIR) $(UNIX_BIN): + $(MAKE_DIR_CMD) $@ + +diff --git a/macosx/app/build_html_user_index.sh b/macosx/app/build_html_user_index.sh +index 04e63eb..c9d9c2c 100755 +--- a/macosx/app/build_html_user_index.sh ++++ b/macosx/app/build_html_user_index.sh +@@ -140,7 +140,6 @@ else + # echo "$BASENAME $SHORTDESC" >> $FULLINDEX + # make them local to user to simplify page links + echo "$BASENAME $SHORTDESC" >> $FULLINDEX +- ln -sf "$HTMLDIRG/$i" global_$i + done + done + fi +@@ -183,8 +182,3 @@ echo " + " > $i.html + done + +-# add Help Viewer links in user docs folder +- +-mkdir -p $HOME/Library/Documentation/Help/ +-ln -sfh ../../GRASS/$GRASS_MMVER/Modules/docs/html $HOME/Library/Documentation/Help/GRASS-$GRASS_MMVER-addon +-ln -sfh $GISBASE/docs/html $HOME/Library/Documentation/Help/GRASS-$GRASS_MMVER