libelf: Modernize and fix for cross

This commit is contained in:
John Ericson 2017-06-03 19:36:59 -04:00 committed by John Ericson
parent c54c3cb5ce
commit 2e337fe969
2 changed files with 21 additions and 7 deletions

View File

@ -0,0 +1,11 @@
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -27,7 +27,7 @@ installdirs = $(libdir) $(includedir) $(includedir)/libelf
CC = @CC@
LD = @LD@
-AR = ar
+AR ?= ar
MV = mv -f
RM = rm -f
LN_S = @LN_S@

View File

@ -1,4 +1,7 @@
{ fetchurl, stdenv, gettext, glibc }: { stdenv, fetchurl
, gettext, glibc
, buildPlatform, hostPlatform
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libelf-0.8.13"; name = "libelf-0.8.13";
@ -8,20 +11,20 @@ stdenv.mkDerivation rec {
sha256 = "0vf7s9dwk2xkmhb79aigqm0x0yfbw1j0b9ksm51207qwr179n6jr"; sha256 = "0vf7s9dwk2xkmhb79aigqm0x0yfbw1j0b9ksm51207qwr179n6jr";
}; };
# TODO(@Ericson2314) Make unconditional next hash break
patches = if hostPlatform == buildPlatform then null else [
./cross-ar.patch
];
doCheck = true; doCheck = true;
# FIXME needs gcc 4.9 in bootstrap tools # FIXME needs gcc 4.9 in bootstrap tools
hardeningDisable = [ "stackprotector" ]; hardeningDisable = [ "stackprotector" ];
# For cross-compiling, native glibc is needed for the "gencat" program.
crossAttrs = {
nativeBuildInputs = [ gettext glibc ];
};
# Libelf's custom NLS macros fail to determine the catalog file extension on # Libelf's custom NLS macros fail to determine the catalog file extension on
# Darwin, so disable NLS for now. # Darwin, so disable NLS for now.
# FIXME: Eventually make Gettext a build input on all platforms. # FIXME: Eventually make Gettext a build input on all platforms.
configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-nls"; configureFlags = stdenv.lib.optional hostPlatform.isDarwin "--disable-nls";
nativeBuildInputs = [ gettext ]; nativeBuildInputs = [ gettext ];