summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 12d13e75bf3517bc5d92b0da0277ba0fd48c39b8 (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
# $Id: PKGBUILD 239354 2015-05-14 16:11:09Z anatolik $
# Maintainer: Allan McRae <allan@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=gdb78
pkgver=7.8.2
pkgrel=1
pkgdesc='The GNU Debugger'
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/gdb/"
license=('GPL3')
depends=('python2' 'xz' 'guile')
backup=('etc/gdb78/gdbinit')
source=(http://ftp.gnu.org/gnu/gdb/gdb-${pkgver}.tar.xz{,.sig})
sha1sums=('85a9cc2a4dfb748bc8eb74113af278524126a9bd'
          'SKIP')
validpgpkeys=('F40ADB902B24264AA42E50BF92EDB04BFF325CF3') # Joel Brobecker

prepare() {
  cd "gdb-${pkgver}"

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

build() {
  cd "gdb-${pkgver}"
  
  # guile support has a severe bug https://sourceware.org/bugzilla/show_bug.cgi?id=17247
  ./configure --prefix=/usr --disable-nls \
    --with-system-readline \
    --with-python=/usr/bin/python2 \
    --with-system-gdbinit=/etc/gdb78/gdbinit \
    --datadir=/usr/share/gdb78 \
    --program-suffix=-7.8

  make
}

package() {
  cd "gdb-${pkgver}"
  make DESTDIR="${pkgdir}" install

  # install "custom" system gdbinit
  install -dm755 "${pkgdir}/etc/gdb78"
  touch "${pkgdir}/etc/gdb78/gdbinit"
  
  # resolve conflicts with system gdb
  rm -r "${pkgdir}/usr/bin/gdbserver-7.8"
  rm -r "${pkgdir}/usr/include/"
  rm -r "${pkgdir}/usr/lib/"
  rm -r "${pkgdir}/usr/share/info/"
  rm -r "${pkgdir}/usr/share/man"
}