nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ mkDerivation, fetchFromGitHub, makeWrapper, lib, php }:
2let
3 pname = "php-parallel-lint";
4 version = "1.3.2";
5in
6mkDerivation {
7 inherit pname version;
8
9 src = fetchFromGitHub {
10 owner = "php-parallel-lint";
11 repo = "PHP-Parallel-Lint";
12 rev = "v${version}";
13 sha256 = "sha256-pTHH19HwqyOj5pSmH7l0JlntNVtMdu4K9Cl+qyrrg9U=";
14 };
15
16 nativeBuildInputs = [
17 makeWrapper
18 php.packages.composer
19 php.packages.box
20 ];
21
22 buildPhase = ''
23 runHook preBuild
24 composer dump-autoload
25 box build
26 runHook postBuild
27 '';
28
29 installPhase = ''
30 runHook preInstall
31 mkdir -p $out/bin
32 install -D parallel-lint.phar $out/libexec/php-parallel-lint/php-parallel-lint.phar
33 makeWrapper ${php}/bin/php $out/bin/php-parallel-lint \
34 --add-flags "$out/libexec/php-parallel-lint/php-parallel-lint.phar"
35 runHook postInstall
36 '';
37
38 meta = with lib; {
39 description = "Tool to check syntax of PHP files faster than serial check with fancier output";
40 license = licenses.bsd2;
41 homepage = "https://github.com/php-parallel-lint/PHP-Parallel-Lint";
42 maintainers = with maintainers; [ ] ++ teams.php.members;
43 };
44}