phpPackages.phive: use buildComposerProject builder

This commit is contained in:
Pol Dellaiera 2024-02-20 12:26:57 +01:00
parent b7f3d0df8f
commit dae4e32f4b
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA

View File

@ -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;
};
}
})