zabbix.proxy-{pgsql,mysql}: Fix cross
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
openssl,
|
||||
pcre,
|
||||
zlib,
|
||||
buildPackages,
|
||||
odbcSupport ? true,
|
||||
unixODBC,
|
||||
snmpSupport ? stdenv.buildPlatform == stdenv.hostPlatform,
|
||||
@@ -29,6 +30,23 @@ assert sqliteSupport -> !mysqlSupport && !postgresqlSupport;
|
||||
|
||||
let
|
||||
inherit (lib) optional optionalString;
|
||||
|
||||
fake_pg_config = buildPackages.writeShellScript "pg_config" ''
|
||||
if [[ "$1" == "--version" ]]; then
|
||||
$PKG_CONFIG libpq --modversion
|
||||
else
|
||||
$PKG_CONFIG libpq --variable="''${1//--/}"
|
||||
fi
|
||||
'';
|
||||
|
||||
fake_mysql_config = buildPackages.writeShellScript "mysql_config" ''
|
||||
if [[ "$1" == "--version" ]]; then
|
||||
$PKG_CONFIG mysqlclient --modversion
|
||||
else
|
||||
$PKG_CONFIG mysqlclient $@
|
||||
fi
|
||||
'';
|
||||
|
||||
in
|
||||
import ./versions.nix (
|
||||
{ version, hash, ... }:
|
||||
@@ -71,8 +89,8 @@ import ./versions.nix (
|
||||
++ optional snmpSupport "--with-net-snmp"
|
||||
++ optional sqliteSupport "--with-sqlite3=${sqlite.dev}"
|
||||
++ optional sshSupport "--with-ssh2=${libssh2.dev}"
|
||||
++ optional mysqlSupport "--with-mysql"
|
||||
++ optional postgresqlSupport "--with-postgresql";
|
||||
++ optional mysqlSupport "--with-mysql=${fake_mysql_config}"
|
||||
++ optional postgresqlSupport "--with-postgresql=${fake_pg_config}";
|
||||
|
||||
prePatch = ''
|
||||
find database -name data.sql -exec sed -i 's|/usr/bin/||g' {} +
|
||||
|
||||
Reference in New Issue
Block a user