summaryrefslogtreecommitdiff
path: root/pcr/riscv64-linux-gnu-gdb/PKGBUILD
blob: 623a680da3a5756de471572fe1a419ae21b59c36 (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
57
58
59
60
61
62
# $Id$
# Maintainer (Arch): Anatol Pomozov <anatol.pomozov@gmail.com>
# Contributor: Andreas Grapentin <andreas@grapentin.org>

# parabola changes and rationale:
#  - adapted from aarch64-linux-gnu-gdb

_target=riscv64-linux-gnu
pkgname=$_target-gdb
_snapshot=20171231
pkgver=8.0.v$_snapshot
pkgrel=1
pkgdesc='The GNU Debugger for the riscv64 target'
arch=(x86_64)
url='https://github.com/riscv/riscv-gnu-toolchain'
license=(GPL3)
depends=(xz ncurses expat python guile2.0 gdb-common mpfr)
makedepends=(git)
options=(!emptydirs)
source=("$_target::git+https://github.com/riscv/riscv-gnu-toolchain#tag=v$_snapshot")
sha256sums=('SKIP')

prepare() {
  cd "$srcdir/$_target"

  # fix submodule repo paths
  sed -i 's#\.\.#git://github.com/riscv#' .gitmodules
  # update submodule
  git submodule update --init riscv-binutils-gdb

  cd riscv-binutils-gdb
  sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
}

build() {
  cd "$srcdir/$_target/riscv-binutils-gdb"

  ./configure \
    --target=$_target \
    --prefix=/usr \
    --enable-languages=c,c++ \
    --disable-multilib \
    --with-system-readline \
    --disable-nls \
    --with-python=/usr/bin/python3 \
    --with-guile=guile-2.0 \
    --with-system-gdbinit=/etc/gdb/gdbinit

  make all-gdb
}

package() {
  cd "$srcdir/$_target/riscv-binutils-gdb"

  make DESTDIR="$pkgdir" install-gdb

  # Following files conflict with 'gdb' package
  rm -r "$pkgdir"/usr/share/info
  rm -r "$pkgdir"/usr/share/gdb
  rm -r "$pkgdir"/usr/include/gdb
  rm -r "$pkgdir"/usr/share/man/man5
}