diff options
Diffstat (limited to 'pkgs/build-support/php/pkgs')
-rw-r--r-- | pkgs/build-support/php/pkgs/composer-local-repo-plugin.nix | 113 | ||||
-rw-r--r-- | pkgs/build-support/php/pkgs/composer-phar.nix | 38 |
2 files changed, 23 insertions, 128 deletions
diff --git a/pkgs/build-support/php/pkgs/composer-local-repo-plugin.nix b/pkgs/build-support/php/pkgs/composer-local-repo-plugin.nix deleted file mode 100644 index bfdc3d4f98d1b..0000000000000 --- a/pkgs/build-support/php/pkgs/composer-local-repo-plugin.nix +++ /dev/null @@ -1,113 +0,0 @@ -{ php, callPackage, stdenvNoCC, lib, fetchFromGitHub, makeBinaryWrapper }: - -let - composer = callPackage ./composer-phar.nix { - inherit (php.packages.composer) version pharHash; - }; - - composerKeys = stdenvNoCC.mkDerivation (finalComposerKeysAttrs: { - pname = "composer-keys"; - version = "fa5a62092f33e094073fbda23bbfc7188df3cbc5"; - - src = fetchFromGitHub { - owner = "composer"; - repo = "composer.github.io"; - rev = "${finalComposerKeysAttrs.version}"; - hash = "sha256-3Sfn71LDG1jHwuEIU8iEnV3k6D6QTX7KVIKVaNSuCVE="; - }; - - installPhase = '' - runHook preInstall - - mkdir -p $out - install releases.pub $out/keys.tags.pub - install snapshots.pub $out/keys.dev.pub - - runHook postInstall - ''; - }); -in -stdenvNoCC.mkDerivation (finalAttrs: { - pname = "composer-local-repo-plugin"; - version = "1.1.0"; - - src = fetchFromGitHub { - owner = "nix-community"; - repo = "composer-local-repo-plugin"; - rev = finalAttrs.version; - hash = "sha256-edbn07r/Uc1g0qOuVBZBs6N1bMN5kIfA1b4FCufdw5M="; - }; - - COMPOSER_CACHE_DIR = "/dev/null"; - COMPOSER_MIRROR_PATH_REPOS = "1"; - COMPOSER_HTACCESS_PROTECT = "0"; - COMPOSER_DISABLE_NETWORK = "1"; - - nativeBuildInputs = [ - makeBinaryWrapper - ]; - - buildInputs = [ - composer - ]; - - configurePhase = '' - runHook preConfigure - - export COMPOSER_HOME=${placeholder "out"} - - runHook postConfigure - ''; - - buildPhase = '' - runHook preBuild - - # Configure composer globally - composer global init --quiet --no-interaction --no-ansi \ - --name="nixos/composer" \ - --homepage "https://nixos.org/" \ - --description "Composer with nix-community/composer-local-repo-plugin" \ - --license "MIT" - - composer global config --quiet minimum-stability dev - composer global config --quiet prefer-stable true - composer global config --quiet apcu-autoloader false - composer global config --quiet allow-plugins.nix-community/composer-local-repo-plugin true - composer global config --quiet repo.packagist false - composer global config --quiet repo.plugin path $src - - # Install the local repository plugin - composer global require --quiet --no-ansi --no-interaction nix-community/composer-local-repo-plugin - - runHook postBuild - ''; - - checkPhase = '' - runHook preCheck - - composer global validate --no-ansi - composer global show --no-ansi nix-community/composer-local-repo-plugin - - runHook postCheck - ''; - - installPhase = '' - runHook preInstall - - mkdir -p $out - cp -ar ${composerKeys}/* $out/ - - makeWrapper ${composer}/bin/composer $out/bin/composer-local-repo-plugin \ - --prefix COMPOSER_HOME : $out - - runHook postInstall - ''; - - meta = { - description = "Composer local repo plugin for Composer"; - homepage = "https://github.com/nix-community/composer-local-repo-plugin"; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ drupol ]; - platforms = lib.platforms.all; - }; -}) diff --git a/pkgs/build-support/php/pkgs/composer-phar.nix b/pkgs/build-support/php/pkgs/composer-phar.nix index f281334ab2d9f..b07c25beec55f 100644 --- a/pkgs/build-support/php/pkgs/composer-phar.nix +++ b/pkgs/build-support/php/pkgs/composer-phar.nix @@ -1,17 +1,16 @@ { - _7zz - , cacert - , curl - , fetchurl - , git - , lib - , makeBinaryWrapper - , php - , stdenvNoCC - , unzip - , xz - , version - , pharHash + _7zz, + curl, + fetchurl, + git, + lib, + makeBinaryWrapper, + php, + stdenvNoCC, + unzip, + xz, + version, + pharHash, }: stdenvNoCC.mkDerivation (finalAttrs: { @@ -32,9 +31,17 @@ stdenvNoCC.mkDerivation (finalAttrs: { mkdir -p $out/bin install -D $src $out/libexec/composer/composer.phar - makeWrapper ${php}/bin/php $out/bin/composer \ + makeWrapper ${lib.getExe php} $out/bin/composer \ --add-flags "$out/libexec/composer/composer.phar" \ - --prefix PATH : ${lib.makeBinPath [ _7zz cacert curl git unzip xz ]} + --prefix PATH : ${ + lib.makeBinPath [ + _7zz + curl + git + unzip + xz + ] + } runHook postInstall ''; @@ -44,6 +51,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { description = "Dependency Manager for PHP, shipped from the PHAR file"; homepage = "https://getcomposer.org/"; license = lib.licenses.mit; + mainProgram = "composer"; maintainers = with lib.maintainers; [ drupol ]; platforms = lib.platforms.all; }; |