11 stdenv.mkDerivation rec {
16 url = "https://fossies.org/linux/misc/old/${pname}-${version}.tar.gz";
17 sha256 = "0vf7s9dwk2xkmhb79aigqm0x0yfbw1j0b9ksm51207qwr179n6jr";
21 ./dont-hardcode-ar.patch
22 # Fix warnings from preprocessor instructions.
23 # https://github.com/NixOS/nixpkgs/issues/59929
24 ./preprocessor-warnings.patch
25 # `configure` defines a test `main` with an implicit `int` return, which clang 16 disallows.
26 ./fix-configure-main.patch
29 enableParallelBuilding = true;
31 # mkdir ...-libelf-0.8.13/lib
32 # mkdir ...-libelf-0.8.13/lib
33 # mkdir: cannot create directory '...-libelf-0.8.13/lib': File exists
34 enableParallelInstalling = false;
39 if !stdenv.hostPlatform.useAndroidPrebuilt then
43 sed -i 's|DISTSUBDIRS = lib po|DISTSUBDIRS = lib|g' Makefile.in
44 sed -i 's|SUBDIRS = lib @POSUB@|SUBDIRS = lib|g' Makefile.in
49 # Configure check for dynamic lib support is broken, see
50 # http://lists.uclibc.org/pipermail/uclibc-cvs/2005-August/019383.html
51 ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "mr_cv_target_elf=yes"
52 # Libelf's custom NLS macros fail to determine the catalog file extension
53 # on Darwin, so disable NLS for now.
54 ++ lib.optional stdenv.hostPlatform.isDarwin "--disable-nls";
59 if stdenv.hostPlatform.isFreeBSD then
61 else if stdenv.hostPlatform.isNetBSD then
66 # The provided `configure` script fails on clang 16 because some tests have a `main`
67 # returning an implicit `int`, which clang 16 treats as an error. Running `autoreconf` fixes
68 # the test and allows `configure` to detect clang properly.
69 ++ [ autoreconfHook ];
72 description = "ELF object file access library";
74 homepage = "https://github.com/Distrotech/libelf";
76 license = lib.licenses.lgpl2Plus;
78 platforms = lib.platforms.all;