PKGBUILD 2.26 KB
Newer Older
AlmAck's avatar
AlmAck committed
1 2
# maintainer: AlmAck <almack@chakralinux.org>

Jan Mette's avatar
Jan Mette committed
3
pkgname=binutils
AlmAck's avatar
AlmAck committed
4
pkgver=2.29.1
AlmAck's avatar
AlmAck committed
5
pkgrel=2
Manuel's avatar
New tc  
Manuel committed
6 7
pkgdesc="A set of programs to assemble and manipulate binary and object files"
arch=('x86_64')
Jan Mette's avatar
Jan Mette committed
8 9
url="http://www.gnu.org/software/binutils/"
license=('GPL')
Manuel's avatar
New tc  
Manuel committed
10
groups=('base-devel')
AlmAck's avatar
AlmAck committed
11
depends=('glibc>=2.26' 'zlib')
12
makedepends=('git')
Manuel's avatar
New tc  
Manuel committed
13
checkdepends=('dejagnu' 'bc')
14 15
conflicts=('binutils-multilib')
replaces=('binutils-multilib')
16
options=('staticlibs' '!distcc' '!ccache')
AlmAck's avatar
AlmAck committed
17 18 19 20 21 22
source=(https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz{,.sig}
        0001-x86-64_Dont_pass_output_bfd_to_info-callbacks-minfo.patch)
validpgpkeys=(3A24BC1E8FB409FA9F14371813FCEF89DD9E3C4F)
md5sums=('acc9cd826edb9954ac7cecb81c727793'
         'SKIP'
         'e4be936139ef46122cb3841881c432b2')
Msnuel's avatar
Msnuel committed
23 24

prepare() {
AlmAck's avatar
AlmAck committed
25
  cd binutils-$pkgver
Msnuel's avatar
Msnuel committed
26 27 28 29

  # hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS"
  sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure

AlmAck's avatar
AlmAck committed
30 31 32 33
  # https://bugs.archlinux.org/task/55741
  git apply ../0001-x86-64_Dont_pass_output_bfd_to_info-callbacks-minfo.patch
  
  mkdir -p ${srcdir}/binutils-build
Msnuel's avatar
Msnuel committed
34
}
Jan Mette's avatar
Jan Mette committed
35 36

build() {
37
  cd binutils-build
38

AlmAck's avatar
AlmAck committed
39
  "$srcdir/binutils-$pkgver/configure" \
40
    --prefix=/usr \
Manuel's avatar
New tc  
Manuel committed
41
    --with-lib-path=/usr/lib:/usr/local/lib \
AlmAck's avatar
AlmAck committed
42
    --with-bugurl=https://code.chakralinux.org/ \
43 44 45 46
    --enable-threads \
    --enable-shared \
    --enable-ld=default \
    --enable-gold \
AlmAck's avatar
AlmAck committed
47
    --enable-plugins \
AlmAck's avatar
AlmAck committed
48
    --enable-relro \
49
    --enable-deterministic-archives \
AlmAck's avatar
AlmAck committed
50
    --with-pic \
51
    --disable-werror \
AlmAck's avatar
AlmAck committed
52 53
    --disable-gdb \
    --with-system-zlib
Jan Mette's avatar
Jan Mette committed
54

Manuel's avatar
Manuel committed
55
  # check the host environment and makes sure all the necessary tools are available
56
  make configure-host
57

Msnuel's avatar
Msnuel committed
58
  make tooldir=/usr
Manuel's avatar
New tc  
Manuel committed
59 60 61
}

check() {
62
  cd binutils-build
Msnuel's avatar
Msnuel committed
63
  
Manuel's avatar
New tc  
Manuel committed
64
  # unset LDFLAGS as testsuite makes assumptions about which ones are active
65
  # ignore failures in gold testsuite...
AlmAck's avatar
AlmAck committed
66
  make -k LDFLAGS="" check || true
67 68 69
}

package() {
70
  cd binutils-build
Manuel's avatar
New tc  
Manuel committed
71
  make prefix=${pkgdir}/usr tooldir=${pkgdir}/usr install
72

Msnuel's avatar
Msnuel committed
73
  # Remove unwanted files
Manuel's avatar
New tc  
Manuel committed
74
  rm ${pkgdir}/usr/share/man/man1/{dlltool,nlmconv,windres,windmc}*
75

Msnuel's avatar
Msnuel committed
76
  # No shared linking to these files outside binutils
Manuel's avatar
New tc  
Manuel committed
77
  rm ${pkgdir}/usr/lib/lib{bfd,opcodes}.so
78 79
  echo "INPUT ( /usr/lib/libbfd.a -liberty -lz -ldl )" > "$pkgdir"/usr/lib/libbfd.so
  echo "INPUT ( /usr/lib/libopcodes.a -lbfd )" > "$pkgdir"/usr/lib/libopcodes.so
Manuel's avatar
New tc  
Manuel committed
80
}