aboutsummaryrefslogtreecommitdiffstats
path: root/main/gdb/APKBUILD
blob: 822a8ffe4e593a4e75008e35d9f820af3f691377 (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
71
72
73
74
75
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gdb
pkgver=7.9.1
pkgrel=0
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
	autoconf automake libtool linux-headers"
subpackages="$pkgname-doc"
source="http://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz
	gdb-linux_nat.patch
	"
#	05_all_readline-headers.patch
#	cpuid-pic.patch
#	gdb-linux_nat.patch
#	gdb-linux_osdata.patch
#	gdb-linux_threaddb.patch
#	gdb-amd64-debugreg.patch
# patches were found here:
# http://distfiles.gentoo.org/distfiles/gdb-7.4-patches-1.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"

	# 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
	rm -f "$pkgdir"/usr/share/info/dir
	# those are provided by binutils
	rm -rf "$pkgdir"/usr/include
	rm -rf "$pkgdir"/usr/lib
}

md5sums="35374c77a70884eb430c97061053a36e  gdb-7.9.1.tar.xz
4e9d84600ca314ab4db8baf8f8ffe297  gdb-linux_nat.patch"
sha256sums="cd9c543a411a05b2b647dd38936034b68c2b5d6f10e0d51dc168c166c973ba40  gdb-7.9.1.tar.xz
dcef02741f402ad34c658a90b85667e93e1d3293fe2941acd5b6821b349a1532  gdb-linux_nat.patch"
sha512sums="eebdf88b24e52e792b8a4b89ea85790de72b462a7810b44975fdf4232c068f353b15506071f450102a9d4bcecdde8e93dc3748a10699b7f73f3e04fb2d9d8414  gdb-7.9.1.tar.xz
1d5ecce8c1b597f12298d17bae308e332cb0dbae56b08c3da7829ab6a473f1b20e8e6572bab45bce5942771753604b7a9541c809f2a86d4beb38ff98b0be4bfe  gdb-linux_nat.patch"