Skip to content
Closed
6 changes: 3 additions & 3 deletions pkgs/development/interpreters/lua-5/5.2.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ stdenv.mkDerivation rec {
'';

crossAttrs = let
inherit (hostPlatform) isDarwin isMingw;
inherit (hostPlatform) isDarwin isMinGW;
in {
configurePhase = ''
makeFlagsArray=(
INSTALL_TOP=$out
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"
Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/interpreters/lua-5/5.3.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ stdenv.mkDerivation rec {
'';

crossAttrs = let
inherit (hostPlatform) isDarwin isMingw;
inherit (hostPlatform) isDarwin isMinGW;
in {
configurePhase = ''
makeFlagsArray=(
INSTALL_TOP=$out
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"
Expand Down
7 changes: 6 additions & 1 deletion pkgs/development/libraries/kerberos/krb5.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/libtasn1/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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/;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/libuv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't propagate this everywhere. Stdenv should just disable doCheck when cross compiling.


meta = with lib; {
description = "A multi-platform support library with a focus on asynchronous I/O";
Expand Down
19 changes: 16 additions & 3 deletions pkgs/development/tools/misc/autogen/default.nix
Original file line number Diff line number Diff line change
@@ -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}";
Expand All @@ -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
Expand Down
8 changes: 7 additions & 1 deletion pkgs/development/tools/misc/binutils/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Expand Down
10 changes: 9 additions & 1 deletion pkgs/development/tools/misc/pkgconfig/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions pkgs/tools/compression/bsdiff/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/compression/xz/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ stdenv.mkDerivation rec {

outputs = [ "bin" "dev" "out" "man" "doc" ];

doCheck = true;
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.


# In stdenv-linux, prevent a dependency on bootstrap-tools.
preConfigure = "unset CONFIG_SHELL";
Expand Down
15 changes: 11 additions & 4 deletions pkgs/tools/system/at/default.nix
Original file line number Diff line number Diff line change
@@ -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"
}:
Expand All @@ -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 =
''
Expand Down
4 changes: 2 additions & 2 deletions pkgs/tools/system/at/install.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
7 changes: 5 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -7167,6 +7168,7 @@ with pkgs;
binutils_nogold = lowPrio (binutils-raw.override {
bintools = binutils-raw.bintools.override {
gold = false;
defaultLd = "bfd";
};
});

Expand Down Expand Up @@ -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;
Expand Down