about summary refs log tree commit diff
path: root/pkgs/development/compilers/chicken/4/chicken.nix
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-11-09 06:01:40 +0000
committerGitHub <noreply@github.com>2023-11-09 06:01:40 +0000
commitfecd99b105c644b1b61abfec6c203b304269e1e2 (patch)
treeba0cde17b0de008691f339cdae1c4d19369a729c /pkgs/development/compilers/chicken/4/chicken.nix
parent50249cdaf29f872fb960dc9110696d208a77fc3a (diff)
parent4aad65bfdbc56be726873b09b4bbaa88448ecbba (diff)
downloadnixlib-fecd99b105c644b1b61abfec6c203b304269e1e2.tar
nixlib-fecd99b105c644b1b61abfec6c203b304269e1e2.tar.gz
nixlib-fecd99b105c644b1b61abfec6c203b304269e1e2.tar.bz2
nixlib-fecd99b105c644b1b61abfec6c203b304269e1e2.tar.lz
nixlib-fecd99b105c644b1b61abfec6c203b304269e1e2.tar.xz
nixlib-fecd99b105c644b1b61abfec6c203b304269e1e2.tar.zst
nixlib-fecd99b105c644b1b61abfec6c203b304269e1e2.zip
Merge staging-next into staging
Diffstat (limited to 'pkgs/development/compilers/chicken/4/chicken.nix')
-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 f33e594b7e25..29cf5b115b30 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