aboutsummaryrefslogtreecommitdiffstats
path: root/main/gdb/APKBUILD
blob: 757bb2fae339f87cf53ccbd4abb0e65e7235bd65 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gdb
pkgver=9.2
pkgrel=0
pkgdesc="The GNU Debugger"
url="https://www.gnu.org/software/gdb/"
arch="all"
license="GPL-3.0-or-later LGPL-3.0-or-later"
makedepends="ncurses-dev expat-dev texinfo readline-dev python3-dev
	zlib-dev autoconf automake libtool linux-headers perl"
options="!check"
subpackages="$pkgname-doc $pkgname-multiarch"
source="https://ftp.gnu.org/gnu/gdb/gdb-$pkgver.tar.xz
	s390x-use-elf-gdb_fpregset_t.patch
	ppc-musl.patch
	ppc-ptregs.patch
	musl-signals.patch
	"

prepare() {
	default_prepare
	mkdir -p "$builddir"/vanilla "$builddir"/multiarch
}

build() {
	local _config="
		--build=$CBUILD
		--host=$CHOST
		--prefix=/usr
		--target=$CTARGET
		--with-build-sysroot=$CBUILDROOT
		--with-python=/usr/bin/python3
		--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"

	# avoid generation of mangled and non-mangled objects on ppc64
	[ "$CARCH" = ppc64le ] && _config="$_config --enable-build-with-cxx=no"

	cd "$builddir"/vanilla
	../configure $_config
	make

	cd "$builddir"/multiarch
	../configure $_config --enable-targets=all
	make
}

package() {
	cd "$builddir"/vanilla
	make DESTDIR="$pkgdir" install

	# 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
}

multiarch() {
	depends="$pkgname"
	pkgdesc="The GNU Debugger for all supported architectures"

	install -Dm755 "$builddir"/multiarch/gdb/gdb \
		"$subpkgdir"/usr/bin/gdb-multiarch
}

sha512sums="73635f00f343117aa5e2436f1e1597099e2bfb31ef7bb162b273fa1ea282c3fa9b0f52762e70bfc7ad0334addb8d159e9ac7cbe5998ca4f755ea8cf90714d274  gdb-9.2.tar.xz
70e7d04e4d72461436da503b5bfa370c5779e03245c521f30e9779d5ff37dbb2d708b05f2afb27f43ad9defc44df4bd979d72f777e744851fdbf156295e1cc9f  s390x-use-elf-gdb_fpregset_t.patch
04911f87904b62dd7662435f9182b20485afb29ddb3d6398a9d31fef13495f7b70639c77fdae3a40e2775e270d7cd40d0cfd7ddf832372b506808d33c8301e01  ppc-musl.patch
b75e1c1ee503a1948a7d5b8d90427b5c7d38ded69978056cee0adca222771a5c95ed1ac73127fcae7b795ea94296344eee5fca47e4cd04b418c164a756fb0933  ppc-ptregs.patch
013141b89afafba02a6ddd1407dfd9b2566606e7b1d4bd03b4e23d9b523231103dbeca17a435669a7a7508f827cbe7f601e3bb1daa96d892ea33b897265966ad  musl-signals.patch"