-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.nix
80 lines (73 loc) · 2.16 KB
/
server.nix
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
# error: builder for '/nix/store/06d3ygcysfc73v5l5zz03ilx8phmy6ar-zabbix-server-7.0.drv' failed with exit code 2;
# last 10 log lines:
# > make[3]: Entering directory '/build/70/src/libs/zbxdbschema'
# > ../../../create/bin/gen_schema.pl c > dbschema.c
# > /nix/store/vpvy79k1qq02p1vyqjk6nb89gwhxqvyb-bash-5.2p32/bin/bash: line 1: ../../../create/bin/gen_schema.pl: cannot execute: required file not found
# > make[3]: *** [Makefile:679: dbschema.c] Error 127
# > make[3]: Leaving directory '/build/70/src/libs/zbxdbschema'
# > make[2]: *** [Makefile:638: all-recursive] Error 1
# > make[2]: Leaving directory '/build/70/src/libs'
# > make[1]: *** [Makefile:503: all-recursive] Error 1
# > make[1]: Leaving directory '/build/70/src'
# > make: *** [Makefile:555: all-recursive] Error 1
# For full logs, run 'nix log /nix/store/06d3ygcysfc73v5l5zz03ilx8phmy6ar-zabbix-server-7.0.drv'.
let
nixpkgs = "github:nixos/nixpkgs?ref=nixos-unstable";
system = "x86_64-linux";
pkgs = import <nixpkgs> { inherit system; };
in
pkgs.stdenv.mkDerivation {
pname = "zabbix-server";
version = "7.0";
src = ./.;
nativeBuildInputs = with pkgs; [
autoreconfHook
pkg-config
];
buildInputs = with pkgs; [
curl
libevent
libiconv
libxml2
openssl
pcre
zlib
# unixODBC
# iksemel
# openldap
# net-snmp
# libssh2
# libmysqlclient
postgresql
# openipmi
];
configureFlags = [
"--enable-ipv6"
"--enable-server"
"--with-iconv"
"--with-libcurl"
"--with-libevent"
"--with-libpcre"
"--with-libxml2"
"--with-openssl=${pkgs.openssl.dev}"
"--with-zlib=${pkgs.zlib}"
# Optional
# "--with-unixodbc"
# "--with-jabber"
# "--with-ldap=${pkgs.openldap.dev}"
# "--with-net-snmp"
# "--with-ssh2=${pkgs.libssh2.dev}"
# "--with-mysql"
"--with-postgresql"
# "--with-openipmi=${pkgs.openipmi.dev}"
];
prePatch = ''
find database -name data.sql -exec sed -i 's|/usr/bin/||g' {} +
'';
preAutoreconf = ''
for i in $(find . -type f -name "*.m4"); do
substituteInPlace $i \
--replace 'test -x "$PKG_CONFIG"' 'type -P "$PKG_CONFIG" >/dev/null'
done
'';
}