1{ stdenv
2, fetchurl, autoreconfHook, gettext
3, buildPlatform, hostPlatform
4}:
5
6stdenv.mkDerivation rec {
7 name = "libelf-0.8.13";
8
9 src = fetchurl {
10 url = "https://fossies.org/linux/misc/old/${name}.tar.gz";
11 sha256 = "0vf7s9dwk2xkmhb79aigqm0x0yfbw1j0b9ksm51207qwr179n6jr";
12 };
13
14 patches = [
15 ./dont-hardcode-ar.patch
16 ];
17
18 doCheck = true;
19
20 configureFlags = []
21 # Configure check for dynamic lib support is broken, see
22 # http://lists.uclibc.org/pipermail/uclibc-cvs/2005-August/019383.html
23 ++ stdenv.lib.optional (hostPlatform != buildPlatform) "mr_cv_target_elf=yes"
24 # Libelf's custom NLS macros fail to determine the catalog file extension
25 # on Darwin, so disable NLS for now.
26 ++ stdenv.lib.optional hostPlatform.isDarwin "--disable-nls";
27
28 nativeBuildInputs = [ gettext ]
29 # Need to regenerate configure script with newer version in order to pass
30 # "mr_cv_target_elf=yes", but `autoreconfHook` brings in `makeWrapper`
31 # which doesn't work with the bootstrapTools bash, so can only do this
32 # for cross builds when `stdenv.shell` is a newer bash.
33 ++ stdenv.lib.optional (hostPlatform != buildPlatform) autoreconfHook;
34
35 meta = {
36 description = "ELF object file access library";
37
38 homepage = http://www.mr511.de/software/english.html;
39
40 license = stdenv.lib.licenses.lgpl2Plus;
41
42 platforms = stdenv.lib.platforms.all;
43 maintainers = [ ];
44 };
45}