summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: bfeefcdaeb0664b7fe20c7fc109f7cb35f783df7 (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
# Maintainer: Lukas Jirkovsky <l.jirkovsky@gmail.com>
# Contributor: Allan McRae <allan@archlinux.org>
pkgname=gdb-git
pkgver=78972.bbad633
pkgrel=1
pkgdesc="The GNU Debugger"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/gdb/"
license=('GPL3')
depends=('expat' 'guile' 'ncurses' 'python2' 'xz')
makedepends=('git')
provides=('gdb')
conflicts=('gdb')
backup=('etc/gdb/gdbinit')
options=('!libtool')
install=gdb.install
source=('gdb::git+git://sourceware.org/git/binutils-gdb.git')
md5sums=('SKIP')

pkgver() {
  cd "$srcdir/gdb"
  echo $(git rev-list --count master).$(git rev-parse --short master)
}

prepare() {
  cd "$srcdir/gdb"

  # fixes build, copied from the gdb PKGBUILD
  # hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS"
  sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
}

build() {
  cd "$srcdir/gdb"

  ./configure --prefix=/usr --disable-nls \
              --disable-werror \
              --with-system-readline \
              --with-python=/usr/bin/python2 \
              --with-system-gdbinit=/etc/gdb/gdbinit

  make
}

package() {
  cd "$srcdir/gdb"

  # install only gdb, otherwise it would install files already provided by binutils
  make DESTDIR="$pkgdir/" install-gdb

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