diff options
author | Pol Dellaiera <pol.dellaiera@protonmail.com> | 2024-02-20 12:26:57 +0100 |
---|---|---|
committer | Pol Dellaiera <pol.dellaiera@protonmail.com> | 2024-03-05 21:58:43 +0100 |
commit | c0b30c8fdad2a699b9ad27339b7c92d8f35bf9e9 (patch) | |
tree | 1879ef438ac398fa64821f17ece3522d4df7661c | |
parent | e65d5b7c055f78b661978b931c7f8073d7fb40c9 (diff) |
phpPackages.phive: use `buildComposerProject` builder
(cherry picked from commit dae4e32f4b046943e3913f9dde7bebbcc2b1821b)
-rw-r--r-- | pkgs/development/php-packages/phive/default.nix | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/pkgs/development/php-packages/phive/default.nix b/pkgs/development/php-packages/phive/default.nix index f5670cdfcf23d..f8efa3621ede8 100644 --- a/pkgs/development/php-packages/phive/default.nix +++ b/pkgs/development/php-packages/phive/default.nix @@ -1,32 +1,27 @@ -{ mkDerivation, fetchurl, makeWrapper, lib, php }: +{ lib +, fetchFromGitHub +, php +}: -mkDerivation rec { +php.buildComposerProject (finalAttrs: { pname = "phive"; version = "0.15.2"; - src = fetchurl { - url = "https://github.com/phar-io/phive/releases/download/${version}/phive-${version}.phar"; - sha256 = "K7B2dT7F1nL14vlql6D+fo6ewkpDnu0A/SnvlCx5Bfk="; + src = fetchFromGitHub { + owner = "phar-io"; + repo = "phive"; + rev = finalAttrs.version; + hash = "sha256-K/YZOGANcefjfdFY1XYEQknm0bPRorlRnNGC7dEegZ0="; }; - dontUnpack = true; + vendorHash = "sha256-0fJ+SyicvVONJ4FkOFTkBTekDAOjBfaLo0dZ2DYlGJU="; - nativeBuildInputs = [ makeWrapper ]; - - installPhase = '' - runHook preInstall - mkdir -p $out/bin - install -D $src $out/libexec/phive/phive.phar - makeWrapper ${php}/bin/php $out/bin/phive \ - --add-flags "$out/libexec/phive/phive.phar" - runHook postInstall - ''; - - meta = with lib; { - changelog = "https://github.com/phar-io/phive/releases/tag/${version}"; + meta = { + changelog = "https://github.com/phar-io/phive/releases/tag/${finalAttrs.version}"; description = "The Phar Installation and Verification Environment (PHIVE)"; homepage = "https://github.com/phar-io/phive"; - license = licenses.bsd3; - maintainers = with maintainers; teams.php.members; + license = lib.licenses.bsd3; + mainProgram = "phive"; + maintainers = lib.teams.php.members; }; -} +}) |