Merge pull request #285828 from drupol/php/remove-COMPOSER-ROOT-VERSION-env

build-support/php: set `COMPOSER_ROOT_VERSION` environment variable
This commit is contained in:
Thomas Gerbet 2024-02-26 20:38:02 +01:00 committed by GitHub
commit 3a19a727c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
27 changed files with 17399 additions and 662 deletions

View File

@ -9,6 +9,8 @@ preBuildHooks+=(composerInstallBuildHook)
preCheckHooks+=(composerInstallCheckHook)
preInstallHooks+=(composerInstallInstallHook)
source @phpScriptUtils@
composerInstallConfigureHook() {
echo "Executing composerInstallConfigureHook"
@ -22,6 +24,8 @@ composerInstallConfigureHook() {
fi
if [[ ! -f "composer.lock" ]]; then
setComposeRootVersion
composer \
--no-ansi \
--no-install \
@ -75,6 +79,8 @@ composerInstallConfigureHook() {
composerInstallBuildHook() {
echo "Executing composerInstallBuildHook"
setComposeRootVersion
# Since this file cannot be generated in the composer-repository-hook.sh
# because the file contains hardcoded nix store paths, we generate it here.
composer-local-repo-plugin --no-ansi build-local-repo -m "${composerRepository}" .
@ -90,7 +96,6 @@ composerInstallBuildHook() {
# Since the composer.json file has been modified in the previous step, the
# composer.lock file needs to be updated.
COMPOSER_ROOT_VERSION="${version}" \
composer \
--lock \
--no-ansi \
@ -134,11 +139,10 @@ composerInstallCheckHook() {
composerInstallInstallHook() {
echo "Executing composerInstallInstallHook"
setComposeRootVersion
# Finally, run `composer install` to install the dependencies and generate
# the autoloader.
# The COMPOSER_ROOT_VERSION environment variable is needed only for
# vimeo/psalm.
COMPOSER_ROOT_VERSION="${version}" \
composer \
--no-ansi \
--no-interaction \

View File

@ -10,6 +10,8 @@ preBuildHooks+=(composerRepositoryBuildHook)
preCheckHooks+=(composerRepositoryCheckHook)
preInstallHooks+=(composerRepositoryInstallHook)
source @phpScriptUtils@
composerRepositoryConfigureHook() {
echo "Executing composerRepositoryConfigureHook"
@ -18,7 +20,8 @@ composerRepositoryConfigureHook() {
fi
if [[ ! -f "composer.lock" ]]; then
COMPOSER_ROOT_VERSION="${version}" \
setComposeRootVersion
composer \
--no-ansi \
--no-install \
@ -55,6 +58,8 @@ composerRepositoryBuildHook() {
mkdir -p repository
setComposeRootVersion
# Build the local composer repository
# The command 'build-local-repo' is provided by the Composer plugin
# nix-community/composer-local-repo-plugin.

View File

@ -2,18 +2,28 @@
, makeSetupHook
, diffutils
, jq
, writeShellApplication
, moreutils
, makeBinaryWrapper
, cacert
, buildPackages
}:
let
php-script-utils = writeShellApplication {
name = "php-script-utils";
runtimeInputs = [ jq ];
text = builtins.readFile ./php-script-utils.bash;
};
in
{
composerRepositoryHook = makeSetupHook
{
name = "composer-repository-hook.sh";
propagatedBuildInputs = [ jq moreutils cacert ];
substitutions = { };
substitutions = {
phpScriptUtils = lib.getExe php-script-utils;
};
} ./composer-repository-hook.sh;
composerInstallHook = makeSetupHook
@ -24,6 +34,7 @@
# Specify the stdenv's `diff` by abspath to ensure that the user's build
# inputs do not cause us to find the wrong `diff`.
cmp = "${lib.getBin buildPackages.diffutils}/bin/cmp";
phpScriptUtils = lib.getExe php-script-utils;
};
} ./composer-install-hook.sh;
}

View File

@ -0,0 +1,12 @@
declare version
setComposeRootVersion() {
set +e # Disable exit on error
if [[ -v version ]]; then
echo -e "\e[32mSetting COMPOSER_ROOT_VERSION to $version\e[0m"
export COMPOSER_ROOT_VERSION=$version
fi
set -e
}

View File

@ -1,36 +1,26 @@
{ mkDerivation, fetchurl, makeWrapper, installShellFiles, lib, php }:
{ lib
, fetchFromGitHub
, php
}:
mkDerivation rec {
php.buildComposerProject (finalAttrs: {
pname = "deployer";
version = "6.8.0";
version = "7.3.3";
src = fetchurl {
url = "https://deployer.org/releases/v${version}/${pname}.phar";
sha256 = "09mxwfa7yszsiljbkxpsd4sghqngl08cn18v4g1fbsxp3ib3kxi5";
src = fetchFromGitHub {
owner = "deployphp";
repo = "deployer";
rev = "v${finalAttrs.version}^";
hash = "sha256-zvK7NwIACAhWN/7D8lVY1Bv8x6xKAp/L826SovQhDYg=";
};
dontUnpack = true;
vendorHash = "sha256-BDq2uryNWC31AEAEZJL9zGaAPbhXZ6hmfpsnr4wlixE=";
nativeBuildInputs = [ makeWrapper installShellFiles ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/deployer/deployer.phar
makeWrapper ${php}/bin/php $out/bin/dep --add-flags "$out/libexec/deployer/deployer.phar"
# fish support currently broken: https://github.com/deployphp/deployer/issues/2527
installShellCompletion --cmd dep \
--bash <($out/bin/dep autocomplete --install) \
--zsh <($out/bin/dep autocomplete --install)
runHook postInstall
'';
meta = with lib; {
description = "A deployment tool for PHP";
license = licenses.mit;
meta = {
description = "The PHP deployment tool with support for popular frameworks out of the box";
homepage = "https://deployer.org/";
license = lib.licenses.mit;
mainProgram = "dep";
maintainers = with maintainers; teams.php.members;
maintainers = lib.teams.php.members;
};
}
})

View File

@ -1,42 +1,30 @@
{ lib
, fetchFromGitHub
, php
, mkDerivation
, fetchurl
, makeWrapper
}:
let
php' = php.withExtensions ({ enabled, all }: enabled ++ [ all.ast ]);
in
mkDerivation rec {
(php.withExtensions({ enabled, all }: enabled ++ (with all; [ ast ]))).buildComposerProject (finalAttrs: {
pname = "phan";
version = "5.4.3";
src = fetchurl {
url = "https://github.com/phan/phan/releases/download/${version}/phan.phar";
hash = "sha256-wZU6YIlH0q18iD044y6Z5gSscBn7cI0AwRwZgT/YhOo=";
src = fetchFromGitHub {
owner = "phan";
repo = "phan";
rev = finalAttrs.version;
hash = "sha256-O0dtnDsz6X99B99VbRQf3Wr/xJfsJqd+2l5Z5iWxHyU=";
};
dontUnpack = true;
vendorHash = "sha256-yE85MBseJa0VGV5EbjT0te4QT3697YvtumGkMMfZtxI=";
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/phan/phan.phar
makeWrapper ${php'}/bin/php $out/bin/phan \
--add-flags "$out/libexec/phan/phan.phar"
runHook postInstall
'';
meta = with lib; {
meta = {
description = "Static analyzer for PHP";
homepage = "https://github.com/phan/phan";
license = lib.licenses.mit;
longDescription = ''
Phan is a static analyzer for PHP. Phan prefers to avoid false-positives
and attempts to prove incorrectness rather than correctness.
'';
license = licenses.mit;
homepage = "https://github.com/phan/phan";
maintainers = [ maintainers.apeschar ];
mainProgram = "phan";
maintainers = with lib.maintainers; [ apeschar ] ++ lib.teams.php.members;
};
}
})

File diff suppressed because it is too large Load Diff

View File

@ -1,34 +1,29 @@
{ mkDerivation, fetchurl, makeWrapper, lib, php }:
{ lib
, fetchFromGitHub
, php
}:
let
(php.withExtensions({ enabled, all }: enabled ++ (with all; [ xsl ]))).buildComposerProject (finalAttrs: {
pname = "phing";
version = "2.17.4";
in
mkDerivation {
inherit pname version;
version = "3.0.0-rc6";
src = fetchurl {
url = "https://github.com/phingofficial/phing/releases/download/v${version}/phing-${version}.phar";
sha256 = "sha256-3QZsl5QJkFX5Z4RovMtw2ELCp8Zl4xiZsIBikakJ474=";
src = fetchFromGitHub {
owner = "phingofficial";
repo = "phing";
rev = finalAttrs.version;
hash = "sha256-pOt6uQaz69WuHKYZhq6FFbjyHGrEc+Bf0Sw9uCS3Nrc=";
};
dontUnpack = true;
# TODO: Open a PR against https://github.com/phingofficial/phing
# Their `composer.lock` is out of date therefore, we need to provide one
composerLock = ./composer.lock;
vendorHash = "sha256-ueTbbz3FGyRcRvlcJNirHdC77Tko4RKtYMFB3+4JdnQ=";
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/phing/phing.phar
makeWrapper ${php}/bin/php $out/bin/phing \
--add-flags "$out/libexec/phing/phing.phar"
runHook postInstall
'';
meta = with lib; {
meta = {
description = "PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant";
license = licenses.lgpl3;
homepage = "https://github.com/phingofficial/phing";
maintainers = with maintainers; teams.php.members;
license = lib.licenses.lgpl3;
mainProgram = "phing";
maintainers = lib.teams.php.members;
};
}
})

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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,27 @@
{ fetchFromGitHub
, lib
, php
}:
php.buildComposerProject (finalAttrs: {
pname = "php-codesniffer";
version = "3.7.2";
src = fetchFromGitHub {
owner = "squizlabs";
repo = "PHP_CodeSniffer";
rev = "${finalAttrs.version}";
hash = "sha256-EJF9e8gyUy5SZ+lmyWFPAabqnP7Fy5t80gfXWWxLpk8=";
};
composerLock = ./composer.lock;
vendorHash = "sha256-svkQEKKFa0yFTiOihnAzVdi3oolq3r6JmlugyBZJATA=";
meta = {
changelog = "https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/${finalAttrs.version}";
description = "PHP coding standard tool";
license = lib.licenses.bsd3;
homepage = "https://github.com/PHPCSStandards/PHP_CodeSniffer/";
maintainers = with lib.maintainers; [ javaguirre ] ++ lib.teams.php.members;
};
})

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +1,30 @@
{ mkDerivation, fetchurl, makeWrapper, lib, php }:
{ lib
, fetchFromGitHub
, php
}:
let
php.buildComposerProject (finalAttrs: {
pname = "php-cs-fixer";
version = "3.50.0";
in
mkDerivation {
inherit pname version;
src = fetchurl {
url = "https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v${version}/php-cs-fixer.phar";
sha256 = "sha256-bJd/bsb2mJbQi4J1Z2uN4A2oLG+wqyq32rNDwcLC8gc=";
src = fetchFromGitHub {
owner = "PHP-CS-Fixer";
repo = "PHP-CS-Fixer";
rev = "v${finalAttrs.version}";
hash = "sha256-T0R/TfCLG9+Vcbsm5W8/7weI+e1RuSzTBc3VmRlG74c=";
};
dontUnpack = true;
# TODO: Open a PR against https://github.com/PHP-CS-Fixer/PHP-CS-Fixer
# Missing `composer.lock` from the repository.
composerLock = ./composer.lock;
vendorHash = "sha256-kcEB7UZ++ZY5vhaoPGjaC3q1fpxYcZ/yZeMP3AdQBEk=";
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/php-cs-fixer/php-cs-fixer.phar
makeWrapper ${php}/bin/php $out/bin/php-cs-fixer \
--add-flags "$out/libexec/php-cs-fixer/php-cs-fixer.phar"
runHook postInstall
'';
meta = with lib; {
changelog = "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/tag/${version}";
meta = {
changelog = "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/tag/${finalAttrs.version}";
description = "A tool to automatically fix PHP coding standards issues";
license = licenses.mit;
homepage = "https://cs.symfony.com/";
maintainers = with maintainers; [ ] ++ teams.php.members;
license = lib.licenses.mit;
mainProgram = "php-cs-fixer";
maintainers = lib.teams.php.members;
};
}
})

File diff suppressed because it is too large Load Diff

View File

@ -1,48 +1,27 @@
{ mkDerivation, fetchFromGitHub, makeWrapper, lib, php, php81 }:
let
{ fetchFromGitHub
, lib
, php
}:
php.buildComposerProject (finalAttrs: {
pname = "php-parallel-lint";
version = "1.3.2";
in
mkDerivation {
inherit pname version;
version = "1.3.2.999";
src = fetchFromGitHub {
owner = "php-parallel-lint";
repo = "PHP-Parallel-Lint";
rev = "v${version}";
# `.gitattibutes` exclude `box.json` from the archive produced git.
forceFetchGit = true;
sha256 = "SPP1ynxJad2m5wknGt8z94fW7Ucx8nqLvwZVmlylOgM=";
rev = "539292fea03d718cc86e7137ad72ea35b694f2bf";
hash = "sha256-VIBuS4PwRt20Ic5gYAXTv8p/5Nq/0B3VwMcp9zKbu5U=";
};
nativeBuildInputs = [
makeWrapper
php.packages.composer
# box is only available for PHP ≥ 8.1 but the purpose of this tool is to validate
# that project does not use features not available on older PHP versions.
php81.packages.box
];
composerLock = ./composer.lock;
vendorHash = "sha256-PHQ0N1eFCM4s/aPVpTsyZN5gnQpNe9Wfs6CG2RNxxbk=";
buildPhase = ''
runHook preBuild
composer dump-autoload
box compile
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D parallel-lint.phar $out/libexec/php-parallel-lint/php-parallel-lint.phar
makeWrapper ${php}/bin/php $out/bin/php-parallel-lint \
--add-flags "$out/libexec/php-parallel-lint/php-parallel-lint.phar"
runHook postInstall
'';
meta = with lib; {
meta = {
description = "Tool to check syntax of PHP files faster than serial check with fancier output";
license = licenses.bsd2;
homepage = "https://github.com/php-parallel-lint/PHP-Parallel-Lint";
maintainers = with maintainers; [ ] ++ teams.php.members;
license = lib.licenses.bsd2;
mainProgram = "parallel-lint";
maintainers = lib.teams.php.members;
};
}
})

View File

@ -1,35 +0,0 @@
{ mkDerivation, fetchurl, lib, php, makeWrapper }:
let
pname = "phpcbf";
version = "3.7.2";
in
mkDerivation {
inherit pname version;
src = fetchurl {
url = "https://github.com/squizlabs/PHP_CodeSniffer/releases/download/${version}/phpcbf.phar";
sha256 = "sha256-TspzKpl98IpMl+QyZuuBIvkW05uwAqAAYA/dU5P07+E=";
};
dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/phpcbf/phpcbf.phar
makeWrapper ${php}/bin/php $out/bin/phpcbf \
--add-flags "$out/libexec/phpcbf/phpcbf.phar"
runHook postInstall
'';
meta = with lib; {
changelog = "https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/${version}";
description = "PHP coding standard beautifier and fixer";
license = licenses.bsd3;
homepage = "https://squizlabs.github.io/PHP_CodeSniffer/";
maintainers = with maintainers; [ cmcdragonkai ] ++ teams.php.members;
};
}

View File

@ -1,35 +0,0 @@
{ mkDerivation, fetchurl, makeWrapper, lib, php }:
let
pname = "phpcs";
version = "3.7.2";
in
mkDerivation {
inherit pname version;
src = fetchurl {
url = "https://github.com/squizlabs/PHP_CodeSniffer/releases/download/${version}/phpcs.phar";
sha256 = "sha256-IEIUwepbqBT7CyYIwZzKLBC/X/zJ8OPUw0qtwBeVF7c=";
};
dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/phpcs/phpcs.phar
makeWrapper ${php}/bin/php $out/bin/phpcs \
--add-flags "$out/libexec/phpcs/phpcs.phar"
runHook postInstall
'';
meta = with lib; {
changelog = "https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/${version}";
description = "PHP coding standard tool";
license = licenses.bsd3;
homepage = "https://squizlabs.github.io/PHP_CodeSniffer/";
maintainers = with maintainers; [ javaguirre ] ++ teams.php.members;
};
}

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +1,30 @@
{ mkDerivation, fetchurl, makeWrapper, lib, php }:
{ lib
, fetchFromGitHub
, php
}:
let
php.buildComposerProject (finalAttrs: {
pname = "phpmd";
version = "2.15.0";
in
mkDerivation {
inherit pname version;
src = fetchurl {
url = "https://github.com/phpmd/phpmd/releases/download/${version}/phpmd.phar";
sha256 = "sha256-aijvVd4MdTsHDR0VgLsIoNFGAW+J8O3c72CsT8EINUQ=";
src = fetchFromGitHub {
owner = "phpmd";
repo = "phpmd";
rev = finalAttrs.version;
hash = "sha256-nTuJGzOZnkqrfE9R9Vujz/zGJRLlj8+yRZmmnxWrieQ=";
};
dontUnpack = true;
# Missing `composer.lock` from the repository.
# Issue open at https://github.com/phpmd/phpmd/issues/1056
composerLock = ./composer.lock;
vendorHash = "sha256-vr0wQkfhXHLEz8Q5nEq5Bocu1U1nDhXUlaHBsysvuRQ=";
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/phpmd/phpmd.phar
makeWrapper ${php}/bin/php $out/bin/phpmd \
--add-flags "$out/libexec/phpmd/phpmd.phar"
runHook postInstall
'';
meta = with lib; {
changelog = "https://github.com/phpmd/phpmd/releases/tag/${version}";
meta = {
changelog = "https://github.com/phpmd/phpmd/releases/tag/${finalAttrs.version}";
description = "PHP code quality analyzer";
license = licenses.bsd3;
homepage = "https://phpmd.org/";
maintainers = teams.php.members;
license = lib.licenses.bsd3;
mainProgram = "phpmd";
maintainers = lib.teams.php.members;
};
}
})

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,23 @@
{ lib, fetchgit, php }:
{ lib
, fetchFromGitHub
, php
}:
php.buildComposerProject (finalAttrs: {
pname = "psalm";
version = "5.15.0";
version = "5.22.2";
src = fetchgit {
url = "https://github.com/vimeo/psalm.git";
src = fetchFromGitHub {
owner = "vimeo";
repo = "psalm";
rev = finalAttrs.version;
hash = "sha256-rRExT82+IwgVo7pL3rrTjW/qj/MJf4m4L3PywaeSHYU=";
hash = "sha256-M8Ds3PQGphK8lQciWNdxWkMN35q8vdaNTWTrP1WXTeg=";
};
# TODO: Open a PR against https://github.com/vimeo/psalm
# Missing `composer.lock` from the repository.
# Issue open at https://github.com/vimeo/psalm/issues/10446
composerLock = ./composer.lock;
vendorHash = "sha256-Vho1ri/Qm2SYeXB9ZoXvH1vB/eSBwHnAT/pI4jjUYhU=";
vendorHash = "sha256-URPyV1V/8BP8fbJqyYLf+XKG786hY2BbAzUphzPyPCs=";
meta = {
changelog = "https://github.com/vimeo/psalm/releases/tag/${finalAttrs.version}";

View File

@ -1,31 +0,0 @@
{ lib, stdenv, fetchurl, fetchFromGitHub, php, which, makeWrapper, bash, coreutils, ncurses }:
stdenv.mkDerivation rec {
pname = "drush";
version = "8.4.12";
src = fetchurl {
url = "https://github.com/drush-ops/drush/releases/download/${version}/drush.phar";
sha256 = "sha256-YtD9lD621LJJAM/ieL4KWvY4o4Uqo3+FWgjGYGdQQaw=";
};
dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
mkdir -p $out/bin
install -D $src $out/libexec/drush/drush.phar
makeWrapper ${php}/bin/php $out/bin/drush \
--add-flags "$out/libexec/drush/drush.phar" \
--prefix PATH : "${lib.makeBinPath [ which php bash coreutils ncurses ]}"
'';
meta = with lib; {
description = "Command-line shell and Unix scripting interface for Drupal";
homepage = "https://github.com/drush-ops/drush";
license = licenses.gpl2;
maintainers = with maintainers; [ lovek323 ];
platforms = platforms.all;
};
}

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

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

View File

@ -234,6 +234,7 @@ mapAliases ({
dotnet-sdk_3 = dotnetCorePackages.sdk_3_1; # Added 2020-01-19
dotnet-sdk_5 = dotnetCorePackages.sdk_5_0; # Added 2020-09-11
drgeo = throw "'drgeo' has been removed as it is outdated and unmaintained"; # Added 2023-10-15
drush = throw "drush as a standalone package has been removed because it's no longer supported as a standalone tool";
dtv-scan-tables_linuxtv = dtv-scan-tables; # Added 2023-03-03
dtv-scan-tables_tvheadend = dtv-scan-tables; # Added 2023-03-03
du-dust = dust; # Added 2024-01-19

View File

@ -18944,8 +18944,6 @@ with pkgs;
drm_info = callPackage ../development/tools/drm_info { };
drush = callPackage ../development/tools/misc/drush { };
dura = callPackage ../development/tools/misc/dura {
inherit (darwin.apple_sdk.frameworks) Security;
};

View File

@ -198,14 +198,12 @@ lib.makeScope pkgs.newScope (self: with self; {
phive = callPackage ../development/php-packages/phive { };
php-codesniffer = callPackage ../development/php-packages/php-codesniffer { };
php-cs-fixer = callPackage ../development/php-packages/php-cs-fixer { };
php-parallel-lint = callPackage ../development/php-packages/php-parallel-lint { };
phpcbf = callPackage ../development/php-packages/phpcbf { };
phpcs = callPackage ../development/php-packages/phpcs { };
phpmd = callPackage ../development/php-packages/phpmd { };
phpspy = callPackage ../development/php-packages/phpspy { };
@ -215,10 +213,11 @@ lib.makeScope pkgs.newScope (self: with self; {
psalm = callPackage ../development/php-packages/psalm { };
psysh = callPackage ../development/php-packages/psysh { };
} // lib.optionalAttrs config.allowAliases {
phpcbf = throw "`phpcbf` is now deprecated, use `php-codesniffer` instead which contains both `phpcs` and `phpcbf`.";
phpcs = throw "`phpcs` is now deprecated, use `php-codesniffer` instead which contains both `phpcs` and `phpcbf`.";
};
# This is a set of PHP extensions meant to be used in php.buildEnv
# or php.withExtensions to extend the functionality of the PHP
# interpreter.
@ -235,7 +234,7 @@ lib.makeScope pkgs.newScope (self: with self; {
ast = callPackage ../development/php-packages/ast { };
blackfire = callPackage ../development/tools/misc/blackfire/php-probe.nix { inherit php; };
blackfire = callPackage ../development/tools/misc/blackfire/php-probe.nix { };
couchbase = callPackage ../development/php-packages/couchbase { };
@ -318,7 +317,7 @@ lib.makeScope pkgs.newScope (self: with self; {
redis = callPackage ../development/php-packages/redis { };
relay = callPackage ../development/php-packages/relay { inherit php; };
relay = callPackage ../development/php-packages/relay { };
rrd = callPackage ../development/php-packages/rrd { };