Christoph Reiter e40c90814f Makedepend on gcc/make where needed
This means we no longer need msys2-devel
2021-12-13 22:19:56 +01:00

87 lines
3.1 KiB
Bash

# Maintainer: Alexey Pavlov <alexpux@gmail.com>
pkgname=binutils
pkgver=2.37
pkgrel=4
pkgdesc="A set of programs to assemble and manipulate binary and object files"
arch=('i686' 'x86_64')
url="https://www.gnu.org/software/binutils/"
license=('GPL')
groups=('base-devel')
depends=('libiconv' 'libintl' 'zlib')
checkdepends=('dejagnu' 'bc')
makedepends=('libiconv-devel' 'gettext-devel' 'zlib-devel' 'autotools' 'gcc')
options=('staticlibs' '!distcc' '!ccache')
source=(https://ftp.gnu.org/gnu/binutils/binutils-${pkgver}.tar.xz{,.sig}
0050-bfd-Increase-_bfd_coff_max_nscns-to-65279.patch
0100-binutils-2.37-msys2.patch
2000-Temporarily-revert-default-dll-characteristics.patch
2002-Allow-spaces-in-the-name-of-the-external-preprocesso.patch
3000-more-base-entropy.patch)
sha256sums=('820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c'
'SKIP'
'4e8ac055df61b1b5d6ae29dc87e1154737c2e87c7b244b44866702cabf1a5d18'
'4c5b251beb036814992bc1b6538b5ff49259e073b7cc982e036c76050a866a51'
'29c1aab1eb96bc188c1ad29422f611e7c946cca901aed29ee2d0b9e861c75a23'
'57478b9971183d430c93701b1d533e3724dab5334bbf44db924777e4a93c1063'
'ce3cda1ad8ff8379869142226178b5f7fdb5b93f85a43d3437475ea0314dbf1b')
validpgpkeys=('EAF1C276A747E9ED86210CBAC3126D3B4AE55E93'
'3A24BC1E8FB409FA9F14371813FCEF89DD9E3C4F')
prepare() {
cd "${srcdir}"/binutils-${pkgver}
patch -p1 -i "${srcdir}"/0050-bfd-Increase-_bfd_coff_max_nscns-to-65279.patch
patch -p1 -i "${srcdir}"/0100-binutils-2.37-msys2.patch
# Until we get a response here: https://cygwin.com/pipermail/cygwin/2021-February/247922.html
patch -p1 -i "${srcdir}"/2000-Temporarily-revert-default-dll-characteristics.patch
# https://github.com/msys2/MSYS2-packages/issues/2379
patch -R -p1 -i "${srcdir}"/2002-Allow-spaces-in-the-name-of-the-external-preprocesso.patch
# https://github.com/msys2/MSYS2-packages/issues/2487
patch -p1 -i "${srcdir}"/3000-more-base-entropy.patch
# hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS"
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
mkdir "${srcdir}"/binutils-${CARCH}
}
build() {
cd "${srcdir}"/binutils-${CARCH}
../binutils-${pkgver}/configure \
--prefix=/usr \
--{build,host,target}=${CHOST} \
--disable-werror \
--disable-sim \
--enable-64-bit-bfd \
--enable-install-libiberty \
--without-libiconv-prefix \
--without-libintl-prefix
make
}
check() {
# cd "${srcdir}"/binutils-${CARCH}
# unset LDFLAGS as testsuite makes assumptions about which ones are active
# do not abort on errors - manually check log files
# make LDFLAGS="" -k check || true
return 0
}
package() {
cd "${srcdir}"/binutils-${CARCH}
make DESTDIR=${pkgdir} install
cp libiberty/libiberty.a ${pkgdir}/usr/lib
# Remove unwanted files
#rm ${pkgdir}/usr/share/info/{configure,standards}.info
# Add some useful headers
#install -m644 "${srcdir}"/binutils-${pkgver}/include/libiberty.h ${pkgdir}/usr/include
#install -m644 "${srcdir}"/binutils-${pkgver}/include/demangle.h ${pkgdir}/usr/include
}