From 5c336fc5494b41de2866b010f6d444a1240e6139 Mon Sep 17 00:00:00 2001 From: Roger Qiu Date: Tue, 11 Jul 2017 23:56:52 +1000 Subject: [PATCH] phpPackages.phpcbf: init at 2.6.0 --- pkgs/top-level/php-packages.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix index 221427e08514..c5e3ac0ac554 100644 --- a/pkgs/top-level/php-packages.nix +++ b/pkgs/top-level/php-packages.nix @@ -286,4 +286,31 @@ let maintainers = with maintainers; [ javaguirre ]; }; }; + + phpcbf = pkgs.stdenv.mkDerivation rec { + name = "phpcbf-${version}"; + version = "2.6.0"; + + src = pkgs.fetchurl { + url = "https://github.com/squizlabs/PHP_CodeSniffer/releases/download/${version}/phpcbf.phar"; + sha256 = "1ijf52cgd85ypvw431nnmzij6156ryhfvmajpkr7plfw0iccqc5j"; + }; + + phases = [ "installPhase" ]; + nativeBuildInputs = [ pkgs.makeWrapper ]; + + installPhase = '' + 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" + ''; + + meta = with pkgs.lib; { + description = "PHP coding standard beautifier and fixer"; + license = licenses.bsd3; + homepage = https://squizlabs.github.io/PHP_CodeSniffer/; + maintainers = with maintainers; [ cmcdragonkai ]; + }; + }; }; in self