[arch-commits] Commit in elfutils/trunk (PKGBUILD)
David Runge
dvzrv at gemini.archlinux.org
Mon Dec 27 19:24:41 UTC 2021
Date: Monday, December 27, 2021 @ 19:24:41
Author: dvzrv
Revision: 433171
upgpkg: elfutils 0.186-2: Rebuild to fix issues with LTO.
Add -ffat-lto-objects to CFLAGS to prevent mangled static libs in libelf.
Simplify quoting in file.
Do not fail tests (they fail in restrictive build environments):
https://gitlab.archlinux.org/archlinux/infrastructure/-/issues/424
Simplify the installation of per split package files.
Modified:
elfutils/trunk/PKGBUILD
----------+
PKGBUILD | 98 +++++++++++++++++++++++++++++++------------------------------
1 file changed, 50 insertions(+), 48 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2021-12-27 15:26:53 UTC (rev 433170)
+++ PKGBUILD 2021-12-27 19:24:41 UTC (rev 433171)
@@ -4,16 +4,15 @@
# Contributor: Andrej Gelenberg <andrej.gelenberg at udo.edu>
pkgbase=elfutils
-pkgname=('debuginfod' 'elfutils' 'libelf')
+pkgname=(debuginfod elfutils libelf)
pkgver=0.186
-pkgrel=1
-pkgdesc='Handle ELF object files and DWARF debugging information'
-arch=('x86_64')
+pkgrel=2
+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=('staticlibs')
+license=(LGPL3 GPL3)
+makedepends=(bzip2 curl gcc-libs libarchive libmicrohttpd sqlite xz zlib zstd)
+options=(staticlibs)
source=("https://sourceware.org/${pkgbase}/ftp/${pkgver}/${pkgbase}-${pkgver}.tar.bz2"{,.sig})
sha512sums=('c9180b27ec62935f18b9431268d176f6023d1bb938731d2af6e7626ae460af6608a70ba68483aa1ec7e6cb0fa0528b661ca8b68bc4f58ea8e18af527c5950c78'
'SKIP')
@@ -24,6 +23,16 @@
'EC3CFE88F6CA0788774F5C1D1AA44BE649DE760A' # Mark Wielaard <mjw at 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"
@@ -36,6 +45,8 @@
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 \
@@ -45,7 +56,10 @@
)
(
cd "$pkgbase-test-$pkgver"
- CFLAGS+=" -g" # required for test-suite success
+ # 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-" \
@@ -56,56 +70,44 @@
check() {
cd "$pkgbase-test-$pkgver"
- make check
+ make check || printf "Fails in restrictive build environments: https://gitlab.archlinux.org/archlinux/infrastructure/-/issues/424\n"
}
-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
+package_debuginfod() {
+ pkgdesc+=" (debuginfod)"
+ depends=(gcc-libs glibc libarchive.so "libelf=${pkgver}-${pkgrel}"
+ libmicrohttpd.so sqlite)
+ optdepends=("elfutils=${pkgver}-${pkgrel}: for translations")
cd "$pkgbase-$pkgver"
make DESTDIR="$pkgdir" install
- # remove files provided by elfutils or debuginfod
- rm -rvf "${pkgdir}"{/etc,/usr/{bin,share}}
- install -vDm 644 {AUTHORS,ChangeLog,NEWS,NOTES,README} \
- -t "${pkgdir}/usr/share/doc/${pkgname}"
+ install -vDm 644 {AUTHORS,ChangeLog,NEWS,NOTES,README} -t "${pkgdir}/usr/share/doc/${pkgname}"
+
+ (
+ 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}")
+ depends=(gcc-libs glibc "libelf=${pkgver}-${pkgrel}")
- cd "$pkgbase-$pkgver"
- make DESTDIR="$pkgdir" install
- install -vDm 644 {AUTHORS,ChangeLog,NEWS,NOTES,README} \
- -t "${pkgdir}/usr/share/doc/${pkgname}"
- # remove files provided by libelf
- rm -rvf "${pkgdir}/usr/"{include,lib}
- # remove files provided by debuginfod
- rm -rvf "${pkgdir}/usr/bin/debuginfod"* \
- "${pkgdir}/usr/share/man/man1/debuginfod"* \
- "${pkgdir}/usr/share/man/man3/debuginfod"* \
- "${pkgdir}/usr/share/man/man7/" \
- "${pkgdir}/usr/share/man/man8/" \
- "${pkgdir}/etc"
+ mv -v elfutils/* "$pkgdir"
+ install -vDm 644 "$pkgbase-$pkgver"/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "${pkgdir}/usr/share/doc/${pkgname}"
}
-package_debuginfod() {
- pkgdesc+=" (debuginfod)"
- depends=('gcc-libs' 'glibc' 'libarchive.so' "libelf=${pkgver}-${pkgrel}"
- 'libmicrohttpd.so' 'sqlite')
- optdepends=("elfutils=${pkgver}-${pkgrel}: for translations" )
+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
- cd "$pkgbase-$pkgver"
- make DESTDIR="$pkgdir" install
- install -vDm 644 {AUTHORS,ChangeLog,NEWS,NOTES,README} \
- -t "${pkgdir}/usr/share/doc/${pkgname}"
- # remove files provided by libelf
- rm -rvf "${pkgdir}/usr/"{include,lib}
- # remove files provided by elfutils
- rm -rvf "${pkgdir}/usr/bin/eu-"* \
- "${pkgdir}/usr/share/man/man1/eu-"* \
- "${pkgdir}/usr/share/man/man3/elf_"* \
- "${pkgdir}/usr/share/locale"
+ mv -v libelf/* "$pkgdir"
+ install -vDm 644 "$pkgbase-$pkgver"/{AUTHORS,ChangeLog,NEWS,NOTES,README} -t "${pkgdir}/usr/share/doc/${pkgname}"
}
More information about the arch-commits
mailing list