From 160e8ad6140dcadfeb478a6cebf064e6c86a9ab1 Mon Sep 17 00:00:00 2001 From: Ivan Mincik Date: Wed, 18 Sep 2024 15:16:42 +0200 Subject: [PATCH 1/3] grass: drop clang integer patch Problem is fixed in https://github.com/OSGeo/grass/pull/3325 Closes #340475 --- .../gis/grass/clang-integer-conversion.patch | 21 ------------------- pkgs/applications/gis/grass/default.nix | 5 ----- 2 files changed, 26 deletions(-) delete mode 100644 pkgs/applications/gis/grass/clang-integer-conversion.patch diff --git a/pkgs/applications/gis/grass/clang-integer-conversion.patch b/pkgs/applications/gis/grass/clang-integer-conversion.patch deleted file mode 100644 index 85145f45c37d..000000000000 --- a/pkgs/applications/gis/grass/clang-integer-conversion.patch +++ /dev/null @@ -1,21 +0,0 @@ -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 fd26e49fdbd8..e112a3629ba5 100644 --- a/pkgs/applications/gis/grass/default.nix +++ b/pkgs/applications/gis/grass/default.nix @@ -90,11 +90,6 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - patches = lib.optionals stdenv.isDarwin [ - # Fix conversion of const char* to unsigned int. - ./clang-integer-conversion.patch - ]; - configureFlags = [ "--with-blas" "--with-cairo-ldflags=-lfontconfig" From 23d10b25187b6874dae26306c4d0b84d64358592 Mon Sep 17 00:00:00 2001 From: Ivan Mincik Date: Thu, 19 Sep 2024 11:11:01 +0200 Subject: [PATCH 2/3] grass: fix openmp support on darwin --- pkgs/applications/gis/grass/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix index e112a3629ba5..4d0040215121 100644 --- a/pkgs/applications/gis/grass/default.nix +++ b/pkgs/applications/gis/grass/default.nix @@ -23,6 +23,7 @@ , libsvm , libtiff , libxml2 +, llvmPackages , netcdf , pdal , pkg-config @@ -86,7 +87,8 @@ stdenv.mkDerivation (finalAttrs: { zlib zstd ] ++ lib.optionals withOpenGL [ libGLU ] - ++ lib.optionals stdenv.isDarwin [ libiconv ]; + ++ lib.optionals stdenv.isDarwin [ libiconv ] + ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; strictDeps = true; From ff2818413a256eb792ab6fda5b5d0b5994f178bc Mon Sep 17 00:00:00 2001 From: Ivan Mincik Date: Thu, 19 Sep 2024 11:13:46 +0200 Subject: [PATCH 3/3] grass: disable opengl support on darwin --- pkgs/applications/gis/grass/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix index 4d0040215121..2e02c1d2da6a 100644 --- a/pkgs/applications/gis/grass/default.nix +++ b/pkgs/applications/gis/grass/default.nix @@ -5,7 +5,7 @@ , makeWrapper , wrapGAppsHook3 -, withOpenGL ? true +, withOpenGL ? !stdenv.isDarwin , bison , blas