Cross fixes (#374611)

This commit is contained in:
Artturin
2025-02-04 16:31:51 +02:00
committed by GitHub
2 changed files with 22 additions and 3 deletions
+2 -1
View File
@@ -53,7 +53,8 @@ stdenv.mkDerivation (finalAttrs: {
patchPhase = ''
substituteInPlace ./Makefile \
--replace 'chmod 4555' '#chmod 4555'
--replace 'chmod 4555' '#chmod 4555' \
--replace 'pkg-config' "$PKG_CONFIG"
'';
makeFlags = [
+20 -2
View File
@@ -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' {} +