@@ -1,4 +1,7 @@
1−{ fetchurl, stdenv, gettext, glibc }:
1+{ stdenv, fetchurl
2+, gettext, glibc
3+, buildPlatform, hostPlatform
4+}:
25
36stdenv.mkDerivation rec {
47 name = "libelf-0.8.13";
@@ -8,20 +11,20 @@ stdenv.mkDerivation rec {
811 sha256 = "0vf7s9dwk2xkmhb79aigqm0x0yfbw1j0b9ksm51207qwr179n6jr";
912 };
1013
14+ # TODO(@Ericson2314) Make unconditional next hash break
15+ patches = if hostPlatform == buildPlatform then null else [
16+ ./cross-ar.patch
17+ ];
18+
1119 doCheck = true;
1220
1321 # FIXME needs gcc 4.9 in bootstrap tools
1422 hardeningDisable = [ "stackprotector" ];
1523
16− # For cross-compiling, native glibc is needed for the "gencat" program.
17− crossAttrs = {
18− nativeBuildInputs = [ gettext glibc ];
19− };
20−
2124 # Libelf's custom NLS macros fail to determine the catalog file extension on
2225 # Darwin, so disable NLS for now.
2326 # FIXME: Eventually make Gettext a build input on all platforms.
24− configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-nls";
27+ configureFlags = stdenv.lib.optional hostPlatform.isDarwin "--disable-nls";
2528
2629 nativeBuildInputs = [ gettext ];
2730