n98-magerun2: use buildComposerProject builder

This commit is contained in:
Pol Dellaiera 2024-02-20 12:42:33 +01:00
parent 42be235ec0
commit b453c845f6
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA

View File

@ -1,45 +1,27 @@
{
stdenv
, fetchurl
, makeBinaryWrapper
{ lib
, fetchFromGitHub
, php
, lib
, unzip
}:
stdenv.mkDerivation (finalAttrs: {
php.buildComposerProject (finalAttrs: {
pname = "n98-magerun2";
version = "7.3.1";
src = fetchurl {
url = "https://github.com/netz98/n98-magerun2/releases/download/${finalAttrs.version}/n98-magerun2.phar";
hash = "sha256-5G3sfyw8C3BwRqnK2o3upJTI/pENyaFCiMC4XGOkJT4=";
src = fetchFromGitHub {
owner = "netz98";
repo = "n98-magerun2";
rev = finalAttrs.version;
hash = "sha256-a1T4SmeOEKRW/xS2VBPLZt6r9JdtaJn8YVvfRnzGdb4=";
};
dontUnpack = true;
nativeBuildInputs = [
makeBinaryWrapper
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/libexec/n98-magerun2
install -D $src $out/libexec/n98-magerun2/n98-magerun2.phar
makeWrapper ${php}/bin/php $out/bin/n98-magerun2 \
--add-flags "$out/libexec/n98-magerun2/n98-magerun2.phar" \
--prefix PATH : ${lib.makeBinPath [ unzip ]}
runHook postInstall
'';
vendorHash = "sha256-1j0/spum4C9j/HNVlHwUehAFYJOz7YvMVlC6dtbNYK0=";
meta = {
changelog = "https://magerun.net/category/magerun/";
description = "The swiss army knife for Magento2 developers";
homepage = "https://magerun.net/";
license = lib.licenses.mit;
mainProgram = "n98-magerun2";
maintainers = lib.teams.php.members;
};
})