From 2ebe19f3302ee21871cfab11cdadd13f38b51261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 10 Dec 2018 20:05:12 +0000 Subject: [PATCH] openldap: fix cross-build --- .../libraries/openldap/default.nix | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/pkgs/development/libraries/openldap/default.nix b/pkgs/development/libraries/openldap/default.nix index 16e00e9f2b95..0a5f83d1c7c6 100644 --- a/pkgs/development/libraries/openldap/default.nix +++ b/pkgs/development/libraries/openldap/default.nix @@ -13,18 +13,27 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - buildInputs = [ openssl cyrus_sasl db groff libtool ]; + nativeBuildInputs = [ groff ]; - configureFlags = - [ "--enable-overlays" - "--disable-dependency-tracking" # speeds up one-time build - "--enable-modules" - "--sysconfdir=/etc" - "--localstatedir=/var" - "--enable-crypt" - ] ++ stdenv.lib.optional (openssl == null) "--without-tls" - ++ stdenv.lib.optional (cyrus_sasl == null) "--without-cyrus-sasl" - ++ stdenv.lib.optional stdenv.isFreeBSD "--with-pic"; + buildInputs = [ openssl cyrus_sasl db libtool ]; + + # Disable install stripping as it breaks cross-compiling. + # We strip binaries anyway in fixupPhase. + makeFlags= [ "STRIP=" ]; + + configureFlags = [ + "--enable-overlays" + "--disable-dependency-tracking" # speeds up one-time build + "--enable-modules" + "--sysconfdir=/etc" + "--localstatedir=/var" + "--enable-crypt" + ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "--with-yielding_select=yes" + "ac_cv_func_memcmp_working=yes" + ] ++ stdenv.lib.optional (openssl == null) "--without-tls" + ++ stdenv.lib.optional (cyrus_sasl == null) "--without-cyrus-sasl" + ++ stdenv.lib.optional stdenv.isFreeBSD "--with-pic"; doCheck = false; # needs a running LDAP server