n98-magerun: use buildComposerProject builder

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

View file

@ -1,46 +1,27 @@
{
stdenv
, fetchurl
, makeBinaryWrapper
, php
, lib
, unzip
{ lib
, fetchFromGitHub
, php81
}:
stdenv.mkDerivation (finalAttrs: {
php81.buildComposerProject (finalAttrs: {
pname = "n98-magerun";
version = "2.3.0";
src = fetchurl {
url = "https://github.com/netz98/n98-magerun/releases/download/${finalAttrs.version}/n98-magerun.phar";
hash = "sha256-s+Cdr8zU3VBaBzxOh4nXjqPe+JPPxHWiFOEVS/86qOQ=";
src = fetchFromGitHub {
owner = "netz98";
repo = "n98-magerun";
rev = finalAttrs.version;
hash = "sha256-/RffdYgl2cs8mlq4vHtzUZ6j0viV8Ot/cB/cB1dstFM=";
};
dontUnpack = true;
nativeBuildInputs = [
makeBinaryWrapper
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/libexec/n98-magerun
install -D $src $out/libexec/n98-magerun/n98-magerun.phar
makeWrapper ${php}/bin/php $out/bin/n98-magerun \
--add-flags "$out/libexec/n98-magerun/n98-magerun.phar" \
--prefix PATH : ${lib.makeBinPath [ unzip ]}
runHook postInstall
'';
vendorHash = "sha256-n608AY6AQdVuN3hfVQk02vJQ6hl/0+4LVBOsBL5o3+8=";
meta = {
broken = true; # Not compatible with PHP 8.1, see https://github.com/netz98/n98-magerun/issues/1275
changelog = "https://magerun.net/category/magerun/";
description = "The swiss army knife for Magento1/OpenMage developers";
homepage = "https://magerun.net/";
license = lib.licenses.mit;
mainProgram = "n98-magerun";
maintainers = lib.teams.php.members;
};
})