pkg-mingw-w64-binutils/PKGBUILD
2024-09-20 18:19:35 +08:00

67 lines
1.7 KiB
Bash

# Maintainer: Felix Yan <felixonmars@archlinux.org>
pkgname=mingw-w64-binutils
pkgver=2.43.1
pkgrel=1
pkgdesc="Cross binutils for the MinGW-w64 cross-compiler"
arch=('x86_64' 'aarch64')
url="http://www.gnu.org/software/binutils"
license=('GPL')
groups=('mingw-w64-toolchain' 'mingw-w64')
makedepends=('git')
depends=('zlib')
options=('!libtool' '!emptydirs')
provides=('mingw-w64-gdb')
conflicts=('mingw-w64-gdb')
source=(git+https://gitea.classfun.cn:4443/mirrors/binutils-gdb.git)
sha512sums=('SKIP')
_targets="i686-w64-mingw32 x86_64-w64-mingw32 aarch64-w64-mingw32"
get_latest() {
cd "$srcdir/binutils-gdb"
git tag | grep -E '^binutils-[0-9]+_[0-9]+(_[0-9]+)*$' | sort --version-sort | tail -n1
}
pkgver() {
get_latest | sed 's,^binutils-,,;s,_,.,g'
}
prepare() {
cd "$srcdir/binutils-gdb"
git checkout "$(get_latest)"
}
prepare() {
cd "$srcdir/binutils-gdb"
#do not install libiberty
sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
}
build() {
for _target in $_targets; do
echo "Building ${_target} cross binutils"
mkdir -p "$srcdir"/binutils-${_target} && cd "${srcdir}/binutils-${_target}"
"$srcdir"/binutils-gdb/configure --prefix=/usr \
--target=${_target} \
--infodir=/usr/share/info/${_target} \
--enable-lto \
--enable-plugins \
--enable-deterministic-archives \
--disable-multilib \
--disable-nls \
--disable-werror
make -O
done
}
package() {
for _target in ${_targets}; do
echo "Installing ${_target} cross binutils"
cd "$srcdir"/binutils-${_target}
make DESTDIR="$pkgdir" install
rm "$pkgdir"/usr/lib/bfd-plugins/libdep.so
done
}