archrelease: copy trunk to extra-x86_64
[arch-packages.git] / elfutils / trunk / PKGBUILD
blob1f0d93222c41cad940cf38293e6a5e4d06bdb564
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>
6 pkgbase=elfutils
7 pkgname=(debuginfod elfutils libelf)
8 pkgver=0.186
9 pkgrel=3
10 pkgdesc="Handle ELF object files and DWARF debugging information"
11 arch=(x86_64)
12 url="https://sourceware.org/elfutils/"
13 license=(LGPL3 GPL3)
14 makedepends=(bzip2 curl gcc-libs libarchive libmicrohttpd sqlite xz zlib zstd)
15 options=(staticlibs)
16 source=("https://sourceware.org/${pkgbase}/ftp/${pkgver}/${pkgbase}-${pkgver}.tar.bz2"{,.sig})
17 sha512sums=('c9180b27ec62935f18b9431268d176f6023d1bb938731d2af6e7626ae460af6608a70ba68483aa1ec7e6cb0fa0528b661ca8b68bc4f58ea8e18af527c5950c78'
18             'SKIP')
19 b2sums=('49573d0a1f3519eab81d1ba3e94354cbc0935a36a94a3fdb22fe223a47b78cca8fd6e322870b0e335a809529fa6f54180b13c67936dec0242123c54ba20c9fc9'
20         'SKIP')
21 validpgpkeys=(
22   '47CC0331081B8BC6D0FD4DA08370665B57816A6A'  # Mark J. Wielaard <mark@klomp.org>
23   'EC3CFE88F6CA0788774F5C1D1AA44BE649DE760A'  # Mark Wielaard <mjw@gnu.org>
26 _pick() {
27   local p="$1" f d; shift
28   for f; do
29     d="$srcdir/$p/${f#$pkgdir/}"
30     mkdir -p "$(dirname "$d")"
31     mv "$f" "$d"
32     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
33   done
36 prepare() {
37   (
38   cd "$pkgbase-$pkgver"
39   autoreconf -fiv
40   )
42   cp -av "$pkgbase-$pkgver" "$pkgbase-test-$pkgver"
46 build() {
47   (
48   # fat-lto-objects is required for non-mangled .a files in libelf
49   CFLAGS+=" -ffat-lto-objects"
50   cd "$pkgbase-$pkgver"
51   ./configure --prefix=/usr \
52               --sysconfdir=/etc \
53               --program-prefix="eu-" \
54               --enable-deterministic-archives
55   make
56   )
57   (
58   cd "$pkgbase-test-$pkgver"
59   # debugging information is required for test-suite
60   CFLAGS+=" -g"
61   # fat-lto-objects is required for non-mangled .a files in libelf
62   CFLAGS+=" -ffat-lto-objects"
63   ./configure --prefix=/usr \
64               --sysconfdir=/etc \
65               --program-prefix="eu-" \
66               --enable-deterministic-archives
67   make
68   )
71 check() {
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"
88   (
89     cd "${pkgdir}"
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_*
96   )
100 package_elfutils() {
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}"
108 package_libelf() {
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}"