Merge pull request #39420 from bgamari/cross-fixes-1

A selection of cross-compiling fixes
This commit is contained in:
John Ericson 2018-05-03 17:18:27 -04:00 committed by GitHub
commit 8ac79d2575
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 49 additions and 9 deletions

View File

@ -19,7 +19,11 @@ in rec {
darwin = [ patterns.isDarwin ];
freebsd = [ patterns.isFreeBSD ];
# Should be better, but MinGW is unclear, and HURD is bit-rotted.
gnu = [ { kernel = parse.kernels.linux; abi = parse.abis.gnu; } ];
gnu = [
{ kernel = parse.kernels.linux; abi = parse.abis.gnu; }
{ kernel = parse.kernels.linux; abi = parse.abis.gnueabi; }
{ kernel = parse.kernels.linux; abi = parse.abis.gnueabihf; }
];
illumos = [ patterns.isSunOS ];
linux = [ patterns.isLinux ];
netbsd = [ patterns.isNetBSD ];

View File

@ -20,13 +20,15 @@ stdenv.mkDerivation rec {
buildInputs = [ libdaemon dbus perl perlXMLParser glib expat libiconv ]
++ (stdenv.lib.optional qt4Support qt4);
nativeBuildInputs = [ pkgconfig gettext intltool ];
nativeBuildInputs = [ pkgconfig gettext intltool glib ];
configureFlags =
[ "--disable-qt3" "--disable-gdbm" "--disable-mono"
"--disable-gtk" "--disable-gtk3"
"--${if qt4Support then "enable" else "disable"}-qt4"
"--disable-python" "--localstatedir=/var" "--with-distro=none" ]
"--disable-python" "--localstatedir=/var" "--with-distro=none"
# A systemd unit is provided by the avahi-daemon NixOS module
"--with-systemdsystemunitdir=no" ]
++ stdenv.lib.optional withLibdnssdCompat "--enable-compat-libdns_sd"
# autoipd won't build on darwin
++ stdenv.lib.optional stdenv.isDarwin "--disable-autoipd";

View File

@ -65,7 +65,7 @@ stdenv.mkDerivation rec {
++ optionals stdenv.isLinux [ utillinuxMinimal ] # for libmount
++ optionals doCheck [ tzdata libxml2 desktop-file-utils shared-mime-info ];
nativeBuildInputs = [ pkgconfig perl python ];
nativeBuildInputs = [ pkgconfig perl python gettext ];
propagatedBuildInputs = [ zlib libffi gettext libiconv ];

View File

@ -40,6 +40,9 @@ stdenv.mkDerivation rec {
"--with-trust-anchor=${dns-root-data}/root.key"
"--with-drill"
"--disable-gost"
] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"ac_cv_func_malloc_0_nonnull=yes"
"ac_cv_func_realloc_0_nonnull=yes"
];
postInstall = ''

View File

@ -19,6 +19,8 @@ stdenv.mkDerivation {
sha256 = "0dd7xxikib201i99k2if066hh7gwf2i4ffckrjplq6lr206jn00r";
});
enableParallelBuilding = true;
nativeBuildInputs = [ autoreconfHook bison flex pkgconfig ];
meta = with lib; {

View File

@ -10,6 +10,8 @@ stdenv.mkDerivation rec {
sha256 = "0hkdzc71pdnscbpdpgwljcchiyancarldjyd0w609sy18bky833x";
};
makeFlags = "CC=${stdenv.cc.targetPrefix}cc";
installPhase = ''
make install prefix=$out
mkdir -p $out/share/man/man1

View File

@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
'';
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
"AR=${stdenv.cc.targetPrefix}ar"
"BASEDIR=$(out)"
"mandir=/share/man"
"HAVE_ARP_TOOLS=1"

View File

@ -35,7 +35,7 @@ in stdenv.mkDerivation rec {
buildInputs = [ libnsl ];
makeFlags = [ "REAL_DAEMON_DIR=$(out)/bin" "linux" ];
makeFlags = [ "REAL_DAEMON_DIR=$(out)/bin" "linux" "AR:=$(AR)" ];
installPhase = ''
mkdir -p "$out/bin"

View File

@ -76,8 +76,8 @@ stdenv.mkDerivation rec {
++ stdenv.lib.optional c-aresSupport "--enable-ares=${c-ares}"
++ stdenv.lib.optional gssSupport "--with-gssapi=${kerberos.dev}";
CXX = "c++";
CXXCPP = "c++ -E";
CXX = "${stdenv.cc.targetPrefix}c++";
CXXCPP = "${stdenv.cc.targetPrefix}c++ -E";
doCheck = false; # expensive, fails

View File

@ -9,6 +9,9 @@ stdenv.mkDerivation rec {
sha256 = "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0";
};
# For cross-compilation
makeFlags = [ "AR:=$(AR)" ];
meta = {
description = "A random number generator daemon";

View File

@ -13,6 +13,10 @@ stdenv.mkDerivation rec {
sha256 = "065s8w62r6chjjs6m9hapcagy33m75nlnxb69vg0f4ngn061dl3g";
};
patches = [
./fix-ar-ranlib.patch
];
outputs = [ "out" "man" ];
sourceRoot = "admin/${name}";
@ -34,8 +38,8 @@ stdenv.mkDerivation rec {
cd src
# Both of these are originally hard-coded to gcc
echo cc > conf-cc
echo cc > conf-ld
echo ${stdenv.cc.targetPrefix}cc > conf-cc
echo ${stdenv.cc.targetPrefix}cc > conf-ld
'';
installPhase = ''

View File

@ -0,0 +1,18 @@
--- runit-2.1.2/src/print-ar.sh
+++ runit-2.1.2/src/print-ar.sh
@@ -1,7 +1,7 @@
cat warn-auto.sh
echo 'main="$1"; shift'
echo 'rm -f "$main"'
-echo 'ar cr "$main" ${1+"$@"}'
+echo '$AR cr "$main" ${1+"$@"}'
case "`cat systype`" in
sunos-5.*) ;;
unix_sv*) ;;
@@ -10,5 +10,5 @@ case "`cat systype`" in
dgux-*) ;;
hp-ux-*) ;;
sco*) ;;
- *) echo 'ranlib "$main"' ;;
+ *) echo '$RANLIB "$main"' ;;
esac