about summary refs log tree commit diff
path: root/pkgs/build-support/php
diff options
context:
space:
mode:
authorPol Dellaiera <pol.dellaiera@protonmail.com>2023-09-14 21:40:33 +0200
committerPol Dellaiera <pol.dellaiera@protonmail.com>2023-09-14 21:40:33 +0200
commita2f8623363e186271cbe2abae1bcac429d49c340 (patch)
tree0ee550535c2a8762680611736637210ef9cdfa78 /pkgs/build-support/php
parent2cd86bf59a9441072f9d557099d4b6385c3a4582 (diff)
build-support/php: prevent the creation of symlinks
Using symbolic links create issues on Darwin, therefore, using `makeWrapper` fix this.
Diffstat (limited to 'pkgs/build-support/php')
-rw-r--r--pkgs/build-support/php/hooks/composer-install-hook.sh2
-rw-r--r--pkgs/build-support/php/hooks/default.nix7
2 files changed, 5 insertions, 4 deletions
diff --git a/pkgs/build-support/php/hooks/composer-install-hook.sh b/pkgs/build-support/php/hooks/composer-install-hook.sh
index 9f23b90fa401d..bb6cb47e861b9 100644
--- a/pkgs/build-support/php/hooks/composer-install-hook.sh
+++ b/pkgs/build-support/php/hooks/composer-install-hook.sh
@@ -106,7 +106,7 @@ composerInstallInstallHook() {
     # Create symlinks for the binaries.
     jq -r -c 'try .bin[]' composer.json | while read -r bin; do
         mkdir -p "$out"/share/php/"${pname}" "$out"/bin
-        ln -s "$out"/share/php/"${pname}"/"$bin" "$out"/bin/"$(basename "$bin")"
+        makeWrapper "$out"/share/php/"${pname}"/"$bin" "$out"/bin/"$(basename "$bin")"
     done
 
     echo "Finished composerInstallInstallHook"
diff --git a/pkgs/build-support/php/hooks/default.nix b/pkgs/build-support/php/hooks/default.nix
index 98198f0128795..e7de98647c397 100644
--- a/pkgs/build-support/php/hooks/default.nix
+++ b/pkgs/build-support/php/hooks/default.nix
@@ -1,21 +1,22 @@
 { makeSetupHook
-, php
 , jq
 , moreutils
+, makeBinaryWrapper
+, php
 }:
 
 {
   composerRepositoryHook = makeSetupHook
     {
       name = "composer-repository-hook.sh";
-      propagatedBuildInputs = [ php jq moreutils ];
+      propagatedBuildInputs = [ jq moreutils php ];
       substitutions = { };
     } ./composer-repository-hook.sh;
 
   composerInstallHook = makeSetupHook
     {
       name = "composer-install-hook.sh";
-      propagatedBuildInputs = [ php jq moreutils ];
+      propagatedBuildInputs = [ jq makeBinaryWrapper moreutils php ];
       substitutions = { };
     } ./composer-install-hook.sh;
 }