diff --git a/pkgs/applications/audio/vorbis-tools/default.nix b/pkgs/applications/audio/vorbis-tools/default.nix index 46e67c7dc33e..877f670d6861 100644 --- a/pkgs/applications/audio/vorbis-tools/default.nix +++ b/pkgs/applications/audio/vorbis-tools/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, libogg, libvorbis, libao, pkg-config, curl +{ lib, stdenv, fetchurl, fetchpatch, libogg, libvorbis, libao, pkg-config, curl, libiconv , speex, flac , autoreconfHook }: @@ -11,12 +11,18 @@ stdenv.mkDerivation rec { sha256 = "1c7h4ivgfdyygz2hyh6nfibxlkz8kdk868a576qkkjgj5gn78xyv"; }; - nativeBuildInputs = [ autoreconfHook pkg-config ]; - buildInputs = [ libogg libvorbis libao curl speex flac ]; + patches = lib.optionals stdenv.cc.isClang [ + # Fixes a call to undeclared function `utf8_decode`. + # https://github.com/xiph/vorbis-tools/pull/33 + (fetchpatch { + url = "https://github.com/xiph/vorbis-tools/commit/8a645f78b45ae7e370c0dc2a52d0f2612aa6110b.patch"; + hash = "sha256-RkT9Xa0pRu/oO9E9qhDa17L0luWgYHI2yINIkPZanmI="; + }) + ]; - env = lib.optionalAttrs stdenv.cc.isClang { - NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; - }; + nativeBuildInputs = [ autoreconfHook pkg-config ]; + buildInputs = [ libogg libvorbis libao curl speex flac ] + ++ lib.optionals stdenv.isDarwin [ libiconv ]; meta = with lib; { description = "Extra tools for Ogg-Vorbis audio codec"; diff --git a/pkgs/applications/gis/grass/clang-integer-conversion.patch b/pkgs/applications/gis/grass/clang-integer-conversion.patch new file mode 100644 index 000000000000..85145f45c37d --- /dev/null +++ b/pkgs/applications/gis/grass/clang-integer-conversion.patch @@ -0,0 +1,21 @@ +diff -ur a/db/drivers/mysql/db.c b/db/drivers/mysql/db.c +--- a/db/drivers/mysql/db.c 1969-12-31 19:00:01.000000000 -0500 ++++ b/db/drivers/mysql/db.c 2023-11-09 23:26:25.329700495 -0500 +@@ -52,9 +52,16 @@ + + db_get_login2("mysql", name, &user, &password, &host, &port); + ++ const char* errstr; ++ unsigned int port_number = (unsigned int)strtonum(port, 0, 65536, &errstr); ++ if (errstr != NULL) { ++ db_d_append_error("%s", errstr); ++ return DB_FAILED; ++ } ++ + connection = mysql_init(NULL); + res = mysql_real_connect(connection, host, user, password, +- connpar.dbname, port, NULL, 0); ++ connpar.dbname, port_number, NULL, 0); + + if (res == NULL) { + db_d_append_error("%s\n%s", _("Connection failed."), diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix index 0f250a80b970..cd0d6dbc9386 100644 --- a/pkgs/applications/gis/grass/default.nix +++ b/pkgs/applications/gis/grass/default.nix @@ -81,12 +81,13 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - # On Darwin the installer tries to symlink the help files into a system - # directory - patches = [ ./no_symbolic_links.patch ]; + patches = lib.optionals stdenv.isDarwin [ + # Fix conversion of const char* to unsigned int. + ./clang-integer-conversion.patch + ]; # Correct mysql_config query - patchPhase = '' + postPatch = '' substituteInPlace configure --replace "--libmysqld-libs" "--libs" ''; diff --git a/pkgs/applications/gis/grass/no_symbolic_links.patch b/pkgs/applications/gis/grass/no_symbolic_links.patch deleted file mode 100644 index ef09b97b7037..000000000000 --- a/pkgs/applications/gis/grass/no_symbolic_links.patch +++ /dev/null @@ -1,37 +0,0 @@ -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 "