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)
15 options=(debug staticlibs)
16 source=(https://sourceware.org/$pkgbase/ftp/$pkgver/$pkgbase-$pkgver.tar.bz2{,.sig})
17 sha512sums=('a9b9e32b503b8b50a62d4e4001097ed2721d3475232a6380e6b9853bd1647aec016440c0ca7ceb950daf1144f8db9814ab43cf33cc0ebef7fc91e9e775c9e874'
19 b2sums=('00ba3efa689d137808f5f53ecda93fd006be0c18d690ce76616ed1dba442281098579fa4b9a9e91b8ba865a3de15968f0ae06703a7b50b15c48a4beb5c970a46'
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 make check -C $pkgbase-test-$pkgver
75 package_debuginfod() {
76 pkgdesc+=" (debuginfod)"
77 depends=(gcc-libs glibc libarchive.so libelf=$pkgver libmicrohttpd.so sqlite)
78 optdepends=("elfutils=$pkgver: for translations")
80 make DESTDIR="$pkgdir" install -C $pkgbase-$pkgver
81 install -vDm 644 $pkgbase-$pkgver/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "$pkgdir/usr/share/doc/$pkgname/"
83 # set the default DEBUGINFOD_URLS environment variable to the distribution's debuginfod URL
84 printf "https://debuginfod.archlinux.org\n" > "$pkgdir/etc/debuginfod/archlinux.urls"
89 _pick libelf usr/{include,lib}
90 _pick elfutils usr/bin/eu-*
91 _pick elfutils usr/share/locale
92 _pick elfutils usr/share/man/man1/eu-*
93 _pick elfutils usr/share/man/man3/elf_*
99 pkgdesc+=" (utilities)"
100 depends=(gcc-libs glibc libelf=$pkgver)
102 mv -v elfutils/* "$pkgdir"
103 install -vDm 644 $pkgbase-$pkgver/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "$pkgdir/usr/share/doc/$pkgname/"
107 pkgdesc+=" (libraries)"
108 depends=(gcc-libs libbz2.so libcurl.so xz zlib zstd)
109 # NOTE: the shared objects can not be added to provides as they are not versioned
111 mv -v libelf/* "$pkgdir"
112 install -vDm 644 $pkgbase-$pkgver/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "$pkgdir/usr/share/doc/$pkgname/"