From c2de8ffc884380f133970e6e82feb16de14b9bf5 Mon Sep 17 00:00:00 2001 From: qbisi Date: Sun, 13 Apr 2025 13:54:25 +0800 Subject: [PATCH] gmsh: fix find_library for Darwin platform --- pkgs/by-name/gm/gmsh/fix-python.patch | 13 ------------- pkgs/by-name/gm/gmsh/package.nix | 4 ++-- 2 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 pkgs/by-name/gm/gmsh/fix-python.patch diff --git a/pkgs/by-name/gm/gmsh/fix-python.patch b/pkgs/by-name/gm/gmsh/fix-python.patch deleted file mode 100644 index 41c5c3b8f976..000000000000 --- a/pkgs/by-name/gm/gmsh/fix-python.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/api/gmsh.py b/api/gmsh.py -index f525284..a225c85 100644 ---- a/api/gmsh.py -+++ b/api/gmsh.py -@@ -78,6 +78,8 @@ if not libpath: - else: - libpath = find_library("gmsh") - -+libpath = "@LIBPATH@" -+ - # ... and print a warning if everything failed - if not libpath: - print("Warning: could not find Gmsh shared library " + libname + diff --git a/pkgs/by-name/gm/gmsh/package.nix b/pkgs/by-name/gm/gmsh/package.nix index c3c7092d0b79..ba3a25c8be7a 100644 --- a/pkgs/by-name/gm/gmsh/package.nix +++ b/pkgs/by-name/gm/gmsh/package.nix @@ -59,7 +59,6 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; patches = [ - ./fix-python.patch (fetchpatch { url = "https://gitlab.onelab.info/gmsh/gmsh/-/commit/7d5094fb0a5245cb435afd3f3e8c35e2ecfe70fd.patch"; hash = "sha256-3atm1NGsMI4KEct2xakRG6EasRpF6YRI4raoVYxBV4g="; @@ -67,7 +66,8 @@ stdenv.mkDerivation rec { ]; postPatch = '' - substituteInPlace api/gmsh.py --subst-var-by LIBPATH ${placeholder "out"}/lib/libgmsh.so + substituteInPlace api/gmsh.py \ + --replace-fail 'find_library("gmsh")' \"$out/lib/libgmsh${stdenv.hostPlatform.extensions.sharedLibrary}\" ''; # N.B. the shared object is used by bindings