blob: 9ef68c5d5cd0e3f1d4a953f39d0c1ba2e16ca6e0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
{ lib, stdenvNoCC, fetchFromGitHub, php, phpPackages }:
let
version = "2023.06.17";
src = fetchFromGitHub {
owner = "phpactor";
repo = "phpactor";
rev = 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
'';
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 ];
};
}
|