From dae4e32f4b046943e3913f9dde7bebbcc2b1821b Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 20 Feb 2024 12:26:57 +0100 Subject: [PATCH] phpPackages.phive: use `buildComposerProject` builder --- .../php-packages/phive/default.nix | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/pkgs/development/php-packages/phive/default.nix b/pkgs/development/php-packages/phive/default.nix index f5670cdfcf23..f8efa3621ede 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; }; -} +})