summaryrefslogtreecommitdiff
path: root/extra/gdb/PKGBUILD
blob: d4f3401d1ea7bc5c45cb8455edaedc99f2a3f89b (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
# $Id: PKGBUILD 183696 2013-04-27 07:01:47Z allan $
# Maintainer: Allan McRae <allan@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=gdb
pkgver=7.6
pkgrel=1
pkgdesc="The GNU Debugger"
arch=('i686' 'x86_64' 'mips64el')
url="http://www.gnu.org/software/gdb/"
license=('GPL3')
depends=('ncurses' 'expat' 'python2')
makedepends=('texinfo')
backup=('etc/gdb/gdbinit')
options=('!libtool')
install=gdb.install
source=(http://ftp.gnu.org/gnu/gdb/${pkgname}-${pkgver}.tar.bz2{,.sig})
md5sums=('fda57170e4d11cdde74259ca575412a8'
         'SKIP')

prepare() {
  cd ${srcdir}/${pkgname}-${pkgver}

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

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  
  ./configure --prefix=/usr --disable-nls \
    --with-system-readline \
    --with-python=/usr/bin/python2 \
    --with-system-gdbinit=/etc/gdb/gdbinit
  make
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install

  # install "custom" system gdbinit
  install -dm755 $pkgdir/etc/gdb
  touch $pkgdir/etc/gdb/gdbinit

  # resolve conflicts with binutils
  rm ${pkgdir}/usr/include/{ansidecl,bfd,bfdlink,dis-asm,symcat}.h
  rm ${pkgdir}/usr/lib/{libbfd,libiberty,libopcodes}.a
  rm ${pkgdir}/usr/share/info/{bfd,configure,standards}.info
}