pkgname=binutils pkgver=2.43.1 pkgrel=1 pkgdesc="A set of programs to assemble and manipulate binary and object files" arch=('x86_64') url="https://www.gnu.org/software/binutils/" license=('GPL-2.0-or-later' 'GPL-3.0-or-later' 'LGPL-2.0-or-later' 'LGPL-3.0-or-later' 'GFDL-1.3' 'FSFAP') groups=('base-devel') depends=('glibc' 'jansson' 'libelf' 'zlib' 'zstd') backup=(etc/gprofng.rc) options=('!distcc' '!ccache') source=(https://sourceware.org/pub/${pkgname}/releases/${pkgname}-${pkgver}.tar.xz https://www.linuxfromscratch.org/patches/downloads/${pkgname}/${pkgname}-${pkgver}-upstream_fix-1.patch) sha256sums=(13f74202a3c4c51118b797a39ea4200d3f6cfbe224da6d1d95bb938480132dfd 3fc7d9a8fdb154300793ee2c0f41d0959a62caa2803ebaf1f5963d67a2eb4273) prepare() { cd ${pkgname}-${pkgver} patch -Np1 -i ${srcdir}/${pkgname}-${pkgver}-upstream_fix-1.patch mkdir -v build } build() { cd ${pkgname}-${pkgver}/build local configure_args=( --sysconfdir=/etc --enable-gold --enable-ld=default --enable-plugins --enable-shared --disable-werror --enable-64-bit-bfd --enable-new-dtags --with-system-zlib --enable-default-hash-style=gnu --enable-multilib --enable-jansson --enable-cet --target=${CHOST} ${configure_options} ) ../configure ${configure_args[@]} make tooldir=/usr } package() { cd ${pkgname}-${pkgver}/build make DESTDIR=${pkgdir} tooldir=/usr install ln -sv strip ${pkgdir}/usr/bin/${CHOST}-strip ln -sv ld ${pkgdir}/usr/bin/${CHOST}-ld }