PKGBUILDs/core/elfutils/PKGBUILD

161 lines
3.8 KiB
Bash
Raw Normal View History

2023-03-02 13:29:04 +00:00
# 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>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - remove default debuginfod url pointing to upstream
pkgbase=elfutils
2023-11-09 00:34:34 +00:00
pkgname=(
elfutils
libelf
2024-03-03 22:16:23 +00:00
debuginfod
2023-11-09 00:34:34 +00:00
)
2024-10-22 18:10:14 +00:00
pkgver=0.192
2024-11-04 14:06:17 +00:00
pkgrel=2
2023-03-02 13:29:04 +00:00
pkgdesc="Handle ELF object files and DWARF debugging information"
arch=(x86_64)
url="https://sourceware.org/elfutils/"
2024-11-04 14:06:17 +00:00
_url=https://sourceware.org/git/elfutils.git
2023-11-09 00:34:34 +00:00
makedepends=(
bzip2
curl
gcc-libs
2024-11-04 14:06:17 +00:00
git
2024-10-22 18:10:14 +00:00
json-c
2023-11-09 00:34:34 +00:00
libarchive
libmicrohttpd
sqlite
xz
zlib
zstd
)
2023-03-02 13:29:04 +00:00
options=(staticlibs)
2024-11-04 14:06:17 +00:00
source=(git+$_url?signed#tag=$pkgbase-$pkgver)
sha512sums=('ac5f968fc855bd1a504d8b0c676601d9ec7095efe85bb6e2d29980dee9399a921d707a93c16667f979649a166cc3c86e5192898318c5b572f9bf4d3e7229f754')
b2sums=('fdd1d3857ea5061562e91f17e08ebc1b556fb092fd5e32040b9176b7799583d716b31ef5c2652b4ddcd71ec46fa7ddd852e253f9f4f2a21c5e0425f77a3e8310')
2023-03-02 13:29:04 +00:00
validpgpkeys=(
'EC3CFE88F6CA0788774F5C1D1AA44BE649DE760A' # Mark Wielaard <mjw@gnu.org>
2024-03-03 22:16:23 +00:00
'6C2B631563B8D330578D3CB474FD3FA2779E7073' # Aaron Merey <amerey@redhat.com>
2023-03-02 13:29:04 +00:00
)
prepare() {
2024-11-04 14:06:17 +00:00
cd $pkgbase
# fix issue with /etc/profile.d/debuginfod.sh for zsh:
# https://gitlab.archlinux.org/archlinux/packaging/packages/elfutils/-/issues/2
git cherry-pick -n 00cb3efe36337f27925dbff9b2e7d97c7df95bf8
2023-03-02 13:29:04 +00:00
# remove failing test due to missing glibc debug package during test: https://bugs.archlinux.org/task/74875
2024-11-04 14:06:17 +00:00
sed -e 's/run-backtrace-native.sh//g' -i tests/Makefile.am
2023-03-02 13:29:04 +00:00
2024-03-03 22:16:23 +00:00
autoreconf -fiv
2023-03-02 13:29:04 +00:00
}
build() {
local configure_options=(
--prefix=/usr
--sysconfdir=/etc
--program-prefix="eu-"
--enable-deterministic-archives
2024-11-04 14:06:17 +00:00
--enable-maintainer-mode
2023-03-02 13:29:04 +00:00
)
2024-03-03 22:16:23 +00:00
# fat-lto-objects is required for non-mangled .a files in libelf
CFLAGS+=" -ffat-lto-objects"
# debugging information is required for test-suite
CFLAGS+=" -g"
2024-11-04 14:06:17 +00:00
cd $pkgbase
2024-03-03 22:16:23 +00:00
./configure "${configure_options[@]}"
make
2023-03-02 13:29:04 +00:00
}
check() {
2024-11-04 14:06:17 +00:00
make -C $pkgbase check
2023-03-02 13:29:04 +00:00
}
2024-03-03 22:16:23 +00:00
_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
}
package_elfutils() {
pkgdesc+=" (utilities)"
2023-11-09 00:34:34 +00:00
license=(
GPL-3.0-or-later
)
2023-03-02 13:29:04 +00:00
depends=(
gcc-libs
glibc
libarchive libarchive.so
libelf=$pkgver
2024-03-03 22:16:23 +00:00
sh
2023-03-02 13:29:04 +00:00
)
2024-11-04 14:06:17 +00:00
make DESTDIR="$pkgdir" install -C $pkgbase
2023-03-02 13:29:04 +00:00
(
cd "$pkgdir"
2024-03-03 22:16:23 +00:00
_pick libelf etc/debuginfod
2023-03-02 13:29:04 +00:00
_pick libelf etc/profile.d/*
_pick libelf usr/{include,lib}
2024-10-22 18:10:14 +00:00
_pick libelf usr/share/man/*/{,lib}elf*
2024-03-03 22:16:23 +00:00
_pick debuginfod usr/bin/debuginfod*
2024-10-22 18:10:14 +00:00
_pick debuginfod usr/share/fish/vendor_conf.d/debuginfod.fish
2024-03-03 22:16:23 +00:00
_pick debuginfod usr/share/man/*/debuginfod*
2023-03-02 13:29:04 +00:00
)
2024-11-04 14:06:17 +00:00
install -vDm 644 $pkgbase/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "$pkgdir/usr/share/doc/$pkgname/"
2023-03-02 13:29:04 +00:00
}
package_libelf() {
pkgdesc+=" (libraries)"
2023-11-09 00:34:34 +00:00
license=(
'GPL-2.0-or-later OR LGPL-3.0-or-later'
)
2023-03-02 13:29:04 +00:00
depends=(
bzip2 libbz2.so
curl libcurl.so
glibc
2024-10-22 18:10:14 +00:00
json-c
2023-03-02 13:29:04 +00:00
xz liblzma.so
zlib
zstd libzstd.so
)
# NOTE: the shared objects can not be added to provides as they are not versioned
2024-10-22 18:10:14 +00:00
mv -v $pkgname/* "$pkgdir"
2024-11-04 14:06:17 +00:00
install -vDm 644 $pkgbase/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "$pkgdir/usr/share/doc/$pkgname/"
2023-03-02 13:29:04 +00:00
}
2024-03-03 22:16:23 +00:00
package_debuginfod() {
pkgdesc+=" (debuginfod)"
license=(
GPL-3.0-or-later
)
depends=(
gcc-libs
glibc
2024-10-22 18:10:14 +00:00
json-c
2024-03-03 22:16:23 +00:00
libarchive libarchive.so
libelf=$pkgver
libmicrohttpd libmicrohttpd.so
sqlite libsqlite3.so
2024-10-22 18:10:14 +00:00
xz liblzma.so
2024-03-03 22:16:23 +00:00
)
optdepends=("elfutils=$pkgver: for translations")
2024-10-22 18:10:14 +00:00
mv -v $pkgname/* "$pkgdir"
2024-11-04 14:06:17 +00:00
install -vDm 644 $pkgbase/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "$pkgdir/usr/share/doc/$pkgname/"
2024-03-03 22:16:23 +00:00
}
# vim:set sw=2 sts=-1 et: