diff --git a/pkgs/development/interpreters/lua-5/5.2.nix b/pkgs/development/interpreters/lua-5/5.2.nix index 43e289cd36903..0cdc4770a9833 100644 --- a/pkgs/development/interpreters/lua-5/5.2.nix +++ b/pkgs/development/interpreters/lua-5/5.2.nix @@ -57,7 +57,7 @@ stdenv.mkDerivation rec { ''; crossAttrs = let - inherit (hostPlatform) isDarwin isMingw; + inherit (hostPlatform) isDarwin isMinGW; in { configurePhase = '' makeFlagsArray=( @@ -65,10 +65,10 @@ stdenv.mkDerivation rec { INSTALL_MAN=$out/share/man/man1 V=${luaversion} R=${version} - ${if isMingw then "mingw" else stdenv.lib.optionalString isDarwin '' + ${if isMinGW then "mingw" else stdenv.lib.optionalString isDarwin '' ''} ) - '' + stdenv.lib.optionalString isMingw '' + '' + stdenv.lib.optionalString isMinGW '' installFlagsArray=( TO_BIN="lua.exe luac.exe" TO_LIB="liblua.a lua52.dll" diff --git a/pkgs/development/interpreters/lua-5/5.3.nix b/pkgs/development/interpreters/lua-5/5.3.nix index a512a25131345..ad1dfa8823cb5 100644 --- a/pkgs/development/interpreters/lua-5/5.3.nix +++ b/pkgs/development/interpreters/lua-5/5.3.nix @@ -56,7 +56,7 @@ stdenv.mkDerivation rec { ''; crossAttrs = let - inherit (hostPlatform) isDarwin isMingw; + inherit (hostPlatform) isDarwin isMinGW; in { configurePhase = '' makeFlagsArray=( @@ -64,10 +64,10 @@ stdenv.mkDerivation rec { INSTALL_MAN=$out/share/man/man1 V=${luaversion} R=${version} - ${if isMingw then "mingw" else stdenv.lib.optionalString isDarwin '' + ${if isMinGW then "mingw" else stdenv.lib.optionalString isDarwin '' ''} ) - '' + stdenv.lib.optionalString isMingw '' + '' + stdenv.lib.optionalString isMinGW '' installFlagsArray=( TO_BIN="lua.exe luac.exe" TO_LIB="liblua.a lua52.dll" diff --git a/pkgs/development/libraries/kerberos/krb5.nix b/pkgs/development/libraries/kerberos/krb5.nix index 101c3aca07d34..98073b7bbdc46 100644 --- a/pkgs/development/libraries/kerberos/krb5.nix +++ b/pkgs/development/libraries/kerberos/krb5.nix @@ -22,7 +22,12 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; configureFlags = [ "--with-tcl=no" "--localstatedir=/var/lib"] - ++ optional stdenv.isFreeBSD ''WARN_CFLAGS=""''; + ++ optional stdenv.isFreeBSD ''WARN_CFLAGS=""'' + ++ optionals (stdenv.buildPlatform != stdenv.hostPlatform) + [ "krb5_cv_attr_constructor_destructor=yes,yes" + "ac_cv_func_regcomp=yes" + "ac_cv_printf_positional=yes" + ]; nativeBuildInputs = [ pkgconfig perl ] ++ optional (!libOnly) yacc diff --git a/pkgs/development/libraries/libtasn1/default.nix b/pkgs/development/libraries/libtasn1/default.nix index ccdc3aba61183..186d47b59b811 100644 --- a/pkgs/development/libraries/libtasn1/default.nix +++ b/pkgs/development/libraries/libtasn1/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ texinfo ]; buildInputs = [ perl ]; - doCheck = true; + doCheck = stdenv.buildPlatform == stdenv.hostPlatform; meta = with stdenv.lib; { homepage = http://www.gnu.org/software/libtasn1/; diff --git a/pkgs/development/libraries/libuv/default.nix b/pkgs/development/libraries/libuv/default.nix index 4075505f8dd89..02708f4f1ebd6 100644 --- a/pkgs/development/libraries/libuv/default.nix +++ b/pkgs/development/libraries/libuv/default.nix @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { # These should be turned back on, but see https://github.com/NixOS/nixpkgs/issues/23651 # For now the tests are just breaking large swaths of the nixpkgs binary cache for Darwin, # and I'd rather have everything else work at all than have stronger assurance here. - doCheck = !stdenv.isDarwin; + doCheck = !stdenv.isDarwin && stdenv.buildPlatform == stdenv.hostPlatform; meta = with lib; { description = "A multi-platform support library with a focus on asynchronous I/O"; diff --git a/pkgs/development/tools/misc/autogen/default.nix b/pkgs/development/tools/misc/autogen/default.nix index 28034f9d54927..77944297a9728 100644 --- a/pkgs/development/tools/misc/autogen/default.nix +++ b/pkgs/development/tools/misc/autogen/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, which, pkgconfig, perl, guile, libxml2 }: +{ stdenv, buildPackages, fetchurl, which, pkgconfig, texinfo, perl, guile, libxml2 }: stdenv.mkDerivation rec { name = "autogen-${version}"; @@ -11,8 +11,21 @@ stdenv.mkDerivation rec { outputs = [ "bin" "dev" "lib" "out" "man" "info" ]; - nativeBuildInputs = [ which pkgconfig perl ]; - buildInputs = [ guile libxml2 ]; + nativeBuildInputs = [ which pkgconfig perl ] + # autogen needs a build autogen when cross-compiling + ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + buildPackages.autogen buildPackages.texinfo ]; + buildInputs = [ + guile libxml2 + ]; + + configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + "--with-libxml2=${libxml2.dev}" + "--with-libxml2-cflags=-I${libxml2.dev}/include/libxml2" + # the configure check for regcomp wants to run a host program + "libopts_cv_with_libregex=yes" + #"MAKEINFO=${buildPackages.texinfo}/bin/makeinfo" + ]; postPatch = '' # Fix a broken sed expression used for detecting the minor diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 31c86c785c2df..1b53afce42ed9 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -2,8 +2,13 @@ , fetchurl, zlib , buildPlatform, hostPlatform, targetPlatform , noSysDirs, gold ? true, bison ? null + # Which ld implementation to use by default? +, defaultLd ? null }: +assert (builtins.elem defaultLd ["bfd" "gold" null]); +assert defaultLd == "gold" -> gold; + let # Note to whoever is upgrading this: 2.29 is broken. # ('nix-build pkgs/stdenv/linux/make-bootstrap-tools.nix -A test' segfaults on aarch64) @@ -102,7 +107,8 @@ stdenv.mkDerivation rec { "--enable-deterministic-archives" "--disable-werror" "--enable-fix-loongson2f-nop" - ] ++ optionals gold [ "--enable-gold" "--enable-plugins" ]; + ] ++ optionals gold [ "--enable-gold" "--enable-plugins" ] + ++ optional (defaultLd == "gold") "--enable-gold=default"; enableParallelBuilding = true; diff --git a/pkgs/development/tools/misc/pkgconfig/default.nix b/pkgs/development/tools/misc/pkgconfig/default.nix index 5be42855a9c7f..7cfd78a39a281 100644 --- a/pkgs/development/tools/misc/pkgconfig/default.nix +++ b/pkgs/development/tools/misc/pkgconfig/default.nix @@ -24,7 +24,15 @@ stdenv.mkDerivation rec { buildInputs = optional (stdenv.isCygwin || stdenv.isDarwin || stdenv.isSunOS) libiconv; configureFlags = [ "--with-internal-glib" ] - ++ optional (stdenv.isSunOS) [ "--with-libiconv=gnu" "--with-system-library-path" "--with-system-include-path" "CFLAGS=-DENABLE_NLS" ]; + ++ optional (stdenv.isSunOS) [ "--with-libiconv=gnu" "--with-system-library-path" "--with-system-include-path" "CFLAGS=-DENABLE_NLS" ] + # Can't run these tests while cross-compiling + ++ optional (stdenv.hostPlatform != stdenv.buildPlatform) + [ "glib_cv_stack_grows=no" + "glib_cv_uscore=no" + "ac_cv_func_posix_getpwuid_r=yes" + "ac_cv_func_posix_getgrgid_r=yes" + ]; + postInstall = ''rm -f "$out"/bin/*-pkg-config''; # clean the duplicate file diff --git a/pkgs/tools/compression/bsdiff/default.nix b/pkgs/tools/compression/bsdiff/default.nix index 1d693f781e6c1..095bd5f7d9a57 100644 --- a/pkgs/tools/compression/bsdiff/default.nix +++ b/pkgs/tools/compression/bsdiff/default.nix @@ -13,8 +13,8 @@ stdenv.mkDerivation rec { patches = [ ./include-systypes.patch ]; buildPhase = '' - cc -O3 -lbz2 bspatch.c -o bspatch - cc -O3 -lbz2 bsdiff.c -o bsdiff + $CC -O3 -lbz2 bspatch.c -o bspatch + $CC -O3 -lbz2 bsdiff.c -o bsdiff ''; installPhase = '' diff --git a/pkgs/tools/compression/xz/default.nix b/pkgs/tools/compression/xz/default.nix index 05cc672ab15e2..4c52271170465 100644 --- a/pkgs/tools/compression/xz/default.nix +++ b/pkgs/tools/compression/xz/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { outputs = [ "bin" "dev" "out" "man" "doc" ]; - doCheck = true; + doCheck = stdenv.hostPlatform == stdenv.buildPlatform; # In stdenv-linux, prevent a dependency on bootstrap-tools. preConfigure = "unset CONFIG_SHELL"; diff --git a/pkgs/tools/system/at/default.nix b/pkgs/tools/system/at/default.nix index cc4ccdd40f090..eda2197b9f61c 100644 --- a/pkgs/tools/system/at/default.nix +++ b/pkgs/tools/system/at/default.nix @@ -1,4 +1,4 @@ -{ fetchurl, stdenv, bison, flex, pam +{ stdenv, fetchurl, fetchpatch, bison, flex, pam , sendmailPath ? "/run/wrappers/bin/sendmail" , atWrapperPath ? "/run/wrappers/bin/at" }: @@ -13,10 +13,17 @@ stdenv.mkDerivation rec { sha256 = "1fgsrqpx0r6qcjxmlsqnwilydhfxn976c870mjc0n1bkmcy94w88"; }; - patches = [ ./install.patch ]; + patches = [ + ./install.patch + (fetchpatch { + url = "https://raw.githubusercontent.com/riscv/riscv-poky/master/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch"; + sha256 = "1rk4hskp0c1jqkanzdxf873i6jgki3xhrm609fsam8an8sl1njnm"; + }) + ]; - buildInputs = - [ bison flex pam ]; + nativeBuildInputs = [ bison flex ]; + + buildInputs = [ pam ]; preConfigure = '' diff --git a/pkgs/tools/system/at/install.patch b/pkgs/tools/system/at/install.patch index 35be4af875a35..41a35a7895388 100644 --- a/pkgs/tools/system/at/install.patch +++ b/pkgs/tools/system/at/install.patch @@ -20,7 +20,7 @@ + $(INSTALL) -m 755 -d $(IROOT)$(sbindir) + $(INSTALL) -m 755 -d $(IROOT)$(docdir) + $(INSTALL) -m 755 -d $(IROOT)$(atdocdir) -+ $(INSTALL) -m 0755 -s at $(IROOT)$(bindir) ++ $(INSTALL) -m 0755 at $(IROOT)$(bindir) $(LN_S) -f at $(IROOT)$(bindir)/atq $(LN_S) -f at $(IROOT)$(bindir)/atrm - $(INSTALL) -g root -o root -m 755 batch $(IROOT)$(bindir) @@ -34,7 +34,7 @@ + $(INSTALL) -d -m 755 $(IROOT)$(man1dir) + $(INSTALL) -d -m 755 $(IROOT)$(man5dir) + $(INSTALL) -d -m 755 $(IROOT)$(man8dir) -+ $(INSTALL) -m 755 -s atd $(IROOT)$(sbindir) ++ $(INSTALL) -m 755 atd $(IROOT)$(sbindir) + $(INSTALL) -m 755 atrun $(IROOT)$(sbindir) + $(INSTALL) -m 644 at.1 $(IROOT)$(man1dir)/ cd $(IROOT)$(man1dir) && $(LN_S) -f at.1 atq.1 && $(LN_S) -f at.1 batch.1 && $(LN_S) -f at.1 atrm.1 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3008f2975eaf3..459c66b9593bf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7158,6 +7158,7 @@ with pkgs; binutils-unwrapped = callPackage ../development/tools/misc/binutils { # FHS sys dirs presumably only have stuff for the build platform noSysDirs = (targetPlatform != buildPlatform) || noSysDirs; + defaultLd = config.defaultLd or null; }; binutils-raw = wrapBintoolsWith { libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc; @@ -7167,6 +7168,7 @@ with pkgs; binutils_nogold = lowPrio (binutils-raw.override { bintools = binutils-raw.bintools.override { gold = false; + defaultLd = "bfd"; }; }); @@ -12340,11 +12342,12 @@ with pkgs; }; xorg = recurseIntoAttrs (lib.callPackagesWith pkgs ../servers/x11/xorg/default.nix { - inherit clangStdenv fetchurl fetchgit fetchpatch stdenv pkgconfig intltool freetype fontconfig + inherit clangStdenv fetchurl fetchgit fetchpatch stdenv intltool freetype fontconfig libxslt expat libpng zlib perl mesa_drivers spice_protocol libunwind dbus libuuid openssl gperf m4 libevdev tradcpp libinput mcpp makeWrapper autoreconfHook - autoconf automake libtool xmlto asciidoc flex bison mtdev pixman + autoconf automake libtool mtdev pixman cairo epoxy; + inherit (buildPackages) pkgconfig xmlto asciidoc flex bison; inherit (darwin) apple_sdk cf-private libobjc; bootstrap_cmds = if stdenv.isDarwin then darwin.bootstrap_cmds else null; mesa = mesa_noglu;