# Maintainer: Natanael Copa pkgname=gdb pkgver=10.1 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="0dc54380435c6853db60f1e388b94836d294dfa9ad7f518385a27db4edd03cb970f8717d5f1e9c9a0d4a33d7fcf91bc2e5d6c9cf9e4b561dcc74e65b806c1537 gdb-10.1.tar.xz 70e7d04e4d72461436da503b5bfa370c5779e03245c521f30e9779d5ff37dbb2d708b05f2afb27f43ad9defc44df4bd979d72f777e744851fdbf156295e1cc9f s390x-use-elf-gdb_fpregset_t.patch 04911f87904b62dd7662435f9182b20485afb29ddb3d6398a9d31fef13495f7b70639c77fdae3a40e2775e270d7cd40d0cfd7ddf832372b506808d33c8301e01 ppc-musl.patch ab554899bbb2aa98261fd1b6beb4a71ed7c713a714bddd3fa7ec875258e39bd5474dc96a11accb4dadd316f3834f215e8395d3b373bf3affd122dc5b4a8fe710 ppc-ptregs.patch 58aacc7cdc119eab729a3c5a5521f6a0db41c6a5bc2d09d6e32cbdd071d85dd1a31b5e6559616f8da1237c5b79ad9e04aab485211e957b4d1ca752c0c5ad660b musl-signals.patch"