summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-11-09 06:43:38 +0100
committerGitHub <noreply@github.com>2023-11-09 06:43:38 +0100
commite49468c2669c013e20e37ddb69cea65b5af8f687 (patch)
tree0b219c86bcddcf65fdf5362785f7f5759ca4c2f5 /pkgs
parent83bfbf0213a549a33e0cab3e7747de0d0156b3de (diff)
parentc9575b19aa82ea3f970b807703605f273a94ed08 (diff)
downloadnixpkgs-e49468c2669c013e20e37ddb69cea65b5af8f687.tar
nixpkgs-e49468c2669c013e20e37ddb69cea65b5af8f687.tar.gz
nixpkgs-e49468c2669c013e20e37ddb69cea65b5af8f687.tar.bz2
nixpkgs-e49468c2669c013e20e37ddb69cea65b5af8f687.tar.lz
nixpkgs-e49468c2669c013e20e37ddb69cea65b5af8f687.tar.xz
nixpkgs-e49468c2669c013e20e37ddb69cea65b5af8f687.tar.zst
nixpkgs-e49468c2669c013e20e37ddb69cea65b5af8f687.zip
Merge pull request #266162 from reckenrode/chicken-fix
chickenPackages_4.chicken: fix build on x86_64-darwin
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/compilers/chicken/4/chicken.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/development/compilers/chicken/4/chicken.nix b/pkgs/development/compilers/chicken/4/chicken.nix
index f33e594b7e2..29cf5b115b3 100644
--- a/pkgs/development/compilers/chicken/4/chicken.nix
+++ b/pkgs/development/compilers/chicken/4/chicken.nix
@@ -20,6 +20,13 @@ stdenv.mkDerivation {
     sha256 = "0hvckhi5gfny3mlva6d7y9pmx7cbwvq0r7mk11k3sdiik9hlkmdd";
   };
 
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    # There is not enough space in the load command to accomodate a full path to the store,
+    # so use `@executable_path` to specify a relative path to chicken’s lib folder.
+    sed -e '/POSTINSTALL_PROGRAM_FLAGS = /{s|$(LIBDIR)|@executable_path/../lib|}' \
+      -i Makefile.macosx
+  '';
+
   setupHook = lib.optional (bootstrap-chicken != null) ./setup-hook.sh;
 
   # -fno-strict-overflow is not a supported argument in clang on darwin
@@ -31,7 +38,7 @@ stdenv.mkDerivation {
   ] ++ (lib.optionals stdenv.isDarwin [
     "XCODE_TOOL_PATH=${darwin.binutils.bintools}/bin"
     "C_COMPILER=$(CC)"
-    "POSTINSTALL_PROGRAM=install_name_tool"
+    "POSTINSTALL_PROGRAM=${stdenv.cc.targetPrefix}install_name_tool"
   ]);
 
   # We need a bootstrap-chicken to regenerate the c-files after