Merge pull request #255122 from NixOS/phpactor/update

phpactor: 2023.06.17 -> 2023.08.06-1
This commit is contained in:
Elis Hirwing 2023-09-14 21:18:58 +02:00 committed by GitHub
commit 2cd86bf59a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,78 +1,23 @@
{ lib, stdenvNoCC, fetchFromGitHub, php, phpPackages }:
{ lib, fetchFromGitHub, php }:
let
version = "2023.06.17";
php.buildComposerProject (finalAttrs: {
pname = "phpactor";
version = "2023.08.06-1";
src = fetchFromGitHub {
owner = "phpactor";
repo = "phpactor";
rev = version;
rev = finalAttrs.version;
hash = "sha256-NI+CLXlflQ8zQ+0AbjhJFdV6Y2+JGy7XDj0RBJ4YRRg=";
};
vendor = stdenvNoCC.mkDerivation {
pname = "phpactor-vendor";
inherit src version;
# See https://github.com/NixOS/nix/issues/6660
dontPatchShebangs = true;
nativeBuildInputs = [
php
phpPackages.composer
];
buildPhase = ''
runHook preBuild
substituteInPlace composer.json \
--replace '"config": {' '"config": { "autoloader-suffix": "Phpactor",' \
--replace '"name": "phpactor/phpactor",' '"name": "phpactor/phpactor", "version": "${version}",'
composer install --no-interaction --optimize-autoloader --no-dev --no-scripts
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -ar ./vendor $out/
runHook postInstall
'';
outputHashMode = "recursive";
outputHashAlgo = "sha256";
outputHash = "sha256-fjcfdNzQsVgRpksxybSIpdHz1BOLTlY49Cjeaw0Evl8=";
};
in
stdenvNoCC.mkDerivation {
pname = "phpactor";
inherit src version;
buildInputs = [
php
];
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/share/php/phpactor $out/bin
cp -r . $out/share/php/phpactor
cp -r ${vendor}/vendor $out/share/php/phpactor
ln -s $out/share/php/phpactor/bin/phpactor $out/bin/phpactor
runHook postInstall
'';
vendorHash = "sha256-XGVZw6t8CHcv39YHkn/mW6fdl65kFakADLOEWbXfh/g=";
meta = {
description = "Mainly a PHP Language Server";
homepage = "https://github.com/phpactor/phpactor";
license = lib.licenses.mit;
maintainers = lib.teams.php.members ++ [ lib.maintainers.ryantm ];
mainProgram = "phpactor";
maintainers = [ lib.maintainers.ryantm ] ++ lib.teams.php.members;
};
}
})