libspatialindex: fix on Darwin

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 <paparodeo@proton.me>

+16 -6
+11
pkgs/by-name/li/libspatialindex/no-rpath-for-darwin.diff
··· 1 + --- a/src/CMakeLists.txt 2 + +++ b/src/CMakeLists.txt 3 + @@ -248,7 +248,7 @@ if(HAVE_BCOPY) 4 + endif() 5 + 6 + 7 + -if(APPLE) 8 + +if(FALSE) 9 + set(MACOSX_RPATH ON) 10 + set_target_properties(spatialindex spatialindex_c 11 + PROPERTIES INSTALL_NAME_DIR "@rpath")
+5 -6
pkgs/by-name/li/libspatialindex/package.nix
··· 3 3 stdenv, 4 4 fetchFromGitHub, 5 5 cmake, 6 - fixDarwinDylibNames, 7 6 }: 8 7 9 8 stdenv.mkDerivation (finalAttrs: { ··· 17 16 hash = "sha256-a2CzRLHdQMnVhHZhwYsye4X644r8gp1m6vU2CJpSRpU="; 18 17 }; 19 18 19 + patches = [ 20 + ./no-rpath-for-darwin.diff 21 + ]; 22 + 20 23 postPatch = '' 21 24 patchShebangs test/ 22 25 ''; 23 26 24 - nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; 27 + nativeBuildInputs = [ cmake ]; 25 28 26 29 cmakeFlags = [ 27 30 (lib.cmakeBool "BUILD_TESTING" finalAttrs.finalPackage.doCheck) ··· 36 39 ]; 37 40 38 41 doCheck = true; 39 - 40 - postFixup = lib.optionalString stdenv.hostPlatform.isDarwin '' 41 - install_name_tool -change "@rpath/libspatialindex.7.dylib" "$out/lib/libspatialindex.7.dylib" $out/lib/libspatialindex_c.dylib 42 - ''; 43 42 44 43 meta = { 45 44 description = "Extensible spatial index library in C++";