|
|
@ -57,7 +57,7 @@ let |
|
|
|
else |
|
|
|
$allPackages = array(); |
|
|
|
|
|
|
|
${lib.optionalString (!noDev) '' |
|
|
|
${stdenv.lib.optionalString (!noDev) '' |
|
|
|
if(array_key_exists("packages-dev", $config)) |
|
|
|
$allPackages = array_merge($allPackages, $config["packages-dev"]); |
|
|
|
''} |
|
|
@ -108,7 +108,7 @@ let |
|
|
|
}; |
|
|
|
|
|
|
|
bundleDependencies = dependencies: |
|
|
|
lib.concatMapStrings (dependencyName: |
|
|
|
stdenv.lib.concatMapStrings (dependencyName: |
|
|
|
let |
|
|
|
dependency = dependencies.${dependencyName}; |
|
|
|
in |
|
|
@ -179,24 +179,24 @@ let |
|
|
|
# Copy or symlink the provided dependencies |
|
|
|
cd vendor |
|
|
|
${bundleDependencies packages} |
|
|
|
${lib.optionalString (!noDev) (bundleDependencies devPackages)} |
|
|
|
${stdenv.lib.optionalString (!noDev) (bundleDependencies devPackages)} |
|
|
|
cd .. |
|
|
|
|
|
|
|
# Reconstruct autoload scripts |
|
|
|
# We use the optimize feature because Nix packages cannot change after they have been built |
|
|
|
# Using the dynamic loader for a Nix package is useless since there is nothing to dynamically reload. |
|
|
|
composer dump-autoload --optimize ${lib.optionalString noDev "--no-dev"} |
|
|
|
composer dump-autoload --optimize ${stdenv.lib.optionalString noDev "--no-dev"} |
|
|
|
|
|
|
|
# Run the install step as a validation to confirm that everything works out as expected |
|
|
|
composer install --optimize-autoloader ${lib.optionalString noDev "--no-dev"} |
|
|
|
composer install --optimize-autoloader ${stdenv.lib.optionalString noDev "--no-dev"} |
|
|
|
|
|
|
|
${lib.optionalString executable '' |
|
|
|
${stdenv.lib.optionalString executable '' |
|
|
|
# Reconstruct the bin/ folder if we deploy an executable project |
|
|
|
${constructBin} composer.json |
|
|
|
ln -s $(pwd)/vendor/bin $out/bin |
|
|
|
''} |
|
|
|
|
|
|
|
${lib.optionalString (!symlinkDependencies) '' |
|
|
|
${stdenv.lib.optionalString (!symlinkDependencies) '' |
|
|
|
# Patch the shebangs if possible |
|
|
|
if [ -d $(pwd)/vendor/bin ] |
|
|
|
then |
|
|
@ -232,7 +232,7 @@ let |
|
|
|
} // extraArgs); |
|
|
|
in |
|
|
|
{ |
|
|
|
composer = lib.makeOverridable composer; |
|
|
|
buildZipPackage = lib.makeOverridable buildZipPackage; |
|
|
|
buildPackage = lib.makeOverridable buildPackage; |
|
|
|
composer = stdenv.lib.makeOverridable composer; |
|
|
|
buildZipPackage = stdenv.lib.makeOverridable buildZipPackage; |
|
|
|
buildPackage = stdenv.lib.makeOverridable buildPackage; |
|
|
|
} |