nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv
2, fetchurl, autoreconfHook, gettext, netbsd
3}:
4
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
8# files.
9
10stdenv.mkDerivation rec {
11 pname = "libelf";
12 version = "0.8.13";
13
14 src = fetchurl {
15 url = "https://fossies.org/linux/misc/old/${pname}-${version}.tar.gz";
16 sha256 = "0vf7s9dwk2xkmhb79aigqm0x0yfbw1j0b9ksm51207qwr179n6jr";
17 };
18
19 patches = [
20 ./dont-hardcode-ar.patch
21 # Fix warnings from preprocessor instructions.
22 # https://github.com/NixOS/nixpkgs/issues/59929
23 ./preprocessor-warnings.patch
24 ];
25
26 doCheck = true;
27
28 configureFlags = []
29 # Configure check for dynamic lib support is broken, see
30 # http://lists.uclibc.org/pipermail/uclibc-cvs/2005-August/019383.html
31 ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "mr_cv_target_elf=yes"
32 # Libelf's custom NLS macros fail to determine the catalog file extension
33 # on Darwin, so disable NLS for now.
34 ++ lib.optional stdenv.hostPlatform.isDarwin "--disable-nls";
35
36 nativeBuildInputs =
37 if stdenv.hostPlatform.isNetBSD then [ netbsd.gencat ] else [ gettext ]
38 # Need to regenerate configure script with newer version in order to pass
39 # "mr_cv_target_elf=yes", but `autoreconfHook` brings in `makeWrapper`
40 # which doesn't work with the bootstrapTools bash, so can only do this
41 # for cross builds when `stdenv.shell` is a newer bash.
42 ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) autoreconfHook;
43
44 meta = {
45 description = "ELF object file access library";
46
47 homepage = "https://github.com/Distrotech/libelf";
48
49 license = lib.licenses.lgpl2Plus;
50
51 platforms = lib.platforms.all;
52 maintainers = [ ];
53 };
54}