summaryrefslogtreecommitdiff
path: root/community/mingw-w64-binutils/PKGBUILD
blob: 28ba518b00ac5b39760279f7f77c0ad41f9a4ed6 (plain)
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
53
54
55
56
# $Id: PKGBUILD 104091 2014-01-15 13:38:18Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: rubenvb vanboxem <dottie> ruben <attie> gmail <dottie> com

_targets="i686-w64-mingw32 x86_64-w64-mingw32"

pkgname=mingw-w64-binutils
pkgver=2.23.2
pkgrel=3
pkgdesc="Cross binutils for the MinGW-w64 cross-compiler"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/binutils"
license=('GPL')
groups=('mingw-w64-toolchain' 'mingw-w64')
depends=('zlib')
options=('!libtool' '!emptydirs')
source=("http://ftp.gnu.org/gnu/binutils/binutils-${pkgver}.tar.gz"
	"windres.patch::https://bugs.archlinux.org/task/38111?getfile=11313"
	"binutils-2.23.2-texinfo-5.0.patch.txt")
md5sums=('cda9dcc08c86ff2fd3f27e4adb250f6f'
         '2b653bdfd2ddda9ff36b4695b2d9bc8c'
         '34e439ce23213a91e2af872dfbb5094c')

prepare() {
  cd ${srcdir}/binutils-${pkgver}
  # http://sourceware.org/git/?p=binutils.git;a=patch;h=e02bf935
  # http://sourceware.org/git/?p=binutils.git;a=patch;h=935f8542
  patch -p1 -i ${srcdir}/binutils-2.23.2-texinfo-5.0.patch.txt
  patch -p1 -i ${srcdir}/windres.patch

  #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
}

build() {
  for _target in $_targets; do
    msg "Building ${_target} cross binutils"
    mkdir -p ${srcdir}/binutils-${_target} && cd "${srcdir}/binutils-${_target}"
    $srcdir/binutils-${pkgver}/configure --prefix=/usr \
        --target=${_target} \
        --infodir=/usr/share/info/${_target} \
        --enable-lto --enable-plugins \
        --disable-multilib --disable-nls
     make
  done
}

package() {
  for _target in ${_targets}; do
    msg "Installing ${_target} cross binutils"
    cd ${srcdir}/binutils-${_target}
    make DESTDIR=${pkgdir} install
  done
}