aboutsummaryrefslogtreecommitdiffstats
path: root/main/gdb/APKBUILD
blob: 3b7b80aba30bffda45c1bec5a79aa7952657d110 (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
63
64
65
66
67
68
69
70
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gdb
pkgver=7.11
pkgrel=1
pkgdesc="The GNU Debugger"
url="http://sources.redhat.com/gdb/"
arch="all"
license="GPL3"
depends=
makedepends="ncurses-dev expat-dev texinfo readline-dev python-dev
	zlib-dev autoconf automake libtool linux-headers"
subpackages="$pkgname-doc"
source="http://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz
	"
_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch)
			msg "Applying $i"
			patch -p1 -i "$srcdir"/$i || return 1
			;;
		esac
	done
}

build () {
	cd "$_builddir"
	local _config="
		--build=$CBUILD
		--host=$CHOST
		--prefix=/usr
		--target=$CTARGET
		--with-build-sysroot=$CBUILDROOT
		--disable-nls
		--disable-werror
		--mandir=/usr/share/man
		--infodir=/usr/share/info"

	# use system readline if not cross compiling
	[ "$CBUILD" = "$CHOST" ] && _config="$_config --with-system-readline"

	# use system zlib if not cross compiling
	[ "$CBUILD" = "$CHOST" ] && _config="$_config --with-system-zlib"

	# gdb server does not compile with musl
	[ "$CTARGET_LIBC" = musl ] &&  _config="$_config --disable-gdbserver"

	./configure $_config || return 1
	(cd opcodes && ./configure $_config) || return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1

	# resolve conflict with binutils-doc
	rm -f "$pkgdir"/usr/share/info/bfd.info
	rm -f "$pkgdir"/usr/share/info/dir

	# those are provided by binutils
	rm -rf "$pkgdir"/usr/include
	rm -rf "$pkgdir"/usr/lib
}

md5sums="b5c784685e1cde65ba135feea86b6d75  gdb-7.11.tar.xz"
sha256sums="7a434116cb630d77bb40776e8f5d3937bed11dea56bafebb4d2bc5dd389fe5c1  gdb-7.11.tar.xz"
sha512sums="eadd2a59a1e48b1484eb2bea85256d6b1912926bc8b690793d02babf2639608bd22a0f2de77d4f60092da3b1dafeaa6d75a7cff3e84bd4e22fc46364b68e5e9f  gdb-7.11.tar.xz"