nixos/alsa: reintroduce hardware.alsa.enablePersistence (#373529)
[NixPkgs.git] / pkgs / build-support / php / builders / v2 / hooks / composer-install-hook.sh
blob95901469f8f919cfcc131118c244c8b7dadfe659
1 declare composerVendor
2 declare version
3 declare composerNoDev
4 declare composerNoPlugins
5 declare composerNoScripts
7 preConfigureHooks+=(composerInstallConfigureHook)
8 preBuildHooks+=(composerInstallBuildHook)
9 preCheckHooks+=(composerInstallCheckHook)
10 preInstallHooks+=(composerInstallInstallHook)
12 source @phpScriptUtils@
14 composerInstallConfigureHook() {
15 echo "Executing composerInstallConfigureHook"
17 setComposerRootVersion
19 if [[ ! -e "${composerVendor}" ]]; then
20 echo "No local composer vendor found."
21 exit 1
24 install -Dm644 ${composerVendor}/composer.json .
26 if [[ -f "${composerVendor}/composer.lock" ]]; then
27 install -Dm644 ${composerVendor}/composer.lock .
30 if [[ -f "composer.lock" ]]; then
31 chmod +w composer.lock
34 chmod +w composer.json
36 echo "Finished composerInstallConfigureHook"
39 composerInstallBuildHook() {
40 echo "Executing composerInstallBuildHook"
42 echo "Finished composerInstallBuildHook"
45 composerInstallCheckHook() {
46 echo "Executing composerInstallCheckHook"
48 checkComposerValidate
50 echo "Finished composerInstallCheckHook"
53 composerInstallInstallHook() {
54 echo "Executing composerInstallInstallHook"
56 cp -ar ${composerVendor}/* .
58 # Copy the relevant files only in the store.
59 mkdir -p "$out"/share/php/"${pname}"
60 cp -r . "$out"/share/php/"${pname}"/
62 # Create symlinks for the binaries.
63 jq -r -c 'try (.bin[] | select(test(".bat$")? | not) )' composer.json | while read -r bin; do
64 echo -e "\e[32mCreating symlink ${bin}...\e[0m"
65 mkdir -p "$out"/bin
66 ln -s "$out"/share/php/"${pname}"/"$bin" "$out"/bin/"$(basename "$bin")"
67 done
69 echo "Finished composerInstallInstallHook"