grass: fix build on Darwin

* Drop patch related to documentation installation. It fails to apply
because the change was made upstream as of 8.0; and
* Convert the port to an `unsigned int` as expected by the MySQL API.

+29 -42
+21
pkgs/applications/gis/grass/clang-integer-conversion.patch
···
··· 1 + diff -ur a/db/drivers/mysql/db.c b/db/drivers/mysql/db.c 2 + --- a/db/drivers/mysql/db.c 1969-12-31 19:00:01.000000000 -0500 3 + +++ b/db/drivers/mysql/db.c 2023-11-09 23:26:25.329700495 -0500 4 + @@ -52,9 +52,16 @@ 5 + 6 + db_get_login2("mysql", name, &user, &password, &host, &port); 7 + 8 + + const char* errstr; 9 + + unsigned int port_number = (unsigned int)strtonum(port, 0, 65536, &errstr); 10 + + if (errstr != NULL) { 11 + + db_d_append_error("%s", errstr); 12 + + return DB_FAILED; 13 + + } 14 + + 15 + connection = mysql_init(NULL); 16 + res = mysql_real_connect(connection, host, user, password, 17 + - connpar.dbname, port, NULL, 0); 18 + + connpar.dbname, port_number, NULL, 0); 19 + 20 + if (res == NULL) { 21 + db_d_append_error("%s\n%s", _("Connection failed."),
+5 -4
pkgs/applications/gis/grass/default.nix
··· 81 82 strictDeps = true; 83 84 - # On Darwin the installer tries to symlink the help files into a system 85 - # directory 86 - patches = [ ./no_symbolic_links.patch ]; 87 88 # Correct mysql_config query 89 - patchPhase = '' 90 substituteInPlace configure --replace "--libmysqld-libs" "--libs" 91 ''; 92
··· 81 82 strictDeps = true; 83 84 + patches = lib.optionals stdenv.isDarwin [ 85 + # Fix conversion of const char* to unsigned int. 86 + ./clang-integer-conversion.patch 87 + ]; 88 89 # Correct mysql_config query 90 + postPatch = '' 91 substituteInPlace configure --replace "--libmysqld-libs" "--libs" 92 ''; 93
-37
pkgs/applications/gis/grass/no_symbolic_links.patch
··· 1 - diff --git a/include/Make/Install.make b/include/Make/Install.make 2 - index 0aba138..8ba74bc 100644 3 - --- a/include/Make/Install.make 4 - +++ b/include/Make/Install.make 5 - @@ -116,11 +116,6 @@ real-install: | $(INST_DIR) $(UNIX_BIN) 6 - -$(INSTALL) config.status $(INST_DIR)/config.status 7 - -$(CHMOD) -R a+rX $(INST_DIR) 2>/dev/null 8 - 9 - -ifneq ($(findstring darwin,$(ARCH)),) 10 - - @# enable OSX Help Viewer 11 - - @/bin/ln -sfh "$(INST_DIR)/docs/html" /Library/Documentation/Help/GRASS-$(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR) 12 - -endif 13 - - 14 - $(INST_DIR) $(UNIX_BIN): 15 - $(MAKE_DIR_CMD) $@ 16 - 17 - diff --git a/macosx/app/build_html_user_index.sh b/macosx/app/build_html_user_index.sh 18 - index 04e63eb..c9d9c2c 100755 19 - --- a/macosx/app/build_html_user_index.sh 20 - +++ b/macosx/app/build_html_user_index.sh 21 - @@ -140,7 +140,6 @@ else 22 - # echo "<tr><td valign=\"top\"><a href=\"$HTMLDIRG/$i\">$BASENAME</a></td> <td>$SHORTDESC</td></tr>" >> $FULLINDEX 23 - # make them local to user to simplify page links 24 - echo "<tr><td valign=\"top\"><a href=\"global_$i\">$BASENAME</a></td> <td>$SHORTDESC</td></tr>" >> $FULLINDEX 25 - - ln -sf "$HTMLDIRG/$i" global_$i 26 - done 27 - done 28 - fi 29 - @@ -183,8 +182,3 @@ echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"> 30 - </html>" > $i.html 31 - done 32 - 33 - -# add Help Viewer links in user docs folder 34 - - 35 - -mkdir -p $HOME/Library/Documentation/Help/ 36 - -ln -sfh ../../GRASS/$GRASS_MMVER/Modules/docs/html $HOME/Library/Documentation/Help/GRASS-$GRASS_MMVER-addon 37 - -ln -sfh $GISBASE/docs/html $HOME/Library/Documentation/Help/GRASS-$GRASS_MMVER
···
+3 -1
pkgs/top-level/all-packages.nix
··· 30254 30255 dcw-gmt = callPackage ../applications/gis/gmt/dcw.nix { }; 30256 30257 - grass = callPackage ../applications/gis/grass { }; 30258 30259 openorienteering-mapper = libsForQt5.callPackage ../applications/gis/openorienteering-mapper { }; 30260
··· 30254 30255 dcw-gmt = callPackage ../applications/gis/gmt/dcw.nix { }; 30256 30257 + grass = callPackage ../applications/gis/grass { 30258 + stdenv = if stdenv.isDarwin then overrideSDK stdenv "11.0" else stdenv; 30259 + }; 30260 30261 openorienteering-mapper = libsForQt5.callPackage ../applications/gis/openorienteering-mapper { }; 30262