diff --git a/pkgs/development/libraries/libxml2/default.nix b/pkgs/development/libraries/libxml2/default.nix index b28f241d56ee..aa78d0d33c08 100644 --- a/pkgs/development/libraries/libxml2/default.nix +++ b/pkgs/development/libraries/libxml2/default.nix @@ -1,9 +1,10 @@ { stdenv, lib, fetchurl -, zlib, xz, python2, findXMLCatalogs, libiconv +, zlib, xz, python2, findXMLCatalogs , buildPlatform, hostPlatform , pythonSupport ? buildPlatform == hostPlatform , icuSupport ? false, icu ? null -, enableStatic ? false +, enableShared ? hostPlatform.libc != "msvcrt" +, enableStatic ? !enableShared, }: let @@ -35,22 +36,14 @@ in stdenv.mkDerivation rec { lib.optional pythonSupport "--with-python=${python}" ++ lib.optional icuSupport "--with-icu" ++ [ "--exec_prefix=$dev" ] - ++ lib.optional enableStatic "--enable-static"; + ++ lib.optional enableStatic "--enable-static" + ++ lib.optional (!enableShared) "--disable-shared"; enableParallelBuilding = true; doCheck = (stdenv.hostPlatform == stdenv.buildPlatform) && !stdenv.isDarwin && hostPlatform.libc != "musl"; - crossAttrs = lib.optionalAttrs (hostPlatform.libc == "msvcrt") { - # creating the DLL is broken ATM - dontDisableStatic = true; - configureFlags = configureFlags ++ [ "--disable-shared" ]; - - # libiconv is a header dependency - propagating is enough - propagatedBuildInputs = [ findXMLCatalogs libiconv ]; - }; - preInstall = lib.optionalString pythonSupport ''substituteInPlace python/libxml2mod.la --replace "${python}" "$py"''; installFlags = lib.optionalString pythonSupport diff --git a/pkgs/development/libraries/newt/default.nix b/pkgs/development/libraries/newt/default.nix index cd1e51bd19c1..a10f52462a8e 100644 --- a/pkgs/development/libraries/newt/default.nix +++ b/pkgs/development/libraries/newt/default.nix @@ -22,9 +22,10 @@ stdenv.mkDerivation rec { unset CPP ''; - crossAttrs = { - makeFlags = "CROSS_COMPILE=${stdenv.cc.targetPrefix}"; - }; + # Use `lib.optionalString` next mass rebuild. + makeFlags = if stdenv.buildPlatform == stdenv.hostPlatform + then null + else "CROSS_COMPILE=${stdenv.cc.targetPrefix}"; meta = with stdenv.lib; { homepage = https://fedorahosted.org/newt/; diff --git a/pkgs/os-specific/linux/kmod/default.nix b/pkgs/os-specific/linux/kmod/default.nix index f9be82255704..142c176a15fa 100644 --- a/pkgs/os-specific/linux/kmod/default.nix +++ b/pkgs/os-specific/linux/kmod/default.nix @@ -15,8 +15,6 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook pkgconfig libxslt ]; buildInputs = [ xz ]; - # HACK until BUG issue #21191 is addressed - crossAttrs.preUnpack = ''PATH="${buildPackages.xz}/bin''${PATH:+:}$PATH"''; configureFlags = [ "--sysconfdir=/etc" diff --git a/pkgs/tools/archivers/sharutils/default.nix b/pkgs/tools/archivers/sharutils/default.nix index 022814689428..907ac58d15fe 100644 --- a/pkgs/tools/archivers/sharutils/default.nix +++ b/pkgs/tools/archivers/sharutils/default.nix @@ -34,10 +34,6 @@ stdenv.mkDerivation rec { doCheck = true; - crossAttrs = { - patches = [ ./sharutils-4.11.1-cross-binary-mode-popen.patch ]; - }; - meta = with stdenv.lib; { description = "Tools for remote synchronization and `shell archives'"; longDescription = diff --git a/pkgs/tools/archivers/sharutils/sharutils-4.11.1-cross-binary-mode-popen.patch b/pkgs/tools/archivers/sharutils/sharutils-4.11.1-cross-binary-mode-popen.patch deleted file mode 100644 index f05eab251d4c..000000000000 --- a/pkgs/tools/archivers/sharutils/sharutils-4.11.1-cross-binary-mode-popen.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff -Naur sharutils-4.11.1.orig/configure sharutils-4.11.1/configure ---- sharutils-4.11.1.orig/configure 2011-06-20 11:07:40.000000000 -0400 -+++ sharutils-4.11.1/configure 2011-06-20 11:09:30.000000000 -0400 -@@ -26962,33 +26962,33 @@ - CATALOGS="$new_CATALOGS" - fi - --if test "$cross_compiling" = yes; then : -- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 --$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} --as_fn_error $? "cannot run test program while cross compiling --See \`config.log' for more details" "$LINENO" 5; } --else -- cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --int --main () --{ -- FILE * fp = popen ("date", "rb"); -- exit (fp == NULL); -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_run "$LINENO"; then : -- -+#if test "$cross_compiling" = yes; then : -+# { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+#$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -+#as_fn_error $? "cannot run test program while cross compiling -+#See \`config.log' for more details" "$LINENO" 5; } -+#else -+# cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+#/* end confdefs.h. */ -+# -+#int -+#main () -+#{ -+# FILE * fp = popen ("date", "rb"); -+# exit (fp == NULL); -+# ; -+# return 0; -+#} -+#_ACEOF -+#if ac_fn_c_try_run "$LINENO"; then : -+# - $as_echo "#define BINARY_MODE_POPEN 1" >>confdefs.h -- -- --fi --rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -- conftest.$ac_objext conftest.beam conftest.$ac_ext --fi -+# -+# -+#fi -+#rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+# conftest.$ac_objext conftest.beam conftest.$ac_ext -+#fi - - - diff --git a/pkgs/tools/networking/curl/7_59.nix b/pkgs/tools/networking/curl/7_59.nix index 5980392267b0..71a87a8e9d15 100644 --- a/pkgs/tools/networking/curl/7_59.nix +++ b/pkgs/tools/networking/curl/7_59.nix @@ -74,7 +74,10 @@ stdenv.mkDerivation rec { ( if brotliSupport then "--with-brotli" else "--without-brotli" ) ] ++ stdenv.lib.optional c-aresSupport "--enable-ares=${c-ares}" - ++ stdenv.lib.optional gssSupport "--with-gssapi=${kerberos.dev}"; + ++ stdenv.lib.optional gssSupport "--with-gssapi=${kerberos.dev}" + # For the 'urandom', maybe it should be a cross-system option + ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) + "--with-random=/dev/urandom"; CXX = "${stdenv.cc.targetPrefix}c++"; CXXCPP = "${stdenv.cc.targetPrefix}c++ -E"; @@ -90,16 +93,6 @@ stdenv.mkDerivation rec { ln $out/lib/libcurl.so $out/lib/libcurl-gnutls.so.4.4.0 ''; - crossAttrs = { - # We should refer to the cross built openssl - # For the 'urandom', maybe it should be a cross-system option - configureFlags = [ - ( if sslSupport then "--with-ssl=${openssl.crossDrv}" else "--without-ssl" ) - ( if gnutlsSupport then "--with-gnutls=${gnutls.crossDrv}" else "--without-gnutls" ) - "--with-random /dev/urandom" - ]; - }; - passthru = { inherit sslSupport openssl; }; diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix index 06798bdcc281..d15e6084a8b9 100644 --- a/pkgs/tools/networking/curl/default.nix +++ b/pkgs/tools/networking/curl/default.nix @@ -78,7 +78,10 @@ stdenv.mkDerivation rec { ( if brotliSupport then "--with-brotli" else "--without-brotli" ) ] ++ stdenv.lib.optional c-aresSupport "--enable-ares=${c-ares}" - ++ stdenv.lib.optional gssSupport "--with-gssapi=${kerberos.dev}"; + ++ stdenv.lib.optional gssSupport "--with-gssapi=${kerberos.dev}" + # For the 'urandom', maybe it should be a cross-system option + ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) + "--with-random=/dev/urandom"; CXX = "${stdenv.cc.targetPrefix}c++"; CXXCPP = "${stdenv.cc.targetPrefix}c++ -E"; @@ -94,16 +97,6 @@ stdenv.mkDerivation rec { ln $out/lib/libcurl.so $out/lib/libcurl-gnutls.so.4.4.0 ''; - crossAttrs = { - # We should refer to the cross built openssl - # For the 'urandom', maybe it should be a cross-system option - configureFlags = [ - ( if sslSupport then "--with-ssl=${openssl.crossDrv}" else "--without-ssl" ) - ( if gnutlsSupport then "--with-gnutls=${gnutls.crossDrv}" else "--without-gnutls" ) - "--with-random=/dev/urandom" - ]; - }; - passthru = { inherit sslSupport openssl; };