git.iko.soy/typeable/nixpkgs
on master help sign in
libelf: Modernize and fix for cross
2e337feJohn Ericson
pkgs/development/libraries/libelf/cross-ar.patchnew file+11
@@ -0,0 +1,11 @@
1+--- a/lib/Makefile.in
2++++ b/lib/Makefile.in
3+@@ -27,7 +27,7 @@ installdirs = $(libdir) $(includedir) $(includedir)/libelf
4+
5+ CC = @CC@
6+ LD = @LD@
7+-AR = ar
8++AR ?= ar
9+ MV = mv -f
10+ RM = rm -f
11+ LN_S = @LN_S@
pkgs/development/libraries/libelf/default.nix+10−7
@@ -1,4 +1,7 @@
1+{ stdenv, fetchurl
1−{ fetchurl, stdenv, gettext, glibc }:
2+, gettext, glibc
3+, buildPlatform, hostPlatform
4+}:
2
5
3stdenv.mkDerivation rec {
6stdenv.mkDerivation rec {
4 name = "libelf-0.8.13";
7 name = "libelf-0.8.13";
@@ -8,20 +11,20 @@ stdenv.mkDerivation rec {
8 sha256 = "0vf7s9dwk2xkmhb79aigqm0x0yfbw1j0b9ksm51207qwr179n6jr";
11 sha256 = "0vf7s9dwk2xkmhb79aigqm0x0yfbw1j0b9ksm51207qwr179n6jr";
9 };
12 };
10
13
14+ # TODO(@Ericson2314) Make unconditional next hash break
15+ patches = if hostPlatform == buildPlatform then null else [
16+ ./cross-ar.patch
17+ ];
18+
11 doCheck = true;
19 doCheck = true;
12
20
13 # FIXME needs gcc 4.9 in bootstrap tools
21 # FIXME needs gcc 4.9 in bootstrap tools
14 hardeningDisable = [ "stackprotector" ];
22 hardeningDisable = [ "stackprotector" ];
15
23
16− # For cross-compiling, native glibc is needed for the "gencat" program.
17− crossAttrs = {
18− nativeBuildInputs = [ gettext glibc ];
19− };
20−
21 # Libelf's custom NLS macros fail to determine the catalog file extension on
24 # Libelf's custom NLS macros fail to determine the catalog file extension on
22 # Darwin, so disable NLS for now.
25 # Darwin, so disable NLS for now.
23 # FIXME: Eventually make Gettext a build input on all platforms.
26 # 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";
25
28
26 nativeBuildInputs = [ gettext ];
29 nativeBuildInputs = [ gettext ];
27
30