pkgname=(elfutils libelf debuginfod) pkgbase=elfutils pkgver=0.192 pkgrel=2 pkgdesc="Handle ELF object files and DWARF debugging information" arch=('x86_64') url="https://sourceware.org/elfutils/" license=('GPL-2.0-or-later OR LGPL-3.0-or-later') makedepends=( 'bzip2' 'curl' 'gcc-libs' 'json-c' 'libarchive' 'sqlite' 'xz' 'zlib' 'zstd' ) source=(https://sourceware.org/elfutils/ftp/${pkgver}/${pkgbase}-${pkgver}.tar.bz2) sha256sums=(616099beae24aba11f9b63d86ca6cc8d566d968b802391334c91df54eab416b4) build() { cd ${pkgbase}-${pkgver} # fat-lto-objects is required for non-mangled .a files in libelf CFLAGS+=" -ffat-lto-objects" CFLAGS+=" -g" local configure_args=( --sysconfdir=/etc --program-prefix="eu-" --enable-deterministic-archives --enable-maintainer-mode ${configure_options} ) ./configure ${configure_args[@]} make } package_elfutils() { pkgdesc+=" (utilities)" license=('GPL-3.0-or-later') depends=('gcc-libs' 'glibc' 'libarchive' "libelf=${pkgver}" 'bash') cd ${pkgbase}-${pkgver} make DESTDIR=${pkgdir} install _pick libelf ${pkgdir}/usr/{include,lib64} _pick libelf ${pkgdir}/usr/share/man/*/{,lib}elf* _pick debuginfod ${pkgdir}/etc/debuginfod _pick debuginfod ${pkgdir}/etc/profile.d/* _pick debuginfod ${pkgdir}/usr/bin/debuginfod* _pick debuginfod ${pkgdir}/usr/share/fish/vendor_conf.d/debuginfod.fish _pick debuginfod ${pkgdir}/usr/share/man/*/debuginfod* } package_libelf() { pkgdesc+=" (libraries)" license=('GPL-2.0-or-later OR LGPL-3.0-or-later') depends=('bzip2' 'curl' 'glibc' 'json-c' 'xz' 'zlib' 'zstd') mv -v ${pkgname}/* ${pkgdir} } package_debuginfod() { pkgdesc+=" (debuginfod)" license=('GPL-3.0-or-later') depends=('gcc-libs' 'glibc' 'json-c' 'libarchive' "libelf=${pkgver}" 'sqlite' 'xz') mv -v ${pkgname}/* ${pkgdir} }