aboutsummaryrefslogtreecommitdiffstats
path: root/main/gdb/APKBUILD
blob: 6c7f4a35eb1713d0ac9bb27e5a4df93b7029c955 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gdb
pkgver=7.6.2
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
	autoconf automake libtool"
subpackages="$pkgname-doc"
source="http://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.bz2
	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="496399e96654fc0f899a5c964bc1f0f8  gdb-7.6.2.tar.bz2
701b030be4c141eab6409d37f5afa11b  05_all_readline-headers.patch
a679796124dc56798cdebffa524f661c  cpuid-pic.patch
fa690484f7cdd2d552216d515653b97f  gdb-linux_nat.patch
58e5c62bd1104f61d1f01809aab55abb  gdb-linux_osdata.patch
70777c7a82f3cbab0a70a9088feea4ac  gdb-linux_threaddb.patch
c66ba0aa72baea5bea429461607c5664  gdb-amd64-debugreg.patch"
sha256sums="2f6a0e2ce1c66c9dedeb7f58a8d1298ad602ddcdaf15d23104e1f7832b96d0e8  gdb-7.6.2.tar.bz2
390a88feac5f1d3980458057e1903a3fa104edb32daa6bb76396af1cb91cefc2  05_all_readline-headers.patch
d22ce97b01c3bb25cc17831c60b984eebe2c1fe573b04a0d87e535794294e399  cpuid-pic.patch
15eef2bf2679353de30e31f6b60b1045e453519f4f2e9fc84472b68a0c35d83d  gdb-linux_nat.patch
9d92d4e760d604771a835181b35930b960abdaa9aaee699544484602cc09dfb5  gdb-linux_osdata.patch
0ec1c6c3fa09ecce7872bf1ba8a40b06238f62b4587b4d15fe29229f75cbc997  gdb-linux_threaddb.patch
ab242331458c8a0c1bb99e8fe0d53ff5dd5d443cbe2ee67668b2bdbabb5c5019  gdb-amd64-debugreg.patch"
sha512sums="e72e9c2abb58cc08c38841380270fe783f26baf62798171d21cf0843e6c9a81d285f424dc6229ea7b1c6c957d999c8aa75c2bd15076817abb9caab28c4eb7666  gdb-7.6.2.tar.bz2
dfb7f7272305779599d3da51ce1158628473534a96f2721d7060930c94800a4efc061321bc5a9e455c72f670cfb77f0eb01cb696da55a4accf96f555377f551f  05_all_readline-headers.patch
10551a28767b270ff5107fde595ad8877f3f2d684edccc85c18d08e3a9a2c4afe48da804adf9f8e716b666817906b22565a614d22fbc91e4ee650e1ecdb8fb0e  cpuid-pic.patch
c61cdf6a0b518125d977a26f8929948a47205a396e011730719b49d1395d4889a03e216108c00b1ffe28fc4ac9a820e1cdf55b69fa246d2b2f890b8da46d8508  gdb-linux_nat.patch
209de5ce0f2c01e313fc39f97576e67b8a98a991d45d302906e4b85f2e21e2948e76d530f2554964042e53d827af0414aee64a30bfa176e77815658fbc11ea0b  gdb-linux_osdata.patch
af29422ef3b5bf2d95868532a1054a50141dd072c061003e6b86ac922e20d2e16baabb9eeb92c06734ae5ee86cdd40f1ef8e807fe258b56ad6b3513ad7915523  gdb-linux_threaddb.patch
6e88171db53bb9e62cbfb5e75a2df17ebd577c85c04965bc6bf93db99ccc51663d0c14edd77bf59cf88bdab73cda37e0d15600770872451d45ffe11bbd591d2b  gdb-amd64-debugreg.patch"