nixpkgs/pkgs/by-name/ph/phpactor/package.nix
Matthias Devlamynck fb2e1920b2 phpactor: fix build
This fixes the generation of bash completion by patching the shebang of
the phpactor script before the generation is excuted.
2024-07-10 11:58:02 +02:00

40 lines
930 B
Nix

{ lib
, fetchFromGitHub
, installShellFiles
, php
}:
php.buildComposerProject (finalAttrs: {
pname = "phpactor";
version = "2024.06.30.0";
src = fetchFromGitHub {
owner = "phpactor";
repo = "phpactor";
rev = finalAttrs.version;
hash = "sha256-QcKkkgpWWypapQPawK1hu+6tkF9c5ICPeEPWqCwrUBM=";
};
vendorHash = "sha256-onUhRO6d2osf7n5QlYY86eamlCCslQMVltAv1shskgI=";
nativeBuildInputs = [ installShellFiles ];
postPatch = ''
patchShebangs bin/phpactor
'';
postInstall = ''
installShellCompletion --cmd phpactor \
--bash <($out/bin/phpactor completion bash)
'';
meta = {
changelog = "https://github.com/phpactor/phpactor/releases/tag/${finalAttrs.version}";
description = "Mainly a PHP Language Server";
homepage = "https://github.com/phpactor/phpactor";
license = lib.licenses.mit;
mainProgram = "phpactor";
maintainers = lib.teams.php.members;
};
})