-
-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathdefault.nix
More file actions
94 lines (83 loc) · 2.39 KB
/
Copy pathdefault.nix
File metadata and controls
94 lines (83 loc) · 2.39 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{
lib,
stdenv,
fetchgit,
makeWrapper,
perl540,
pve-container,
pve-firewall,
pve-guest-common,
pve-qemu-server,
pve-storage,
pve-qemu,
enableLinstor ? false,
pve-update-script,
}:
let
pve-storage_ = pve-storage.override { inherit enableLinstor; };
perlDeps = [
pve-container
pve-firewall
pve-guest-common
(pve-qemu-server.override { pve-storage = pve-storage_; })
pve-storage_
];
perlEnv = perl540.withPackages (_: perlDeps);
perlLibPath = lib.makeSearchPath "${perl540.libPrefix}/${perl540.version}" perlDeps;
in
perl540.pkgs.toPerlModule (
stdenv.mkDerivation rec {
pname = "pve-ha-manager";
version = "5.1.1";
src = fetchgit {
url = "git://git.proxmox.com/git/${pname}.git";
rev = "1a8d8bcef1934a43d37344caf965c082e55d451c";
hash = "sha256-3QcgqBrHgAb7+iZHZ2hltH/hDABQTH8lCxp/fsYKbH0=";
};
sourceRoot = "${src.name}/src";
postPatch = ''
sed -i Makefile \
-e "s/ha-manager.1 pve-ha-crm.8 pve-ha-lrm.8 ha-manager.bash-completion pve-ha-lrm.bash-completion //" \
-e "s/pve-ha-crm.bash-completion ha-manager.zsh-completion pve-ha-lrm.zsh-completion pve-ha-crm.zsh-completion //" \
-e "/install -m 0644 -D pve-ha-crm.bash-completion/,+5d" \
-e "/install -m 0644 pve-ha-crm.8/,+6d" \
-e "s/Werror/Wno-error/" \
-e "/PVE_GENERATING_DOCS/d" \
-e "/shell /d"
'';
makeFlags = [
"DESTDIR=$(out)"
"PREFIX="
"SBINDIR=/bin"
"PERLDIR=/${perl540.libPrefix}/${perl540.version}"
];
buildInputs = [
perlEnv
makeWrapper
];
propagatedBuildInputs = perlDeps;
postInstall = ''
cp ${pve-container}/.bin/pct $out/bin
cp ${pve-qemu-server}/.bin/* $out/bin
rm $out/bin/pve-ha-simulator
'';
postFixup = ''
for bin in $out/bin/*; do
wrapProgram $bin \
--prefix PATH : ${lib.makeBinPath [ pve-qemu ]} \
--prefix PERL5LIB : $out/${perl540.libPrefix}/${perl540.version}:${perlLibPath}
done
'';
passthru.updateScript = pve-update-script { };
meta = with lib; {
description = "Proxmox VE High Availabillity Manager";
homepage = "https://git.proxmox.com/?p=pve-ha-manager.git";
license = with licenses; [ ];
maintainers = with maintainers; [
camillemndn
julienmalka
];
platforms = platforms.linux;
};
}
)