2 , fetchurl, autoreconfHook, gettext
5 # Note: this package is used for bootstrapping fetchurl, and thus
6 # cannot use fetchpatch! All mutable patches (generated by GitHub or
7 # cgit) that are needed here should be included directly in Nixpkgs as
10 stdenv.mkDerivation rec {
11 name = "libelf-0.8.13";
14 url = "https://fossies.org/linux/misc/old/${name}.tar.gz";
15 sha256 = "0vf7s9dwk2xkmhb79aigqm0x0yfbw1j0b9ksm51207qwr179n6jr";
19 ./dont-hardcode-ar.patch
20 # Fix warnings from preprocessor instructions.
21 # https://github.com/NixOS/nixpkgs/issues/59929
22 ./preprocessor-warnings.patch
28 # Configure check for dynamic lib support is broken, see
29 # http://lists.uclibc.org/pipermail/uclibc-cvs/2005-August/019383.html
30 ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "mr_cv_target_elf=yes"
31 # Libelf's custom NLS macros fail to determine the catalog file extension
32 # on Darwin, so disable NLS for now.
33 ++ lib.optional stdenv.hostPlatform.isDarwin "--disable-nls";
35 nativeBuildInputs = [ gettext ]
36 # Need to regenerate configure script with newer version in order to pass
37 # "mr_cv_target_elf=yes", but `autoreconfHook` brings in `makeWrapper`
38 # which doesn't work with the bootstrapTools bash, so can only do this
39 # for cross builds when `stdenv.shell` is a newer bash.
40 ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) autoreconfHook;
43 description = "ELF object file access library";
45 homepage = "https://github.com/Distrotech/libelf";
47 license = lib.licenses.lgpl2Plus;
49 platforms = lib.platforms.all;