1 # Maintainer: David Runge <dvzrv@archlinux.org>
2 # Contributor: Laurent Carlier <lordheavym@gmail.com>
3 # Contributor: Stéphane Gaudreault <stephane@archlinux.org>
4 # Contributor: Andrej Gelenberg <andrej.gelenberg@udo.edu>
7 pkgname=(debuginfod elfutils libelf)
10 pkgdesc="Handle ELF object files and DWARF debugging information"
12 url="https://sourceware.org/elfutils/"
14 makedepends=(bzip2 curl gcc-libs libarchive libmicrohttpd sqlite xz zlib zstd)
16 source=("https://sourceware.org/${pkgbase}/ftp/${pkgver}/${pkgbase}-${pkgver}.tar.bz2"{,.sig})
17 sha512sums=('c9180b27ec62935f18b9431268d176f6023d1bb938731d2af6e7626ae460af6608a70ba68483aa1ec7e6cb0fa0528b661ca8b68bc4f58ea8e18af527c5950c78'
19 b2sums=('49573d0a1f3519eab81d1ba3e94354cbc0935a36a94a3fdb22fe223a47b78cca8fd6e322870b0e335a809529fa6f54180b13c67936dec0242123c54ba20c9fc9'
22 '47CC0331081B8BC6D0FD4DA08370665B57816A6A' # Mark J. Wielaard <mark@klomp.org>
23 'EC3CFE88F6CA0788774F5C1D1AA44BE649DE760A' # Mark Wielaard <mjw@gnu.org>
27 local p="$1" f d; shift
29 d="$srcdir/$p/${f#$pkgdir/}"
30 mkdir -p "$(dirname "$d")"
32 rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
42 cp -av "$pkgbase-$pkgver" "$pkgbase-test-$pkgver"
48 # fat-lto-objects is required for non-mangled .a files in libelf
49 CFLAGS+=" -ffat-lto-objects"
51 ./configure --prefix=/usr \
53 --program-prefix="eu-" \
54 --enable-deterministic-archives
58 cd "$pkgbase-test-$pkgver"
59 # debugging information is required for test-suite
61 # fat-lto-objects is required for non-mangled .a files in libelf
62 CFLAGS+=" -ffat-lto-objects"
63 ./configure --prefix=/usr \
65 --program-prefix="eu-" \
66 --enable-deterministic-archives
72 cd "$pkgbase-test-$pkgver"
73 make check || printf "Fails in restrictive build environments: https://gitlab.archlinux.org/archlinux/infrastructure/-/issues/424\n"
76 package_debuginfod() {
77 pkgdesc+=" (debuginfod)"
78 depends=(gcc-libs glibc libarchive.so "libelf=${pkgver}-${pkgrel}"
79 libmicrohttpd.so sqlite)
80 optdepends=("elfutils=${pkgver}-${pkgrel}: for translations")
82 make DESTDIR="$pkgdir" install -C "$pkgbase-$pkgver"
83 install -vDm 644 "$pkgbase-$pkgver/"{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "${pkgdir}/usr/share/doc/${pkgname}"
85 # set the default DEBUGINFOD_URLS environment variable to the distribution's debuginfod URL
86 printf "https://debuginfod.archlinux.org\n" > "$pkgdir/etc/debuginfod/archlinux.urls"
91 _pick libelf usr/{include,lib}
92 _pick elfutils usr/bin/eu-*
93 _pick elfutils usr/share/locale
94 _pick elfutils usr/share/man/man1/eu-*
95 _pick elfutils usr/share/man/man3/elf_*
101 pkgdesc+=" (utilities)"
102 depends=(gcc-libs glibc "libelf=${pkgver}-${pkgrel}")
104 mv -v elfutils/* "$pkgdir"
105 install -vDm 644 "$pkgbase-$pkgver"/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "${pkgdir}/usr/share/doc/${pkgname}"
109 pkgdesc+=" (libraries)"
110 depends=(gcc-libs libbz2.so libcurl.so xz zlib zstd)
111 # NOTE: the shared objects can not be added to provides as they are not versioned
113 mv -v libelf/* "$pkgdir"
114 install -vDm 644 "$pkgbase-$pkgver"/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "${pkgdir}/usr/share/doc/${pkgname}"