about summary refs log tree commit diff
path: root/pkgs/development/php-packages
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2022-11-13 21:19:25 +0100
committerJan Tojnar <jtojnar@gmail.com>2022-11-14 23:36:38 +0100
commit35c91b9630e73dc0960d951a9fd998fa04f4832b (patch)
tree5f6f51174000f6225a91468f95574bb70e31db45 /pkgs/development/php-packages
parentb8e83fd7e16529ee331313993508c3bf918f1d57 (diff)
php80.packages.php-parallel-lint: Fix build
One of the main use cases of this program is ensuring that a project
targeting older PHP version does not use syntax that is not available there.

Unfortunately, box is now only available for PHP ≥ 8.1.
And even if we bring it from PHP 8.1 package set, the produced PHAR
will contain syntax incompatible with older PHP versions.

To work around this we either need to disable requirements checks
or force use the default PHAR stub over the box’s one.
And it turns out that php-parallel-linter already does the former,
only we did not have access to the `box.json` file
because it was excluded from the `git archive`.

Let’s fetch the source using Git so that box configuration is available.

Reverts https://github.com/NixOS/nixpkgs/commit/2db0ddb968357051237915256b7a1fc841492762
Diffstat (limited to 'pkgs/development/php-packages')
-rw-r--r--pkgs/development/php-packages/php-parallel-lint/default.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/pkgs/development/php-packages/php-parallel-lint/default.nix b/pkgs/development/php-packages/php-parallel-lint/default.nix
index 1d7c23337c652..406e58b7958c6 100644
--- a/pkgs/development/php-packages/php-parallel-lint/default.nix
+++ b/pkgs/development/php-packages/php-parallel-lint/default.nix
@@ -1,4 +1,4 @@
-{ mkDerivation, fetchFromGitHub, makeWrapper, lib, php }:
+{ mkDerivation, fetchFromGitHub, makeWrapper, lib, php, php81 }:
 let
   pname = "php-parallel-lint";
   version = "1.3.2";
@@ -10,13 +10,17 @@ mkDerivation {
     owner = "php-parallel-lint";
     repo = "PHP-Parallel-Lint";
     rev = "v${version}";
-    sha256 = "sha256-pTHH19HwqyOj5pSmH7l0JlntNVtMdu4K9Cl+qyrrg9U=";
+    # `.gitattibutes` exclude `box.json` from the archive produced git.
+    forceFetchGit = true;
+    sha256 = "SPP1ynxJad2m5wknGt8z94fW7Ucx8nqLvwZVmlylOgM=";
   };
 
   nativeBuildInputs = [
     makeWrapper
     php.packages.composer
-    php.packages.box
+    # 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
   ];
 
   buildPhase = ''
@@ -36,7 +40,6 @@ mkDerivation {
   '';
 
   meta = with lib; {
-    broken = lib.versionOlder php.version "8.1"; # Broken on PHP older than 8.1.
     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";