forked from M-Labs/it-infra
nixbld: minor flarum updates, install FoF/subscribed
This commit is contained in:
parent
7d04f99e33
commit
86c840d7f0
@ -1,6 +1,6 @@
|
||||
# This file originates from composer2nix
|
||||
|
||||
{ stdenv, writeTextFile, fetchurl, php, unzip, phpPackages }:
|
||||
{ stdenv, lib, writeTextFile, fetchurl, php, unzip, phpPackages }:
|
||||
|
||||
let
|
||||
inherit (phpPackages) composer;
|
||||
@ -28,6 +28,7 @@ let
|
||||
, removeComposerArtifacts ? false
|
||||
, postInstall ? ""
|
||||
, noDev ? false
|
||||
, composerExtraArgs ? ""
|
||||
, unpackPhase ? "true"
|
||||
, buildPhase ? "true"
|
||||
, ...}@args:
|
||||
@ -57,7 +58,7 @@ let
|
||||
else
|
||||
$allPackages = array();
|
||||
|
||||
${stdenv.lib.optionalString (!noDev) ''
|
||||
${lib.optionalString (!noDev) ''
|
||||
if(array_key_exists("packages-dev", $config))
|
||||
$allPackages = array_merge($allPackages, $config["packages-dev"]);
|
||||
''}
|
||||
@ -108,7 +109,7 @@ let
|
||||
};
|
||||
|
||||
bundleDependencies = dependencies:
|
||||
stdenv.lib.concatMapStrings (dependencyName:
|
||||
lib.concatMapStrings (dependencyName:
|
||||
let
|
||||
dependency = dependencies.${dependencyName};
|
||||
in
|
||||
@ -174,29 +175,29 @@ let
|
||||
|
||||
# Reconstruct the installed.json file from the lock file
|
||||
mkdir -p vendor/composer
|
||||
${reconstructInstalled} composer.lock > vendor/composer/installed.json
|
||||
${php}/bin/php ${reconstructInstalled} composer.lock > vendor/composer/installed.json
|
||||
|
||||
# Copy or symlink the provided dependencies
|
||||
cd vendor
|
||||
${bundleDependencies packages}
|
||||
${stdenv.lib.optionalString (!noDev) (bundleDependencies devPackages)}
|
||||
${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 ${stdenv.lib.optionalString noDev "--no-dev"}
|
||||
composer dump-autoload --optimize ${lib.optionalString noDev "--no-dev"} ${composerExtraArgs}
|
||||
|
||||
# Run the install step as a validation to confirm that everything works out as expected
|
||||
composer install --optimize-autoloader ${stdenv.lib.optionalString noDev "--no-dev"}
|
||||
composer install --optimize-autoloader ${lib.optionalString noDev "--no-dev"} ${composerExtraArgs}
|
||||
|
||||
${stdenv.lib.optionalString executable ''
|
||||
${lib.optionalString executable ''
|
||||
# Reconstruct the bin/ folder if we deploy an executable project
|
||||
${constructBin} composer.json
|
||||
${php}/bin/php ${constructBin} composer.json
|
||||
ln -s $(pwd)/vendor/bin $out/bin
|
||||
''}
|
||||
|
||||
${stdenv.lib.optionalString (!symlinkDependencies) ''
|
||||
${lib.optionalString (!symlinkDependencies) ''
|
||||
# Patch the shebangs if possible
|
||||
if [ -d $(pwd)/vendor/bin ]
|
||||
then
|
||||
@ -232,7 +233,7 @@ let
|
||||
} // extraArgs);
|
||||
in
|
||||
{
|
||||
composer = stdenv.lib.makeOverridable composer;
|
||||
buildZipPackage = stdenv.lib.makeOverridable buildZipPackage;
|
||||
buildPackage = stdenv.lib.makeOverridable buildPackage;
|
||||
composer = lib.makeOverridable composer;
|
||||
buildZipPackage = lib.makeOverridable buildZipPackage;
|
||||
buildPackage = lib.makeOverridable buildPackage;
|
||||
}
|
||||
|
@ -58,7 +58,8 @@
|
||||
"flarum/subscriptions": "^0.1.0",
|
||||
"flarum/suspend": "^0.1.0",
|
||||
"flarum/tags": "^0.1.0",
|
||||
"fof/upload": "^0.10.0"
|
||||
"fof/upload": "^0.10.0",
|
||||
"fof/subscribed": "*"
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist",
|
||||
|
1624
nixbld-etc-nixos/flarum/composer.lock
generated
1624
nixbld-etc-nixos/flarum/composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -4,10 +4,10 @@
|
||||
|
||||
let
|
||||
composerEnv = import ./composer-env.nix {
|
||||
inherit (pkgs) stdenv writeTextFile fetchurl php unzip phpPackages;
|
||||
inherit (pkgs) stdenv lib writeTextFile fetchurl php unzip phpPackages;
|
||||
};
|
||||
in
|
||||
import ./php-packages.nix {
|
||||
inherit composerEnv noDev;
|
||||
inherit (pkgs) fetchurl fetchgit fetchhg fetchsvn;
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user