mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-18 20:11:33 +03:00
php: builders passAsFile repositories,dependencies
This commit is contained in:
parent
7a2ff69fb3
commit
4f8e284b37
@ -140,7 +140,6 @@
|
||||
inherit version;
|
||||
|
||||
src = getSource name version;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
jq
|
||||
composer
|
||||
@ -153,6 +152,9 @@
|
||||
++ map (dep: allPackages."${dep.name}"."${dep.version}")
|
||||
dependencies;
|
||||
|
||||
inherit repositoriesString dependenciesString;
|
||||
passAsFile = ["repositoriesString" "dependenciesString"];
|
||||
|
||||
dontConfigure = true;
|
||||
buildPhase = ''
|
||||
# copy source
|
||||
@ -173,16 +175,9 @@
|
||||
# disable packagist, set path repositories
|
||||
mv composer.json composer.json.orig
|
||||
|
||||
cat <<EOF >> $out/repositories.json
|
||||
${repositoriesString}
|
||||
EOF
|
||||
cat <<EOF >> $out/dependencies.json
|
||||
${dependenciesString}
|
||||
EOF
|
||||
|
||||
jq \
|
||||
--slurpfile repositories $out/repositories.json \
|
||||
--slurpfile dependencies $out/dependencies.json \
|
||||
--slurpfile repositories $repositoriesStringPath \
|
||||
--slurpfile dependencies $dependenciesStringPath \
|
||||
"(.repositories = \$repositories[0]) | \
|
||||
(.require = \$dependencies[0]) | \
|
||||
(.\"require-dev\" = {}) | \
|
||||
@ -194,10 +189,7 @@
|
||||
|
||||
rm -rfv vendor/*/*/vendor
|
||||
|
||||
# cleanup
|
||||
popd
|
||||
rm $out/repositories.json
|
||||
rm $out/dependencies.json
|
||||
'';
|
||||
installPhase = ''
|
||||
pushd $PKG_OUT
|
||||
|
@ -139,7 +139,6 @@
|
||||
inherit version;
|
||||
|
||||
src = getSource name version;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
jq
|
||||
composer
|
||||
@ -149,6 +148,9 @@
|
||||
composer
|
||||
];
|
||||
|
||||
inherit repositoriesString dependenciesString;
|
||||
passAsFile = ["repositoriesString" "dependenciesString"];
|
||||
|
||||
dontConfigure = true;
|
||||
buildPhase = ''
|
||||
# copy source
|
||||
@ -163,16 +165,9 @@
|
||||
# disable packagist, set path repositories
|
||||
mv composer.json composer.json.orig
|
||||
|
||||
cat <<EOF > $out/repositories.json
|
||||
${repositoriesString}
|
||||
EOF
|
||||
cat <<EOF > $out/dependencies.json
|
||||
${dependenciesString}
|
||||
EOF
|
||||
|
||||
jq \
|
||||
--slurpfile repositories $out/repositories.json \
|
||||
--slurpfile dependencies $out/dependencies.json \
|
||||
--slurpfile repositories $repositoriesStringPath \
|
||||
--slurpfile dependencies $dependenciesStringPath \
|
||||
"(.repositories = \$repositories[0]) | \
|
||||
(.require = \$dependencies[0]) | \
|
||||
(.\"require-dev\" = {}) | \
|
||||
@ -182,9 +177,6 @@
|
||||
# build
|
||||
composer install --no-scripts
|
||||
|
||||
# cleanup
|
||||
rm $out/repositories.json
|
||||
rm $out/dependencies.json
|
||||
popd
|
||||
'';
|
||||
installPhase = ''
|
||||
|
Loading…
Reference in New Issue
Block a user