-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdefault.nix
More file actions
72 lines (57 loc) · 1.48 KB
/
default.nix
File metadata and controls
72 lines (57 loc) · 1.48 KB
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
{
system ? builtins.currentSystem,
python3,
openjdk11_headless,
makeWrapper,
lib,
src,
stdenv,
}:
let
pythonWithPackages = python3.withPackages (ps: with ps; [
pyhocon
]);
in {
a8-scripts = stdenv.mkDerivation {
name = "a8-scripts";
inherit src;
buildInputs = [ pythonWithPackages openjdk11_headless makeWrapper ];
buildPhase = ''
mkdir -p $out/bin
for script in $src/bin/*; do
cp --no-dereference $script $out/bin/$(basename $script)
done
function fixExec() {
local script=$1
local scriptFile=$out/bin/$script
local launcher=$out/bin/a8-launcher.py
rm $scriptFile
#echo creating launcher $scriptFile -- $out
echo '#!/bin/sh' > $scriptFile
echo $launcher --l-launcherJson $scriptFile.json '$@' >> $scriptFile
chmod +x $scriptFile
}
fixExec a8-versions
fixExec a8-codegen
fixExec a8-zero
fixExec a8-zoo
fixExec honeybadger
patchShebangs $out/bin
mkdir -p $out/pydevops
cp $src/pydevops/* $out/pydevops/
echo patching shebangs
patchShebangs $out/pydevops
'';
installPhase = "echo hello > /dev/null";
postFixup = ''
wrapProgram $out/bin/a8-launcher.py \
--set PATH ${lib.makeBinPath [
openjdk11_headless
]}
wrapProgram $out/bin/coursier \
--set PATH ${lib.makeBinPath [
openjdk11_headless
]}
'';
};
}