aboutsummaryrefslogtreecommitdiffstats
path: root/community/mingw-w64-binutils/APKBUILD
blob: c18438f2f970aaca3904ae75c0025134c8beb7aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=mingw-w64-binutils
pkgver=2.35.1
pkgrel=0
pkgdesc="Cross binutils for the MinGW-w64 cross-compiler"
url="http://www.gnu.org/software/binutils"
arch="x86_64 x86"
license="GPL-3.0-or-later"
makedepends="zlib-dev perl texinfo"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.gz"
builddir="$srcdir/binutils-$pkgver"

case "$CARCH" in
	x86_64) _target="x86_64-w64-mingw32" ;;
	x86) _target="i686-w64-mingw32" ;;
esac

# Directory for out-of-tree builds
_binutilsdir="$srcdir/binutils-$_target"

prepare() {
	default_prepare

	# Do not install libiberty
	sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
	# hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS"
	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure

	mkdir -p "$_binutilsdir"
}

build() {
	cd "$_binutilsdir"
	"$builddir"/configure \
		--prefix=/usr \
		--target=$_target \
		--infodir=/usr/share/info/$_target \
		--enable-lto --enable-plugins \
		--enable-deterministic-archives \
		--disable-multilib --disable-nls \
		--disable-werror
	make
}

package() {
	cd "$_binutilsdir"
	make DESTDIR="$pkgdir" install
}

sha512sums="ef5d84b8d9568615aed00ac661267c5eccfcb805a3643f94a2f8220d0c4dd1c6001c8d95a3507599b8cd0e87b15b1e320500ca34580927fb813209ad98a34b16  mingw-w64-binutils-2.35.1.tar.gz"