mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-10 08:39:08 +03:00
phpPackages.mkDerivation: use lib.{fix,extends} instead of //
// on a overrideAttrs'able works badly here we use lib.fix and lib.extends instead of overrideAttrs to have less of a performance impact
This commit is contained in:
parent
315664758c
commit
4d32075a0e
@ -1,11 +1,11 @@
|
||||
{ mkDerivation, fetchurl, makeWrapper, lib, php }:
|
||||
|
||||
mkDerivation rec {
|
||||
mkDerivation (finalAttrs: {
|
||||
pname = "grumphp";
|
||||
version = "1.15.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/phpro/${pname}/releases/download/v${version}/${pname}.phar";
|
||||
url = "https://github.com/phpro/grumphp/releases/download/v${finalAttrs.version}/grumphp.phar";
|
||||
sha256 = "sha256-EqzJb7DYZb7PnebErLVI/EZLxj0m26cniZlsu1feif0=";
|
||||
};
|
||||
|
||||
@ -16,17 +16,17 @@ mkDerivation rec {
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
install -D $src $out/libexec/${pname}/grumphp.phar
|
||||
install -D $src $out/libexec/grumphp/grumphp.phar
|
||||
makeWrapper ${php}/bin/php $out/bin/grumphp \
|
||||
--add-flags "$out/libexec/${pname}/grumphp.phar"
|
||||
--add-flags "$out/libexec/grumphp/grumphp.phar"
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
changelog = "https://github.com/phpro/grumphp/releases/tag/v${version}";
|
||||
changelog = "https://github.com/phpro/grumphp/releases/tag/v${finalAttrs.version}";
|
||||
description = "A PHP code-quality tool";
|
||||
homepage = "https://github.com/phpro/grumphp";
|
||||
license = licenses.mit;
|
||||
maintainers = teams.php.members;
|
||||
};
|
||||
}
|
||||
})
|
||||
|
@ -57,15 +57,22 @@ lib.makeScope pkgs.newScope (self: with self; {
|
||||
|
||||
# Wrap mkDerivation to prepend pname with "php-" to make names consistent
|
||||
# with how buildPecl does it and make the file easier to overview.
|
||||
mkDerivation = { pname, ... }@args: pkgs.stdenv.mkDerivation (args // {
|
||||
pname = "php-${pname}";
|
||||
passthru = {
|
||||
updateScript = nix-update-script {};
|
||||
};
|
||||
meta = args.meta // {
|
||||
mainProgram = args.meta.mainProgram or pname;
|
||||
};
|
||||
});
|
||||
mkDerivation = origArgs:
|
||||
let
|
||||
args = lib.fix (lib.extends
|
||||
(_: previousAttrs: {
|
||||
pname = "php-${previousAttrs.pname}";
|
||||
passthru = (previousAttrs.passthru or { }) // {
|
||||
updateScript = nix-update-script { };
|
||||
};
|
||||
meta = (previousAttrs.meta or { }) // {
|
||||
mainProgram = previousAttrs.meta.mainProgram or previousAttrs.pname;
|
||||
};
|
||||
})
|
||||
(if lib.isFunction origArgs then origArgs else (_: origArgs))
|
||||
);
|
||||
in
|
||||
pkgs.stdenv.mkDerivation args;
|
||||
|
||||
# Function to build an extension which is shipped as part of the php
|
||||
# source, based on the php version.
|
||||
|
Loading…
Reference in New Issue
Block a user