From 5628aeb5b08e2857df4ceb506b682836a0269d39 Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Wed, 25 Oct 2023 23:33:00 -0700 Subject: [PATCH] kea: allow kea to cross-compile While not a final solution for cross-compiling kea with database backends enabled, this does allow a non-overridden kea derivation to cross-compile successfully. Output from `pkgsCross.aarch64-multiplatform.kea`: ```console $ qemu-aarch64 ./result/bin/kea-dhcp4 -V 2.4.0 tarball linked with: log4cplus 2.1.0 OpenSSL 3.0.11 19 Sep 2023 database: Memfile backend 3.0 ``` --- pkgs/tools/networking/kea/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/networking/kea/default.nix b/pkgs/tools/networking/kea/default.nix index 7c3cab0fe5a7..2e642b17f87c 100644 --- a/pkgs/tools/networking/kea/default.nix +++ b/pkgs/tools/networking/kea/default.nix @@ -5,8 +5,11 @@ # build time , autoreconfHook , pkg-config +, python3Packages # runtime +, withMysql ? stdenv.buildPlatform.system == stdenv.hostPlatform.system +, withPostgres ? stdenv.buildPlatform.system == stdenv.hostPlatform.system , boost , libmysqlclient , log4cplus @@ -48,9 +51,10 @@ stdenv.mkDerivation rec { "--enable-shell" "--localstatedir=/var" "--with-openssl=${lib.getDev openssl}" - "--with-mysql=${lib.getDev libmysqlclient}/bin/mysql_config" - "--with-pgsql=${postgresql}/bin/pg_config" - ]; + ] + ++ lib.optional withPostgres "--with-pgsql=${postgresql}/bin/pg_config" + ++ lib.optional withMysql "--with-mysql=${lib.getDev libmysqlclient}/bin/mysql_config"; + postConfigure = '' # Mangle embedded paths to dev-only inputs. sed -e "s|$NIX_STORE/[a-z0-9]\{32\}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" -i config.report @@ -59,7 +63,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook pkg-config - ] ++ (with python3.pkgs; [ + ] ++ (with python3Packages; [ sphinxHook sphinx-rtd-theme ]);