-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libspatialindex: fix on Darwin #374177
libspatialindex: fix on Darwin #374177
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can just fix the CMakeList.txt
to not use @rpath
diff --git a/pkgs/by-name/li/libspatialindex/no-rpath-for-darwin.diff b/pkgs/by-name/li/libspatialindex/no-rpath-for-darwin.diff
new file mode 100644
index 000000000000..a9bb274c6271
--- /dev/null
+++ b/pkgs/by-name/li/libspatialindex/no-rpath-for-darwin.diff
@@ -0,0 +1,13 @@
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index cb62fd9..22153ff 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -248,7 +248,7 @@ if(HAVE_BCOPY)
+ endif()
+
+
+-if(APPLE)
++if(FALSE)
+ set(MACOSX_RPATH ON)
+ set_target_properties(spatialindex spatialindex_c
+ PROPERTIES INSTALL_NAME_DIR "@rpath")
diff --git a/pkgs/by-name/li/libspatialindex/package.nix b/pkgs/by-name/li/libspatialindex/package.nix
index 1c07b6dae6ea..4e6ff6cfad4e 100644
--- a/pkgs/by-name/li/libspatialindex/package.nix
+++ b/pkgs/by-name/li/libspatialindex/package.nix
@@ -17,6 +17,10 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-a2CzRLHdQMnVhHZhwYsye4X644r8gp1m6vU2CJpSRpU=";
};
+ patches = [
+ ./no-rpath-for-darwin.diff
+ ];
+
postPatch = ''
patchShebangs test/
'';
@@ -37,10 +41,6 @@ stdenv.mkDerivation (finalAttrs: {
doCheck = true;
- postFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
- install_name_tool -change "@rpath/libspatialindex.7.dylib" "$out/lib/libspatialindex.7.dylib" $out/lib/libspatialindex_c.dylib
- '';
-
meta = {
description = "Extensible spatial index library in C++";
homepage = "https://libspatialindex.org";
db2b9a7
to
3e5aef7
Compare
@paparodeo Thank you! I've updated to your version (plus removed unnecessary buildInput for the rpath fixup hook). |
Recent bump to 2.1.0 changed the soversion from 7 to 8. It broke python3-rtree as follows: OSError: Could not load libspatialindex_c library Instead of bumping the version in postFixup, disable rpath in cmake instructions. Co-Authored-By: Reno Dakota <[email protected]>
3e5aef7
to
17c76b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@booxter @paparodeo thanks for this fix. Looks good to me.
Build successfully tested on Darwin:
Looks good. Thanks ! |
Recent bump to 2.1.0 changed the soversion from 7 to 8. It broke python3-rtree as follows:
OSError: Could not load libspatialindex_c library
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.