depot/third_party/nixpkgs/pkgs/development/php-packages/castor/default.nix
Default email 5e7c2d6cef Project import generated by Copybara.
GitOrigin-RevId: f99e5f03cc0aa231ab5950a15ed02afec45ed51a
2023-10-09 21:29:22 +02:00

50 lines
1.4 KiB
Nix

{ lib
, fetchFromGitHub
, installShellFiles
, php
, nix-update-script
, testers
}:
php.buildComposerProject (finalAttrs: {
pname = "castor";
version = "0.8.0";
src = fetchFromGitHub {
owner = "jolicode";
repo = "castor";
rev = "v${finalAttrs.version}";
hash = "sha256-rJz4BY74BI8gyT4ZlABc4PA+SCsd8guM0m2MTej350g=";
};
vendorHash = "sha256-Jh4mNNYEM9sy0Dp+dZtD+xrMICjAuspe9D9BDXcfUPM=";
nativeBuildInputs = [ installShellFiles ];
# install shell completions
postInstall = ''
echo "yes" | ${php}/bin/php $out/share/php/castor/bin/castor
installShellCompletion --cmd castor \
--bash <(${php}/bin/php $out/share/php/castor/bin/castor completion bash) \
--fish <(${php}/bin/php $out/share/php/castor/bin/castor completion fish) \
--zsh <(${php}/bin/php $out/share/php/castor/bin/castor completion zsh)
'';
passthru = {
updateScript = nix-update-script { };
tests.version = testers.testVersion {
command = "castor --version";
package = php.packages.castor;
version = "v${finalAttrs.version}";
};
};
meta = {
changelog = "https://github.com/jolicode/castor/blob/v${finalAttrs.version}/CHANGELOG.md";
description = "DX oriented task runner and command launcher built with PHP";
homepage = "https://github.com/jolicode/castor";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ gaelreyrol ];
mainProgram = "castor";
};
})