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=('93a877e34db93e5498581d0ab2d702b08c0d87e4cafd9cec9d6636dfa85a168095c305c11583a5b0fb79374dd93bc8d0e9ce6016e6c172764bcea12861605b71'
19 b2sums=('30596271e14cf3408326abc38a9775b849b8cb0ee119a5455df9434a7d3b9a57afb15e0236a179a26c7bd400d303749964c9d6350c419f747784fd99d12517e0'
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")"
37 # remove failing test due to missing glibc debug package during test: https://bugs.archlinux.org/task/74875
38 sed -e 's/run-backtrace-native.sh//g' -i $pkgbase-$pkgver/tests/Makefile.am
44 cp -av $pkgbase-$pkgver $pkgbase-test-$pkgver
49 local configure_options=(
52 --program-prefix="eu-"
53 --enable-deterministic-archives
57 # fat-lto-objects is required for non-mangled .a files in libelf
58 CFLAGS+=" -ffat-lto-objects"
60 ./configure "${configure_options[@]}"
64 cd $pkgbase-test-$pkgver
65 # debugging information is required for test-suite
67 # fat-lto-objects is required for non-mangled .a files in libelf
68 CFLAGS+=" -ffat-lto-objects"
69 ./configure "${configure_options[@]}"
75 make check -C $pkgbase-test-$pkgver
78 package_debuginfod() {
79 pkgdesc+=" (debuginfod)"
83 libarchive libarchive.so
85 libmicrohttpd libmicrohttpd.so
88 optdepends=("elfutils=$pkgver: for translations")
90 make DESTDIR="$pkgdir" install -C $pkgbase-$pkgver
91 install -vDm 644 $pkgbase-$pkgver/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "$pkgdir/usr/share/doc/$pkgname/"
93 # set the default DEBUGINFOD_URLS environment variable to the distribution's debuginfod URL
94 printf "https://debuginfod.archlinux.org\n" > "$pkgdir/etc/debuginfod/archlinux.urls"
99 _pick libelf etc/debuginfod/*
100 _pick libelf etc/profile.d/*
101 _pick libelf usr/{include,lib}
102 _pick elfutils usr/bin/eu-*
103 _pick elfutils usr/share/locale
104 _pick elfutils usr/share/man/man1/eu-*
105 _pick elfutils usr/share/man/man3/elf_*
111 pkgdesc+=" (utilities)"
112 depends=(gcc-libs glibc libelf=$pkgver)
114 mv -v elfutils/* "$pkgdir"
115 install -vDm 644 $pkgbase-$pkgver/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "$pkgdir/usr/share/doc/$pkgname/"
119 pkgdesc+=" (libraries)"
129 # NOTE: the shared objects can not be added to provides as they are not versioned
131 mv -v libelf/* "$pkgdir"
132 install -vDm 644 $pkgbase-$pkgver/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "$pkgdir/usr/share/doc/$pkgname/"