jobcore/elfutils/PKGBUILD-arch
2022-03-20 14:19:37 +02:00

115 lines
3.6 KiB
Text

# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Laurent Carlier <lordheavym@gmail.com>
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Andrej Gelenberg <andrej.gelenberg@udo.edu>
pkgbase=elfutils
pkgname=(debuginfod elfutils libelf)
pkgver=0.186
pkgrel=5
pkgdesc="Handle ELF object files and DWARF debugging information"
arch=(x86_64)
url="https://sourceware.org/elfutils/"
license=(LGPL3 GPL3)
makedepends=(bzip2 curl gcc-libs libarchive libmicrohttpd sqlite xz zlib zstd)
options=(debug staticlibs)
source=("https://sourceware.org/${pkgbase}/ftp/${pkgver}/${pkgbase}-${pkgver}.tar.bz2"{,.sig})
sha512sums=('c9180b27ec62935f18b9431268d176f6023d1bb938731d2af6e7626ae460af6608a70ba68483aa1ec7e6cb0fa0528b661ca8b68bc4f58ea8e18af527c5950c78'
'SKIP')
b2sums=('49573d0a1f3519eab81d1ba3e94354cbc0935a36a94a3fdb22fe223a47b78cca8fd6e322870b0e335a809529fa6f54180b13c67936dec0242123c54ba20c9fc9'
'SKIP')
validpgpkeys=(
'47CC0331081B8BC6D0FD4DA08370665B57816A6A' # Mark J. Wielaard <mark@klomp.org>
'EC3CFE88F6CA0788774F5C1D1AA44BE649DE760A' # Mark Wielaard <mjw@gnu.org>
)
_pick() {
local p="$1" f d; shift
for f; do
d="$srcdir/$p/${f#$pkgdir/}"
mkdir -p "$(dirname "$d")"
mv "$f" "$d"
rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
done
}
prepare() {
(
cd "$pkgbase-$pkgver"
autoreconf -fiv
)
cp -av "$pkgbase-$pkgver" "$pkgbase-test-$pkgver"
}
build() {
(
# fat-lto-objects is required for non-mangled .a files in libelf
CFLAGS+=" -ffat-lto-objects"
cd "$pkgbase-$pkgver"
./configure --prefix=/usr \
--sysconfdir=/etc \
--program-prefix="eu-" \
--enable-deterministic-archives
make
)
(
cd "$pkgbase-test-$pkgver"
# debugging information is required for test-suite
CFLAGS+=" -g"
# fat-lto-objects is required for non-mangled .a files in libelf
CFLAGS+=" -ffat-lto-objects"
./configure --prefix=/usr \
--sysconfdir=/etc \
--program-prefix="eu-" \
--enable-deterministic-archives
make
)
}
check() {
cd "$pkgbase-test-$pkgver"
make check || printf "Fails in restrictive build environments: https://gitlab.archlinux.org/archlinux/infrastructure/-/issues/424\n"
}
package_debuginfod() {
pkgdesc+=" (debuginfod)"
depends=(gcc-libs glibc libarchive.so "libelf=${pkgver}-${pkgrel}"
libmicrohttpd.so sqlite)
optdepends=("elfutils=${pkgver}-${pkgrel}: for translations")
make DESTDIR="$pkgdir" install -C "$pkgbase-$pkgver"
install -vDm 644 "$pkgbase-$pkgver/"{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "${pkgdir}/usr/share/doc/${pkgname}"
# set the default DEBUGINFOD_URLS environment variable to the distribution's debuginfod URL
printf "https://debuginfod.archlinux.org\n" > "$pkgdir/etc/debuginfod/archlinux.urls"
(
cd "${pkgdir}"
_pick libelf usr/{include,lib}
_pick elfutils usr/bin/eu-*
_pick elfutils usr/share/locale
_pick elfutils usr/share/man/man1/eu-*
_pick elfutils usr/share/man/man3/elf_*
)
}
package_elfutils() {
pkgdesc+=" (utilities)"
depends=(gcc-libs glibc "libelf=${pkgver}-${pkgrel}")
mv -v elfutils/* "$pkgdir"
install -vDm 644 "$pkgbase-$pkgver"/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "${pkgdir}/usr/share/doc/${pkgname}"
}
package_libelf() {
pkgdesc+=" (libraries)"
depends=(gcc-libs libbz2.so libcurl.so xz zlib zstd)
# NOTE: the shared objects can not be added to provides as they are not versioned
mv -v libelf/* "$pkgdir"
install -vDm 644 "$pkgbase-$pkgver"/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "${pkgdir}/usr/share/doc/${pkgname}"
}