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

builddir="$srcdir"/$pkgname-$pkgver

build () {
	cd "$builddir"
	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"

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

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

	./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
}

sha512sums="5eb328910033f0918058be2f92caebf1e8dfc6caa3c730d99d621627e53de3c1b43761c2f683d53555893253c2f06768cbf56cdea051a3d291ffb6cfae87b5e1  gdb-8.0.1.tar.xz
c3872eb51b3a42c5a33f8b7542c37fab7b0548560202e5eda740a2176cdfadff9bf73c6d26bceb225829dcb509c823acae2ccc796237ac97ebe552b82582bdf5  s390x-use-elf-gdb_fpregset_t.patch
04911f87904b62dd7662435f9182b20485afb29ddb3d6398a9d31fef13495f7b70639c77fdae3a40e2775e270d7cd40d0cfd7ddf832372b506808d33c8301e01  ppc-musl.patch"