about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPol Dellaiera <pol.dellaiera@protonmail.com>2024-02-20 12:40:28 +0100
committerPol Dellaiera <pol.dellaiera@protonmail.com>2024-03-05 21:58:43 +0100
commitaa3346b50adb83b75aa56c47612990fb2dd8aef7 (patch)
treed033899ead6d0d9e763da05e0107ea6f1ac9105c
parent41a96b8a9f70140d71783c1cc263f1c2fe30e00a (diff)
n98-magerun: use `buildComposerProject` builder
(cherry picked from commit 42be235ec004c9fe3579ca9ef3ea29f47e92f673)
-rw-r--r--pkgs/development/tools/misc/n98-magerun/default.nix41
1 files changed, 11 insertions, 30 deletions
diff --git a/pkgs/development/tools/misc/n98-magerun/default.nix b/pkgs/development/tools/misc/n98-magerun/default.nix
index dadca94c37b0a..08196dc041af7 100644
--- a/pkgs/development/tools/misc/n98-magerun/default.nix
+++ b/pkgs/development/tools/misc/n98-magerun/default.nix
@@ -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;
   };
 })