about summary refs log tree commit diff
path: root/pkgs/development/libraries/StormLib
diff options
context:
space:
mode:
authorStanisław Pitucha <stan.pitucha@envato.com>2023-02-08 09:32:11 +1100
committerStanisław Pitucha <git@viraptor.info>2023-02-14 15:32:57 +1100
commit6f6fba9917ae8a06d513f75bac9b877af4fd53ac (patch)
tree5799600d96bb4fbea64fd814f19beaeb87a10672 /pkgs/development/libraries/StormLib
parentad4a70b4b60537c71d13d1981a27e5415892e2c8 (diff)
StormLib: fix darwin build
Making the framework path relative allows installing under /nix/store.
Diffstat (limited to 'pkgs/development/libraries/StormLib')
-rw-r--r--pkgs/development/libraries/StormLib/default.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/pkgs/development/libraries/StormLib/default.nix b/pkgs/development/libraries/StormLib/default.nix
index 0bf9ba63dc482..cbf33e7a2cbee 100644
--- a/pkgs/development/libraries/StormLib/default.nix
+++ b/pkgs/development/libraries/StormLib/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, cmake, bzip2, libtomcrypt, zlib }:
+{ lib, stdenv, fetchFromGitHub, cmake, bzip2, libtomcrypt, zlib, darwin }:
 
 stdenv.mkDerivation rec {
   pname = "StormLib";
@@ -11,13 +11,23 @@ stdenv.mkDerivation rec {
     sha256 = "1rcdl6ryrr8fss5z5qlpl4prrw8xpbcdgajg2hpp0i7fpk21ymcc";
   };
 
+  # Fixes a build failure on aarch64-darwin. Define for all Darwin targets for when x86_64-darwin
+  # upgrades to a newer SDK.
+  NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-DTARGET_OS_IPHONE=0";
+
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace "FRAMEWORK DESTINATION /Library/Frameworks" "FRAMEWORK DESTINATION Library/Frameworks"
+  '';
+
   cmakeFlags = [
     "-DBUILD_SHARED_LIBS=ON"
     "-DWITH_LIBTOMCRYPT=ON"
   ];
 
   nativeBuildInputs = [ cmake ];
-  buildInputs = [ bzip2 libtomcrypt zlib ];
+  buildInputs = [ bzip2 libtomcrypt zlib ] ++
+    lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Carbon ];
 
   meta = with lib; {
     homepage = "https://github.com/ladislav-zezula/StormLib";