Skip to content

Commit f1b5c37

Browse files
committed
zabbix.proxy-{pgsql,mysql}: Fix cross
1 parent 5c8bd5c commit f1b5c37

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

pkgs/servers/monitoring/zabbix/proxy.nix

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
openssl,
99
pcre,
1010
zlib,
11+
buildPackages,
1112
odbcSupport ? true,
1213
unixODBC,
1314
snmpSupport ? stdenv.buildPlatform == stdenv.hostPlatform,
@@ -29,6 +30,23 @@ assert sqliteSupport -> !mysqlSupport && !postgresqlSupport;
2930

3031
let
3132
inherit (lib) optional optionalString;
33+
34+
fake_pg_config = buildPackages.writeShellScript "pg_config" ''
35+
if [[ "$1" == "--version" ]]; then
36+
$PKG_CONFIG libpq --modversion
37+
else
38+
$PKG_CONFIG libpq --variable="''${1//--/}"
39+
fi
40+
'';
41+
42+
fake_mysql_config = buildPackages.writeShellScript "mysql_config" ''
43+
if [[ "$1" == "--version" ]]; then
44+
$PKG_CONFIG mysqlclient --modversion
45+
else
46+
$PKG_CONFIG mysqlclient $@
47+
fi
48+
'';
49+
3250
in
3351
import ./versions.nix (
3452
{ version, hash, ... }:
@@ -71,8 +89,8 @@ import ./versions.nix (
7189
++ optional snmpSupport "--with-net-snmp"
7290
++ optional sqliteSupport "--with-sqlite3=${sqlite.dev}"
7391
++ optional sshSupport "--with-ssh2=${libssh2.dev}"
74-
++ optional mysqlSupport "--with-mysql"
75-
++ optional postgresqlSupport "--with-postgresql";
92+
++ optional mysqlSupport "--with-mysql=${fake_mysql_config}"
93+
++ optional postgresqlSupport "--with-postgresql=${fake_pg_config}";
7694

7795
prePatch = ''
7896
find database -name data.sql -exec sed -i 's|/usr/bin/||g' {} +

0 commit comments

Comments
 (0)