mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-10 08:39:08 +03:00
phpPackages.castor: init at 0.8.0
This commit is contained in:
parent
88133d171e
commit
dcca536d14
60
pkgs/development/php-packages/castor/default.nix
Normal file
60
pkgs/development/php-packages/castor/default.nix
Normal file
@ -0,0 +1,60 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, makeBinaryWrapper
|
||||
, installShellFiles
|
||||
, php
|
||||
, nix-update-script
|
||||
, testers
|
||||
, castor
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "castor";
|
||||
version = "0.8.0";
|
||||
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/jolicode/castor/releases/download/v${finalAttrs.version}/castor.linux-amd64.phar";
|
||||
hash = "sha256-0lnn4mS1/DgUoRoMFvCjwQ0j9CX9XWlskbtX9roFCfc=";
|
||||
};
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
nativeBuildInputs = [ makeBinaryWrapper installShellFiles ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
install -D $src $out/libexec/castor/castor.phar
|
||||
makeWrapper ${php}/bin/php $out/bin/castor \
|
||||
--add-flags "$out/libexec/castor/castor.phar"
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
# castor requires to be initialized to generate completion files
|
||||
postInstall = ''
|
||||
echo "yes" | ${php}/bin/php $src
|
||||
installShellCompletion --cmd castor \
|
||||
--bash <($out/bin/castor completion bash) \
|
||||
--fish <($out/bin/castor completion fish) \
|
||||
--zsh <($out/bin/castor completion zsh)
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
updateScript = nix-update-script { };
|
||||
tests.version = testers.testVersion {
|
||||
inherit (finalAttrs) version;
|
||||
package = castor;
|
||||
command = "castor --version";
|
||||
};
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "DX oriented task runner and command launcher built with PHP";
|
||||
homepage = "https://github.com/jolicode/castor";
|
||||
changelog = "https://github.com/jolicode/castor/blob/v${finalAttrs.version}/CHANGELOG.md";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ gaelreyrol ];
|
||||
};
|
||||
})
|
@ -169,6 +169,8 @@ lib.makeScope pkgs.newScope (self: with self; {
|
||||
tools = {
|
||||
box = callPackage ../development/php-packages/box { };
|
||||
|
||||
castor = callPackage ../development/php-packages/castor { };
|
||||
|
||||
composer = callPackage ../development/php-packages/composer { };
|
||||
|
||||
deployer = callPackage ../development/php-packages/deployer { };
|
||||
|
Loading…
Reference in New Issue
Block a user