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 stdenv, 4 fetchFromGitHub, 5 cmake, 6 - fixDarwinDylibNames, 7 }: 8 9 stdenv.mkDerivation (finalAttrs: { ··· 17 hash = "sha256-a2CzRLHdQMnVhHZhwYsye4X644r8gp1m6vU2CJpSRpU="; 18 }; 19 20 postPatch = '' 21 patchShebangs test/ 22 ''; 23 24 - nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; 25 26 cmakeFlags = [ 27 (lib.cmakeBool "BUILD_TESTING" finalAttrs.finalPackage.doCheck) ··· 36 ]; 37 38 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 44 meta = { 45 description = "Extensible spatial index library in C++";
··· 3 stdenv, 4 fetchFromGitHub, 5 cmake, 6 }: 7 8 stdenv.mkDerivation (finalAttrs: { ··· 16 hash = "sha256-a2CzRLHdQMnVhHZhwYsye4X644r8gp1m6vU2CJpSRpU="; 17 }; 18 19 + patches = [ 20 + ./no-rpath-for-darwin.diff 21 + ]; 22 + 23 postPatch = '' 24 patchShebangs test/ 25 ''; 26 27 + nativeBuildInputs = [ cmake ]; 28 29 cmakeFlags = [ 30 (lib.cmakeBool "BUILD_TESTING" finalAttrs.finalPackage.doCheck) ··· 39 ]; 40 41 doCheck = true; 42 43 meta = { 44 description = "Extensible spatial index library in C++";