jobcore/elfutils/PKGBUILD

154 lines
4.5 KiB
Bash

#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgbase=elfutils
pkgname=(debuginfod elfutils libelf)
pkgver=0.189
pkgrel=02
pkgdesc="Handle ELF object files and DWARF debugging information"
url="https://sourceware.org/elfutils/"
makedepends=(bzip2 curl gcc-libs libarchive libmicrohttpd sqlite xz zlib zstd)
#options=(debug staticlibs)
options=(staticlibs)
source=(https://sourceware.org/$pkgbase/ftp/$pkgver/$pkgbase-$pkgver.tar.bz2{,.sig})
_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
# # Use CURLOPT_PROTOCOLS_STR for libcurl >= 7.85.0
# # https://sourceware.org/git/?p=elfutils.git;a=commit;h=6560fb26a62ef135a804357ef4f15a47de3e49b3
# patch -Np1 < ../curl_7.85_compat.patch
# cd ..
# remove failing test due to missing glibc debug package during test: https://bugs.archlinux.org/task/74875
sed -e 's/run-backtrace-native.sh//g' -i $pkgbase-$pkgver/tests/Makefile.am
(
cd $pkgbase-$pkgver
autoreconf -fiv
)
cp -av $pkgbase-$pkgver $pkgbase-test-$pkgver
}
build() {
local configure_options=(
--prefix=/usr
--sysconfdir=/etc
--program-prefix="eu-"
--enable-deterministic-archives
)
(
# fat-lto-objects is required for non-mangled .a files in libelf
CFLAGS+=" -ffat-lto-objects"
cd $pkgbase-$pkgver
./configure "${configure_options[@]}"
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 "${configure_options[@]}"
make
)
}
## a few tests fail on this 0188 build, they didn't on last 0186 but do try them on your
## machine and environment and report if your build didn't fail, otherwise we will try again on next build
#
#check() {
# make check -C $pkgbase-test-$pkgver
#}
package_debuginfod() {
pkgdesc+=" (debuginfod)"
depends=(
gcc-libs
glibc
libarchive libarchive.so
libelf=$pkgver
libmicrohttpd libmicrohttpd.so
sqlite libsqlite3.so
)
optdepends=("elfutils=$pkgver: 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 etc/debuginfod/*
_pick libelf etc/profile.d/*
_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)
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=(
bzip2 libbz2.so
curl libcurl.so
gcc-libs
glibc
xz
zlib
zstd libzstd.so
)
# 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/"
}
#---- arch license gpg-key & sha256sums ----
arch=(x86_64)
license=(LGPL3 GPL3)
validpgpkeys=(47CC0331081B8BC6D0FD4DA08370665B57816A6A # Mark J. Wielaard <mark@klomp.org>
EC3CFE88F6CA0788774F5C1D1AA44BE649DE760A) # Mark Wielaard <mjw@gnu.org>
sha256sums=(39bd8f1a338e2b7cd4abc3ff11a0eddc6e690f69578a57478d8179b4148708c8 # elfutils-0.189.tar.bz2
692a90a6a91dc1b76ab82828c8b7927c8d0f60f82b82da425fa7c258f9f2b570) # elfutils-0.189.tar.bz2.sig
## 97531155c6b0ec46a319b0045d7aae2ce0c5f063c433ec00639e947a1c973f0d debuginfod-0.189-02-x86_64.pkg.tar.lz
## c990b84ba56a93c39f3d924c1d2bbd73777301b661ea07bd171f27d98fb10701 elfutils-0.189-02-x86_64.pkg.tar.lz
## dfd15f709a6a040963f85989abb8be39d8769548b9be216d6e5d10f7554a892e libelf-0.189-02-x86_64.pkg.tar.lz