Merge pull request #61086 from mayflower/cross-fixes

Batch of cross compilation fixes
This commit is contained in:
Robin Gloster 2019-05-07 20:35:47 +00:00 committed by GitHub
commit f41599a028
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 81 additions and 45 deletions

View File

@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./utils.patch ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./utils.patch
++ [./fix_private_keyword.patch]; ++ [./fix_private_keyword.patch];
buildInputs = stdenv.lib.optional stdenv.isAarch64 autoreconfHook; nativeBuildInputs = stdenv.lib.optional stdenv.isAarch64 autoreconfHook;
propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [
Carbon Carbon
@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
hardeningDisable = [ "format" ]; hardeningDisable = [ "format" ];
preConfigure = "unset CC" + stdenv.lib.optionalString stdenv.isAarch64 ''\n preConfigure = "unset CC" + stdenv.lib.optionalString stdenv.isAarch64 '';
cp ${gnu-config}/config.sub configure.sub cp ${gnu-config}/config.sub configure.sub
cp ${gnu-config}/config.guess configure.guess cp ${gnu-config}/config.guess configure.guess
''; '';

View File

@ -21,6 +21,8 @@ stdenv.mkDerivation rec {
sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk
''; '';
makeFlags = [ "CC:=$(CC)" ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A generic, highly customizable, and efficient menu for the X Window System"; description = "A generic, highly customizable, and efficient menu for the X Window System";
homepage = https://tools.suckless.org/dmenu; homepage = https://tools.suckless.org/dmenu;

View File

@ -1,4 +1,6 @@
{ stdenv, fetchurl, pkgconfig, expat, gettext, libiconv, dbus, glib }: { stdenv, fetchurl, buildPackages
, pkgconfig, expat, gettext, libiconv, dbus, glib
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "dbus-glib-0.110"; name = "dbus-glib-0.110";
@ -11,15 +13,15 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" "devdoc" ]; outputs = [ "out" "dev" "devdoc" ];
outputBin = "dev"; outputBin = "dev";
nativeBuildInputs = [ pkgconfig gettext ]; nativeBuildInputs = [ pkgconfig gettext glib ];
buildInputs = [ expat libiconv ]; buildInputs = [ expat libiconv ];
propagatedBuildInputs = [ dbus glib ]; propagatedBuildInputs = [ dbus glib ];
preConfigure = '' configureFlags = [ "--exec-prefix=${placeholder "dev"}" ] ++
configureFlagsArray+=("--exec-prefix=$dev") stdenv.lib.optional (stdenv.buildPlatform != stdenv.hostPlatform)
''; "--with-dbus-binding-tool=${buildPackages.dbus-glib.dev}/bin/dbus-binding-tool";
doCheck = false; doCheck = false;

View File

@ -1,4 +1,6 @@
{ fetchurl, stdenv, perl, bison, flex, pkgconfig, glib, libxml2, libintl }: { fetchurl, fetchpatch, stdenv, autoreconfHook
, perl, bison2, flex, pkgconfig, glib, libxml2, libintl
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "gstreamer-0.10.36"; name = "gstreamer-0.10.36";
@ -13,12 +15,31 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
nativeBuildInputs = [ pkgconfig libintl ]; nativeBuildInputs = [ autoreconfHook flex perl pkgconfig libintl bison2 glib ];
buildInputs = [ perl bison flex ];
propagatedBuildInputs = [ glib libxml2 ]; propagatedBuildInputs = [ glib libxml2 ];
# See https://trac.macports.org/ticket/40783 for explanation of patch patches = [
patches = stdenv.lib.optional stdenv.isDarwin ./darwin.patch; (fetchpatch {
url = "https://github.com/GStreamer/common/commit/03a0e5736761a72d4ed880e8c485bbf9e4a8ea47.patch";
sha256 = "0rin3x01yy78ky3smmhbwlph18hhym18q4x9w6ddiqajg5lk4xhm";
extraPrefix = "common/";
stripLen = 1;
})
(fetchpatch {
url = "https://github.com/GStreamer/common/commit/8aadeaaa8a948d7ce62008789ab03e9aa514c2b9.patch";
sha256 = "0n2mqvq2al7jr2hflhz4l781i3jya5a9i725jvy508ambpgycz3x";
extraPrefix = "common/";
stripLen = 1;
})
(fetchpatch {
url = "https://github.com/GStreamer/common/commit/7bb2bcecda471a0d514a964365a78150f3ee5747.patch";
sha256 = "0famdj70m7wjvr1dpy7iywhrkqxmrshxz0rizz1bixgp42dvkhbq";
extraPrefix = "common/";
stripLen = 1;
})
] ++
# See https://trac.macports.org/ticket/40783 for explanation of patch
stdenv.lib.optional stdenv.isDarwin ./darwin.patch;
postPatch = '' postPatch = ''
sed -i -e 's/^ /\t/' docs/gst/Makefile.in docs/libs/Makefile.in docs/plugins/Makefile.in sed -i -e 's/^ /\t/' docs/gst/Makefile.in docs/libs/Makefile.in docs/plugins/Makefile.in

View File

@ -8,13 +8,15 @@ stdenv.mkDerivation rec {
url = "https://salsa.debian.org/iso-codes-team/iso-codes/uploads/ef8de8bc12e0512d26ed73436a477871/${name}.tar.xz"; url = "https://salsa.debian.org/iso-codes-team/iso-codes/uploads/ef8de8bc12e0512d26ed73436a477871/${name}.tar.xz";
sha256 = "08i8hjy0qjlw9kd9i87jx967ihwh45l2xi55q1aa5265sind7byb"; sha256 = "08i8hjy0qjlw9kd9i87jx967ihwh45l2xi55q1aa5265sind7byb";
}; };
patchPhase = '' patchPhase = ''
for i in `find . -name \*.py` for i in `find . -name \*.py`
do do
sed -i -e "s|#!/usr/bin/env python|#!${python3}/bin/python|" $i sed -i -e "s|#!/usr/bin/env python|#!${python3}/bin/python|" $i
done done
''; '';
buildInputs = [ gettext python3 ];
nativeBuildInputs = [ gettext python3 ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = https://salsa.debian.org/iso-codes-team/iso-codes; homepage = https://salsa.debian.org/iso-codes-team/iso-codes;

View File

@ -1,5 +1,5 @@
{ stdenv, file, lib, fetchFromGitHub, fetchpatch, autoreconfHook, bison, flex, pkgconfig { stdenv, file, lib, fetchFromGitHub, fetchpatch, autoreconfHook, bison, flex, pkgconfig
, pythonSupport ? true, swig ? null, python}: , pythonSupport ? stdenv.buildPlatform == stdenv.hostPlatform, swig ? null, python}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libnl-${version}"; name = "libnl-${version}";

View File

@ -1430,7 +1430,7 @@ lib.makeScope newScope (self: with self; {
meta.platforms = stdenv.lib.platforms.unix; meta.platforms = stdenv.lib.platforms.unix;
}) {}; }) {};
xcbutil = callPackage ({ stdenv, pkgconfig, fetchurl, gperf, m4, libxcb, xorgproto }: stdenv.mkDerivation { xcbutil = callPackage ({ stdenv, pkgconfig, fetchurl, gperf, libxcb, xorgproto, m4 }: stdenv.mkDerivation {
name = "xcb-util-0.4.0"; name = "xcb-util-0.4.0";
builder = ./builder.sh; builder = ./builder.sh;
src = fetchurl { src = fetchurl {
@ -1438,12 +1438,12 @@ lib.makeScope newScope (self: with self; {
sha256 = "1sahmrgbpyki4bb72hxym0zvxwnycmswsxiisgqlln9vrdlr9r26"; sha256 = "1sahmrgbpyki4bb72hxym0zvxwnycmswsxiisgqlln9vrdlr9r26";
}; };
hardeningDisable = [ "bindnow" "relro" ]; hardeningDisable = [ "bindnow" "relro" ];
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig m4 ];
buildInputs = [ gperf m4 libxcb xorgproto ]; buildInputs = [ gperf libxcb xorgproto ];
meta.platforms = stdenv.lib.platforms.unix; meta.platforms = stdenv.lib.platforms.unix;
}) {}; }) {};
xcbutilcursor = callPackage ({ stdenv, pkgconfig, fetchurl, gperf, m4, libxcb, xcbutilimage, xcbutilrenderutil, xorgproto }: stdenv.mkDerivation { xcbutilcursor = callPackage ({ stdenv, pkgconfig, fetchurl, gperf, libxcb, xcbutilimage, xcbutilrenderutil, xorgproto, m4 }: stdenv.mkDerivation {
name = "xcb-util-cursor-0.1.3"; name = "xcb-util-cursor-0.1.3";
builder = ./builder.sh; builder = ./builder.sh;
src = fetchurl { src = fetchurl {
@ -1451,12 +1451,12 @@ lib.makeScope newScope (self: with self; {
sha256 = "0krr4rcw6r42cncinzvzzdqnmxk3nrgpnadyg2h8k9x10q3hm885"; sha256 = "0krr4rcw6r42cncinzvzzdqnmxk3nrgpnadyg2h8k9x10q3hm885";
}; };
hardeningDisable = [ "bindnow" "relro" ]; hardeningDisable = [ "bindnow" "relro" ];
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig m4 ];
buildInputs = [ gperf m4 libxcb xcbutilimage xcbutilrenderutil xorgproto ]; buildInputs = [ gperf libxcb xcbutilimage xcbutilrenderutil xorgproto ];
meta.platforms = stdenv.lib.platforms.unix; meta.platforms = stdenv.lib.platforms.unix;
}) {}; }) {};
xcbutilerrors = callPackage ({ stdenv, pkgconfig, fetchurl, gperf, m4, libxcb, xcbproto, xorgproto }: stdenv.mkDerivation { xcbutilerrors = callPackage ({ stdenv, pkgconfig, fetchurl, gperf, libxcb, xcbproto, xorgproto, m4 }: stdenv.mkDerivation {
name = "xcb-util-errors-1.0"; name = "xcb-util-errors-1.0";
builder = ./builder.sh; builder = ./builder.sh;
src = fetchurl { src = fetchurl {
@ -1464,12 +1464,12 @@ lib.makeScope newScope (self: with self; {
sha256 = "158rm913dg3hxrrhyvvxr8bcm0pjy5jws70dhy2s12w1krv829k8"; sha256 = "158rm913dg3hxrrhyvvxr8bcm0pjy5jws70dhy2s12w1krv829k8";
}; };
hardeningDisable = [ "bindnow" "relro" ]; hardeningDisable = [ "bindnow" "relro" ];
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig m4 ];
buildInputs = [ gperf m4 libxcb xcbproto xorgproto ]; buildInputs = [ gperf libxcb xcbproto xorgproto ];
meta.platforms = stdenv.lib.platforms.unix; meta.platforms = stdenv.lib.platforms.unix;
}) {}; }) {};
xcbutilimage = callPackage ({ stdenv, pkgconfig, fetchurl, gperf, m4, libxcb, xcbutil, xorgproto }: stdenv.mkDerivation { xcbutilimage = callPackage ({ stdenv, pkgconfig, fetchurl, gperf, libxcb, xcbutil, xorgproto, m4 }: stdenv.mkDerivation {
name = "xcb-util-image-0.4.0"; name = "xcb-util-image-0.4.0";
builder = ./builder.sh; builder = ./builder.sh;
src = fetchurl { src = fetchurl {
@ -1477,12 +1477,12 @@ lib.makeScope newScope (self: with self; {
sha256 = "1z1gxacg7q4cw6jrd26gvi5y04npsyavblcdad1xccc8swvnmf9d"; sha256 = "1z1gxacg7q4cw6jrd26gvi5y04npsyavblcdad1xccc8swvnmf9d";
}; };
hardeningDisable = [ "bindnow" "relro" ]; hardeningDisable = [ "bindnow" "relro" ];
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig m4 ];
buildInputs = [ gperf m4 libxcb xcbutil xorgproto ]; buildInputs = [ gperf libxcb xcbutil xorgproto ];
meta.platforms = stdenv.lib.platforms.unix; meta.platforms = stdenv.lib.platforms.unix;
}) {}; }) {};
xcbutilkeysyms = callPackage ({ stdenv, pkgconfig, fetchurl, gperf, m4, libxcb, xorgproto }: stdenv.mkDerivation { xcbutilkeysyms = callPackage ({ stdenv, pkgconfig, fetchurl, gperf, libxcb, xorgproto, m4 }: stdenv.mkDerivation {
name = "xcb-util-keysyms-0.4.0"; name = "xcb-util-keysyms-0.4.0";
builder = ./builder.sh; builder = ./builder.sh;
src = fetchurl { src = fetchurl {
@ -1490,12 +1490,12 @@ lib.makeScope newScope (self: with self; {
sha256 = "1nbd45pzc1wm6v5drr5338j4nicbgxa5hcakvsvm5pnyy47lky0f"; sha256 = "1nbd45pzc1wm6v5drr5338j4nicbgxa5hcakvsvm5pnyy47lky0f";
}; };
hardeningDisable = [ "bindnow" "relro" ]; hardeningDisable = [ "bindnow" "relro" ];
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig m4 ];
buildInputs = [ gperf m4 libxcb xorgproto ]; buildInputs = [ gperf libxcb xorgproto ];
meta.platforms = stdenv.lib.platforms.unix; meta.platforms = stdenv.lib.platforms.unix;
}) {}; }) {};
xcbutilrenderutil = callPackage ({ stdenv, pkgconfig, fetchurl, gperf, m4, libxcb, xorgproto }: stdenv.mkDerivation { xcbutilrenderutil = callPackage ({ stdenv, pkgconfig, fetchurl, gperf, libxcb, xorgproto, m4 }: stdenv.mkDerivation {
name = "xcb-util-renderutil-0.3.9"; name = "xcb-util-renderutil-0.3.9";
builder = ./builder.sh; builder = ./builder.sh;
src = fetchurl { src = fetchurl {
@ -1503,12 +1503,12 @@ lib.makeScope newScope (self: with self; {
sha256 = "0nza1csdvvxbmk8vgv8vpmq7q8h05xrw3cfx9lwxd1hjzd47xsf6"; sha256 = "0nza1csdvvxbmk8vgv8vpmq7q8h05xrw3cfx9lwxd1hjzd47xsf6";
}; };
hardeningDisable = [ "bindnow" "relro" ]; hardeningDisable = [ "bindnow" "relro" ];
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig m4 ];
buildInputs = [ gperf m4 libxcb xorgproto ]; buildInputs = [ gperf libxcb xorgproto ];
meta.platforms = stdenv.lib.platforms.unix; meta.platforms = stdenv.lib.platforms.unix;
}) {}; }) {};
xcbutilwm = callPackage ({ stdenv, pkgconfig, fetchurl, gperf, m4, libxcb, xorgproto }: stdenv.mkDerivation { xcbutilwm = callPackage ({ stdenv, pkgconfig, fetchurl, gperf, libxcb, xorgproto, m4 }: stdenv.mkDerivation {
name = "xcb-util-wm-0.4.1"; name = "xcb-util-wm-0.4.1";
builder = ./builder.sh; builder = ./builder.sh;
src = fetchurl { src = fetchurl {
@ -1516,8 +1516,8 @@ lib.makeScope newScope (self: with self; {
sha256 = "0gra7hfyxajic4mjd63cpqvd20si53j1q3rbdlkqkahfciwq3gr8"; sha256 = "0gra7hfyxajic4mjd63cpqvd20si53j1q3rbdlkqkahfciwq3gr8";
}; };
hardeningDisable = [ "bindnow" "relro" ]; hardeningDisable = [ "bindnow" "relro" ];
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig m4 ];
buildInputs = [ gperf m4 libxcb xorgproto ]; buildInputs = [ gperf libxcb xorgproto ];
meta.platforms = stdenv.lib.platforms.unix; meta.platforms = stdenv.lib.platforms.unix;
}) {}; }) {};

View File

@ -229,7 +229,8 @@ while (<>) {
push @nativeRequires, "gettext" if $file =~ /USE_GETTEXT/; push @nativeRequires, "gettext" if $file =~ /USE_GETTEXT/;
push @requires, "libxslt" if $pkg =~ /libxcb/; push @requires, "libxslt" if $pkg =~ /libxcb/;
push @requires, "gperf", "m4", "xorgproto" if $pkg =~ /xcbutil/; push @nativeRequires, "m4" if $pkg =~ /xcbutil/;
push @requires, "gperf", "xorgproto" if $pkg =~ /xcbutil/;
print "REQUIRES $pkg => @requires\n"; print "REQUIRES $pkg => @requires\n";
print "NATIVE_REQUIRES $pkg => @nativeRequires\n"; print "NATIVE_REQUIRES $pkg => @nativeRequires\n";

View File

@ -198,6 +198,9 @@ self: super:
libXi = super.libXi.overrideAttrs (attrs: { libXi = super.libXi.overrideAttrs (attrs: {
outputs = [ "out" "dev" "man" "doc" ]; outputs = [ "out" "dev" "man" "doc" ];
propagatedBuildInputs = [ self.libXfixes ]; propagatedBuildInputs = [ self.libXfixes ];
configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"xorg_cv_malloc0_returns_null=no"
];
}); });
libXinerama = super.libXinerama.overrideAttrs (attrs: { libXinerama = super.libXinerama.overrideAttrs (attrs: {

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, fetchpatch, pkgconfig, attr, acl, zlib, libuuid, e2fsprogs, lzo { stdenv, fetchurl, fetchpatch, pkgconfig, attr, acl, zlib, libuuid, e2fsprogs, lzo
, asciidoc, xmlto, docbook_xml_dtd_45, docbook_xsl, libxslt, zstd, python3, python3Packages , asciidoc, xmlto, docbook_xml_dtd_45, docbook_xsl, libxslt, zstd, python3
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -12,10 +12,17 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ nativeBuildInputs = [
pkgconfig asciidoc xmlto docbook_xml_dtd_45 docbook_xsl libxslt python3 python3Packages.setuptools pkgconfig asciidoc xmlto docbook_xml_dtd_45 docbook_xsl libxslt
python3 python3.pkgs.setuptools
]; ];
buildInputs = [ attr acl zlib libuuid e2fsprogs lzo zstd ]; buildInputs = [ attr acl zlib libuuid e2fsprogs lzo zstd python3 ];
# for python cross-compiling
_PYTHON_HOST_PLATFORM = stdenv.hostPlatform.config;
postConfigure = ''
export LDSHARED="$LD -shared"
'';
# gcc bug with -O1 on ARM with gcc 4.8 # gcc bug with -O1 on ARM with gcc 4.8
# This should be fine on all platforms so apply universally # This should be fine on all platforms so apply universally

View File

@ -8,8 +8,8 @@ stdenv.mkDerivation rec {
sha256 = "1855np7c4b0bqzhf1l1dyzxb90fpnvrirdisajhci5am6als31z9"; sha256 = "1855np7c4b0bqzhf1l1dyzxb90fpnvrirdisajhci5am6als31z9";
}; };
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig autoconf ];
buildInputs = [ autoconf libpcap ncurses glib ]; buildInputs = [ libpcap ncurses glib ];
patches = [ patches = [
./no-dns-resolution.patch ./no-dns-resolution.patch

View File

@ -10489,12 +10489,10 @@ in
gsettings-qt = libsForQt5.callPackage ../development/libraries/gsettings-qt { }; gsettings-qt = libsForQt5.callPackage ../development/libraries/gsettings-qt { };
gst_all_1 = recurseIntoAttrs(callPackage ../development/libraries/gstreamer { gst_all_1 = recurseIntoAttrs(callPackage ../development/libraries/gstreamer {
callPackage = pkgs.newScope (pkgs // { libav = pkgs.ffmpeg; }); callPackage = newScope { libav = pkgs.ffmpeg; };
}); });
gstreamer = callPackage ../development/libraries/gstreamer/legacy/gstreamer { gstreamer = callPackage ../development/libraries/gstreamer/legacy/gstreamer { };
bison = bison2;
};
gst-plugins-base = callPackage ../development/libraries/gstreamer/legacy/gst-plugins-base { gst-plugins-base = callPackage ../development/libraries/gstreamer/legacy/gst-plugins-base {
inherit (darwin.apple_sdk.frameworks) ApplicationServices; inherit (darwin.apple_sdk.frameworks) ApplicationServices;