-
-
Notifications
You must be signed in to change notification settings - Fork 16.5k
PHP: add new builder for PHP projects #225401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
738a683
composer: init at 2.5.8
drupol 801067d
composer-local-repo-plugin: init at ff33aaf5454888e2669f366639be9877d…
drupol aad1e20
php: add new builder `buildComposerProject`
drupol 5e50bea
phpPackages.composer: use `buildComposerProject` builder
drupol f252bac
drush-launcher: init at 0.10.2
drupol ae737e2
n98-magerun: use `builbComposerProject` builder
drupol 2d23d02
n98-magerun2: use `builbComposerProject` builder
drupol 9b24a33
phpactor: use `buildComposerProject` builder
drupol d2dab07
phpbench: init at 1.2.10
drupol a663b68
phpDocumentor: init at 3.3.1
drupol 096c1aa
pdepend: use `builbComposerProject` builder
drupol e6df051
phpunit: use `buildComposerProject` builder
drupol 7ae4d8c
platformsh: use `buildComposerProject` builder
drupol 9d08205
robo: init at 4.0.4
drupol cfd3894
wp-cli: use `buildComposerProject` builder
drupol 023afcc
phpPackages.box: use `buildComposerProject` builder
drupol 3e9ada5
phpPackages.deployer: use `buildComposerProject` builder
drupol b22cdf9
phpPackages.grumphp: use `buildComposerProject` builder
drupol 0229594
phpPackages.phan: use `builbComposerProject` builder
drupol 71dca4e
phpPackages.phing: use `builbComposerProject` builder
drupol 7efa1ac
phpPackages.phive: use `builbComposerProject` builder
drupol 3c12b2f
phpPackages.php-cs-fixer: use `buildComposerProject` builder
drupol d442679
phpPackages.php-parallel-lint: use `builbComposerProject` builder
drupol 5170504
phpPackages.phpcbf: removed, it is now included in phpcs
drupol 93e91d5
phpPackages.phpcs: use `builbComposerProject` builder
drupol 8c23df9
phpPackages.phpmd: use `builbComposerProject` builder
drupol 9a5a1a2
phpPackages.phpstan: use `buildComposerProject` builder
drupol 270bd3a
phpPackages.psalm: use `buildComposerProject` builder
drupol 5d6d60f
phpPackages.psysh: use `buildComposerProject` builder
drupol 22cb649
drush: removed, standalone installation are no more supported
drupol 5221747
php: update documentation
drupol 8b37514
composer-local-repo-plugin: Stop exposing this internal tool
etu affe641
composer: Stop exposing composer built from a phar file
etu da64d1d
php: Fix shellcheck string warnings in composer-install-hook
etu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ callPackage, stdenvNoCC, lib, writeTextDir, php, makeBinaryWrapper, fetchFromGitHub, fetchurl }: | ||
|
||
let | ||
buildComposerProjectOverride = finalAttrs: previousAttrs: | ||
|
||
let | ||
phpDrv = finalAttrs.php or php; | ||
composer = finalAttrs.composer or phpDrv.packages.composer; | ||
composer-local-repo-plugin = callPackage ./composer-local-repo-plugin.nix { }; | ||
composerLock = finalAttrs.composerLock or null; | ||
in | ||
{ | ||
nativeBuildInputs = (previousAttrs.nativeBuildInputs or [ ]) ++ [ | ||
composer | ||
composer-local-repo-plugin | ||
phpDrv.composerHooks.composerInstallHook | ||
]; | ||
|
||
buildInputs = (previousAttrs.buildInputs or [ ]) ++ [ | ||
phpDrv | ||
]; | ||
|
||
patches = previousAttrs.patches or [ ]; | ||
strictDeps = previousAttrs.strictDeps or true; | ||
|
||
# Should we keep these empty phases? | ||
configurePhase = previousAttrs.configurePhase or '' | ||
runHook preConfigure | ||
|
||
runHook postConfigure | ||
''; | ||
|
||
buildPhase = previousAttrs.buildPhase or '' | ||
runHook preBuild | ||
|
||
runHook postBuild | ||
''; | ||
|
||
doCheck = previousAttrs.doCheck or true; | ||
checkPhase = previousAttrs.checkPhase or '' | ||
runHook preCheck | ||
|
||
runHook postCheck | ||
''; | ||
|
||
installPhase = previousAttrs.installPhase or '' | ||
runHook preInstall | ||
|
||
runHook postInstall | ||
''; | ||
|
||
composerRepository = phpDrv.mkComposerRepository { | ||
inherit composer composer-local-repo-plugin composerLock; | ||
inherit (finalAttrs) patches pname src vendorHash version; | ||
}; | ||
|
||
meta = previousAttrs.meta or { } // { | ||
platforms = lib.platforms.all; | ||
}; | ||
}; | ||
in | ||
args: (stdenvNoCC.mkDerivation args).overrideAttrs buildComposerProjectOverride |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ callPackage, stdenvNoCC, lib, writeTextDir, fetchFromGitHub, php }: | ||
|
||
let | ||
mkComposerRepositoryOverride = | ||
/* | ||
We cannot destruct finalAttrs since the attrset below is used to construct it | ||
and Nix currently does not support lazy attribute names. | ||
{ | ||
php ? null, | ||
composer ? null, | ||
composerLock ? "composer.lock", | ||
src, | ||
vendorHash, | ||
... | ||
}@finalAttrs: | ||
*/ | ||
finalAttrs: previousAttrs: | ||
|
||
let | ||
phpDrv = finalAttrs.php or php; | ||
composer = finalAttrs.composer or phpDrv.packages.composer; | ||
composer-local-repo-plugin = callPackage ./composer-local-repo-plugin.nix { }; | ||
in | ||
assert (lib.assertMsg (previousAttrs ? src) "mkComposerRepository expects src argument."); | ||
assert (lib.assertMsg (previousAttrs ? vendorHash) "mkComposerRepository expects vendorHash argument."); | ||
assert (lib.assertMsg (previousAttrs ? version) "mkComposerRepository expects version argument."); | ||
assert (lib.assertMsg (previousAttrs ? pname) "mkComposerRepository expects pname argument."); | ||
{ | ||
name = "${previousAttrs.pname}-${previousAttrs.version}-composer-repository"; | ||
|
||
# See https://github.com/NixOS/nix/issues/6660 | ||
dontPatchShebangs = previousAttrs.dontPatchShebangs or true; | ||
|
||
nativeBuildInputs = (previousAttrs.nativeBuildInputs or [ ]) ++ [ | ||
composer | ||
composer-local-repo-plugin | ||
phpDrv.composerHooks.composerRepositoryHook | ||
]; | ||
|
||
buildInputs = previousAttrs.buildInputs or [ ]; | ||
|
||
strictDeps = previousAttrs.strictDeps or true; | ||
|
||
# Should we keep these empty phases? | ||
configurePhase = previousAttrs.configurePhase or '' | ||
runHook preConfigure | ||
|
||
runHook postConfigure | ||
''; | ||
|
||
buildPhase = previousAttrs.buildPhase or '' | ||
runHook preBuild | ||
|
||
runHook postBuild | ||
''; | ||
|
||
doCheck = previousAttrs.doCheck or true; | ||
checkPhase = previousAttrs.checkPhase or '' | ||
runHook preCheck | ||
|
||
runHook postCheck | ||
''; | ||
|
||
installPhase = previousAttrs.installPhase or '' | ||
runHook preInstall | ||
|
||
runHook postInstall | ||
''; | ||
|
||
COMPOSER_CACHE_DIR = "/dev/null"; | ||
COMPOSER_MIRROR_PATH_REPOS = "1"; | ||
COMPOSER_HTACCESS_PROTECT = "0"; | ||
COMPOSER_DISABLE_NETWORK = "0"; | ||
|
||
outputHashMode = "recursive"; | ||
outputHashAlgo = if (finalAttrs ? vendorHash && finalAttrs.vendorHash != "") then null else "sha256"; | ||
outputHash = finalAttrs.vendorHash or ""; | ||
}; | ||
in | ||
args: (stdenvNoCC.mkDerivation args).overrideAttrs mkComposerRepositoryOverride |
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.