Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] gdb: clean up templates
@ 2021-03-10 17:12 unspecd
  2021-03-11  0:38 ` [PR REVIEW] " sgn
                   ` (52 more replies)
  0 siblings, 53 replies; 54+ messages in thread
From: unspecd @ 2021-03-10 17:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]

There is a new pull request by unspecd against master on the void-packages repository

https://github.com/unspecd/void-packages gdb
https://github.com/void-linux/void-packages/pull/29382

gdb: clean up templates
Improved consistency across templates.

Also:
- Fixed `post_install` in srcpkgs/avr-gdb.
- Added build option for Guile.
- Updated cross-arm-none-eabi-gdb to 10.1.

<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, x86_64-musl
- [x] I built this PR locally for these architectures:
  - [x] aarch64
  - [x] aarch64-musl
  - [x] armv7l
  - [ ] ppc
  - [ ] ppc-musl


A patch file from https://github.com/void-linux/void-packages/pull/29382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gdb-29382.patch --]
[-- Type: text/x-diff, Size: 14266 bytes --]

From 9aa703ec153598af9fb26c90d545bbb3292adbfe Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Wed, 10 Mar 2021 23:26:08 +1100
Subject: [PATCH 1/3] gdb: clean up

---
 srcpkgs/gdb-common                           |  1 +
 srcpkgs/gdb/patches/gdb-linux_nat.patch      | 21 -------
 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch | 11 ++++
 srcpkgs/gdb/template                         | 66 +++++++++-----------
 4 files changed, 42 insertions(+), 57 deletions(-)
 create mode 120000 srcpkgs/gdb-common
 delete mode 100644 srcpkgs/gdb/patches/gdb-linux_nat.patch
 create mode 100644 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/gdb-common b/srcpkgs/gdb-common
new file mode 120000
index 00000000000..f3e03e3f1a4
--- /dev/null
+++ b/srcpkgs/gdb-common
@@ -0,0 +1 @@
+gdb
\ No newline at end of file
diff --git a/srcpkgs/gdb/patches/gdb-linux_nat.patch b/srcpkgs/gdb/patches/gdb-linux_nat.patch
deleted file mode 100644
index 53f3132d36c..00000000000
--- a/srcpkgs/gdb/patches/gdb-linux_nat.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-the first chunk fixes build errors,
-the non_stop part below fixes thread debugging being available
-by default without setting any breakpoints or usage of libthread_db.
-
---- gdb-7.4.org/gdb/linux-nat.c	2013-08-10 05:24:24.651000003 +0000
-+++ gdb-7.4/gdb/linux-nat.c	2013-08-10 05:25:50.966000003 +0000
-@@ -71,6 +71,14 @@
- # endif
- #endif /* HAVE_PERSONALITY */
- 
-+#ifndef __SIGRTMIN
-+#define __SIGRTMIN SIGRTMIN
-+#endif
-+
-+#ifndef W_STOPCODE
-+#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
-+#endif
-+
- /* This comment documents high-level logic of this file.
- 
- Waiting for events in sync mode
diff --git a/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 00000000000..54191222f4a
--- /dev/null
+++ b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index e2a39e7d103..f47f772b30c 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,36 +1,44 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=10.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
-configure_args="--disable-werror --disable-nls --with-system-readline
+configure_args="--disable-nls --with-system-readline
  --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib $(vopt_enable gdbserver)
  $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
- $(vopt_if python --with-python=/usr/bin/python3)
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
  $(vopt_with debuginfod)"
-hostmakedepends="texinfo perl pkg-config $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
- $(vopt_if python 'python3-devel gettext-libs')
- $(vopt_if debuginfod elfutils-devel)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python python3-devel) $(vopt_if debuginfod elfutils-devel)"
+depends="gdb-common-${version}_${revision}"
+checkdepends="dejagnu"
 short_desc="GNU Debugger"
 maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
-distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=extended  # Tests take too long, not all of them pass.
 python_version=3
-patch_args="-Np1"
+ignore_elf_files="
+ /usr/share/gdb/guile/gdb/support.go
+ /usr/share/gdb/guile/gdb/experimental.go
+ /usr/share/gdb/guile/gdb/iterator.go
+ /usr/share/gdb/guile/gdb/types.go
+ /usr/share/gdb/guile/gdb/printing.go
+ /usr/share/gdb/guile/gdb.go"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
+
 # Package build options
-build_options="gdbserver static python debuginfod"
+build_options="debuginfod gdbserver guile python static"
 desc_option_gdbserver="Enable support for building GDB server"
 desc_option_debuginfod="Enable support for libdebuginfod"
 # Enable gdbserver if !static.
@@ -38,28 +46,14 @@ build_options_default="gdbserver python debuginfod"
 # Both options cannot be enabled at the same time
 vopt_conflict gdbserver static
 
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
+post_install() {
 	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/{include,lib,lib64}
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
+	rm -rf ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+}
+
+gdb-common_package() {
+	short_desc+=" - common files"
+	pkg_install() {
+		vmove usr/share
+	}
 }

From 16a5ef72439d163b9c41a391420bbf8e7acaa7cd Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:12:29 +1100
Subject: [PATCH 2/3] avr-gdb: clean up

---
 .../avr-gdb/patches/gdb-mips-linux-nat.patch  | 11 +++
 srcpkgs/avr-gdb/template                      | 75 +++++--------------
 2 files changed, 28 insertions(+), 58 deletions(-)
 create mode 100644 srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 00000000000..54191222f4a
--- /dev/null
+++ b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/avr-gdb/template b/srcpkgs/avr-gdb/template
index 2635f382fce..323a26ed5a5 100644
--- a/srcpkgs/avr-gdb/template
+++ b/srcpkgs/avr-gdb/template
@@ -1,79 +1,38 @@
 # Template file for 'avr-gdb'
 pkgname=avr-gdb
 version=10.1
-revision=1
+revision=2
 wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/gdb/python"
-configure_args="\
-	--target=avr \
-	--program-prefix=avr- \
-	--disable-werror \
-	--disable-nls \
-	--with-system-readline \
-	--with-system-gdbinit=/etc/gdb/gdbinit \
-	--with-system-zlib $(vopt_enable gdbserver) \
-	$(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static') \
-	$(vopt_if python --with-python=/usr/bin/python3)"
-hostmakedepends="texinfo perl $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
-	$(vopt_if python 'python3-devel gettext-libs')"
-depends=gdb
+configure_args="--disable-nls --with-system-readline --target=avr
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
+ $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python python3-devel)"
+depends="gdb-common"
 short_desc="GNU Debugger for AVR"
 maintainer="Artur Sinila <opensource@logarithmus.dev>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
+homepage="https://www.gnu.org/software/gdb"
 distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
-python_version=3
+make_check=no  # See gdb/template.
 replaces="cross-avr-gdb>=0"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
-# Package build options
-build_options="gdbserver static python"
-desc_option_gdbserver="Enable support for building GDB server"
-# By default, don't enable any of build options
-#build_options_default="gdbserver"
-# Both options cannot be enabled at the same time
-vopt_conflict gdbserver static
-
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
 
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
-	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/include ${DESTDIR}/usr/lib
-	rm -rf ${DESTDIR}/usr/lib64
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
-}
+# Package build options
+build_options="static python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -rf ${DESTDIR}/usr/{share/{gdb,info},include}
 }

From aaad3790270169f9b04fb227a0fd1515810814a4 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:14:22 +1100
Subject: [PATCH 3/3] cross-arm-none-eabi-gdb: update to 10.1, clean up

---
 .../patches/gdb-mips-linux-nat.patch          | 11 +++
 srcpkgs/cross-arm-none-eabi-gdb/template      | 67 ++++++++-----------
 2 files changed, 40 insertions(+), 38 deletions(-)
 create mode 100644 srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 00000000000..54191222f4a
--- /dev/null
+++ b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/cross-arm-none-eabi-gdb/template b/srcpkgs/cross-arm-none-eabi-gdb/template
index 798295baef8..3a73b302aea 100644
--- a/srcpkgs/cross-arm-none-eabi-gdb/template
+++ b/srcpkgs/cross-arm-none-eabi-gdb/template
@@ -1,46 +1,37 @@
-# Template file for 'cross-${_triplet}-${_pkgname}'
-_triplet=arm-none-eabi
-_pkgname=gdb
-pkgname=cross-${_triplet}-${_pkgname}
-version=8.3
+# Template file for 'cross-arm-none-eabi-gdb'
+pkgname=cross-arm-none-eabi-gdb
+version=10.1
 revision=1
-wrksrc="${_pkgname}-${version}"
+wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/${_pkgname}"
-configure_args="
- --disable-gdbserver
- --disable-nls
- --disable-werror
- --host=${XBPS_CROSS_TRIPLE}
- --prefix=/usr
- --target=${_triplet}
- --with-babeltrace
- --with-expat
- --with-mpfr
- --with-system-readline
- --with-system-zlib
- --without-isl
- $(vopt_with guile)
- $(vopt_with python)
-"
-hostmakedepends="autoconf automake bison flex pkg-config texinfo"
-makedepends="babeltrace-devel expat-devel mpfr-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel) $(vopt_if python 'python3-devel gettext-libs')"
-short_desc="GNU Debugger"
+configure_args="--disable-nls --with-system-readline --target=arm-none-eabi
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib --without-isl
+ $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python python3-devel) babeltrace-devel mpfr-devel"
+depends="gdb-common"
+short_desc="GNU Debugger for ARM"
 maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/${_pkgname}"
-distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}.tar.xz"
-checksum=802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e
-python_version=2 #unverified
-build_options="guile python"
-# don't enable guile and python interfaces until they are moved into
-# platform independent packages
-build_options_default=" "
-nocross=yes
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
+checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=no  # See gdb/template.
 
-CFLAGS="-fcommon"
+if [ "${CROSS_BUILD}" ]; then
+	# Make python3.x detection work in cross builds
+	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
+fi
+
+# Package build options
+build_options="static guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr ${DESTDIR}/usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -rf ${DESTDIR}/usr/{share/{gdb,info},include}
 }

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
@ 2021-03-11  0:38 ` sgn
  2021-03-11  5:45 ` [PR PATCH] [Updated] " unspecd
                   ` (51 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: sgn @ 2021-03-11  0:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 190 bytes --]

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r591982179

Comment:
Please don't remove `--disable-werror`, thanks.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR PATCH] [Updated] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
  2021-03-11  0:38 ` [PR REVIEW] " sgn
@ 2021-03-11  5:45 ` unspecd
  2021-03-11  7:33 ` [PR REVIEW] " unspecd
                   ` (50 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-03-11  5:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]

There is an updated pull request by unspecd against master on the void-packages repository

https://github.com/unspecd/void-packages gdb
https://github.com/void-linux/void-packages/pull/29382

gdb: clean up templates
Improved consistency across templates.

Also:
- Fixed `post_install` in srcpkgs/avr-gdb.
- Added build option for Guile.
- Updated cross-arm-none-eabi-gdb to 10.1.

<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, x86_64-musl
- [x] I built this PR locally for these architectures:
  - [x] aarch64
  - [x] aarch64-musl
  - [x] armv7l
  - [ ] ppc
  - [ ] ppc-musl


A patch file from https://github.com/void-linux/void-packages/pull/29382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gdb-29382.patch --]
[-- Type: text/x-diff, Size: 14250 bytes --]

From 3d7fea893e6179fed7830eb0a2f1b95b58d47d60 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Wed, 10 Mar 2021 23:26:08 +1100
Subject: [PATCH 1/3] gdb: clean up

---
 srcpkgs/gdb-common                           |  1 +
 srcpkgs/gdb/patches/gdb-linux_nat.patch      | 21 -------
 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch | 11 ++++
 srcpkgs/gdb/template                         | 64 +++++++++-----------
 4 files changed, 41 insertions(+), 56 deletions(-)
 create mode 120000 srcpkgs/gdb-common
 delete mode 100644 srcpkgs/gdb/patches/gdb-linux_nat.patch
 create mode 100644 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/gdb-common b/srcpkgs/gdb-common
new file mode 120000
index 00000000000..f3e03e3f1a4
--- /dev/null
+++ b/srcpkgs/gdb-common
@@ -0,0 +1 @@
+gdb
\ No newline at end of file
diff --git a/srcpkgs/gdb/patches/gdb-linux_nat.patch b/srcpkgs/gdb/patches/gdb-linux_nat.patch
deleted file mode 100644
index 53f3132d36c..00000000000
--- a/srcpkgs/gdb/patches/gdb-linux_nat.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-the first chunk fixes build errors,
-the non_stop part below fixes thread debugging being available
-by default without setting any breakpoints or usage of libthread_db.
-
---- gdb-7.4.org/gdb/linux-nat.c	2013-08-10 05:24:24.651000003 +0000
-+++ gdb-7.4/gdb/linux-nat.c	2013-08-10 05:25:50.966000003 +0000
-@@ -71,6 +71,14 @@
- # endif
- #endif /* HAVE_PERSONALITY */
- 
-+#ifndef __SIGRTMIN
-+#define __SIGRTMIN SIGRTMIN
-+#endif
-+
-+#ifndef W_STOPCODE
-+#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
-+#endif
-+
- /* This comment documents high-level logic of this file.
- 
- Waiting for events in sync mode
diff --git a/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 00000000000..54191222f4a
--- /dev/null
+++ b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index e2a39e7d103..18778b60f2a 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,36 +1,44 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=10.1
-revision=2
+revision=3
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
  --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib $(vopt_enable gdbserver)
  $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
- $(vopt_if python --with-python=/usr/bin/python3)
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
  $(vopt_with debuginfod)"
-hostmakedepends="texinfo perl pkg-config $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
- $(vopt_if python 'python3-devel gettext-libs')
- $(vopt_if debuginfod elfutils-devel)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python python3-devel) $(vopt_if debuginfod elfutils-devel)"
+depends="gdb-common-${version}_${revision}"
+checkdepends="dejagnu"
 short_desc="GNU Debugger"
 maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
-distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=extended  # Tests take too long, not all of them pass.
 python_version=3
-patch_args="-Np1"
+ignore_elf_files="
+ /usr/share/gdb/guile/gdb/support.go
+ /usr/share/gdb/guile/gdb/experimental.go
+ /usr/share/gdb/guile/gdb/iterator.go
+ /usr/share/gdb/guile/gdb/types.go
+ /usr/share/gdb/guile/gdb/printing.go
+ /usr/share/gdb/guile/gdb.go"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
+
 # Package build options
-build_options="gdbserver static python debuginfod"
+build_options="debuginfod gdbserver guile python static"
 desc_option_gdbserver="Enable support for building GDB server"
 desc_option_debuginfod="Enable support for libdebuginfod"
 # Enable gdbserver if !static.
@@ -38,28 +46,14 @@ build_options_default="gdbserver python debuginfod"
 # Both options cannot be enabled at the same time
 vopt_conflict gdbserver static
 
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
+post_install() {
 	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/{include,lib,lib64}
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
+	rm -rf ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+}
+
+gdb-common_package() {
+	short_desc+=" - common files"
+	pkg_install() {
+		vmove usr/share
+	}
 }

From 5d7b4724f55aa993cfd58475769fd930bc4a6560 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:12:29 +1100
Subject: [PATCH 2/3] avr-gdb: clean up

---
 .../avr-gdb/patches/gdb-mips-linux-nat.patch  | 11 +++
 srcpkgs/avr-gdb/template                      | 76 +++++--------------
 2 files changed, 29 insertions(+), 58 deletions(-)
 create mode 100644 srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 00000000000..54191222f4a
--- /dev/null
+++ b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/avr-gdb/template b/srcpkgs/avr-gdb/template
index 2635f382fce..86db674fe65 100644
--- a/srcpkgs/avr-gdb/template
+++ b/srcpkgs/avr-gdb/template
@@ -1,79 +1,39 @@
 # Template file for 'avr-gdb'
 pkgname=avr-gdb
 version=10.1
-revision=1
+revision=2
 wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/gdb/python"
-configure_args="\
-	--target=avr \
-	--program-prefix=avr- \
-	--disable-werror \
-	--disable-nls \
-	--with-system-readline \
-	--with-system-gdbinit=/etc/gdb/gdbinit \
-	--with-system-zlib $(vopt_enable gdbserver) \
-	$(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static') \
-	$(vopt_if python --with-python=/usr/bin/python3)"
-hostmakedepends="texinfo perl $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
-	$(vopt_if python 'python3-devel gettext-libs')"
-depends=gdb
+configure_args="--disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
+ $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
+ --target=avr"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python python3-devel)"
+depends="gdb-common"
 short_desc="GNU Debugger for AVR"
 maintainer="Artur Sinila <opensource@logarithmus.dev>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
+homepage="https://www.gnu.org/software/gdb"
 distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
-python_version=3
+make_check=no  # See gdb/template.
 replaces="cross-avr-gdb>=0"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
-# Package build options
-build_options="gdbserver static python"
-desc_option_gdbserver="Enable support for building GDB server"
-# By default, don't enable any of build options
-#build_options_default="gdbserver"
-# Both options cannot be enabled at the same time
-vopt_conflict gdbserver static
-
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
 
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
-	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/include ${DESTDIR}/usr/lib
-	rm -rf ${DESTDIR}/usr/lib64
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
-}
+# Package build options
+build_options="static python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -rf ${DESTDIR}/usr/{share/{gdb,info},include}
 }

From 23be88ed384450df2bdaa9bfe3b180d197c58bc5 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:14:22 +1100
Subject: [PATCH 3/3] cross-arm-none-eabi-gdb: update to 10.1, clean up

---
 .../patches/gdb-mips-linux-nat.patch          | 11 +++
 srcpkgs/cross-arm-none-eabi-gdb/template      | 68 ++++++++-----------
 2 files changed, 41 insertions(+), 38 deletions(-)
 create mode 100644 srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 00000000000..54191222f4a
--- /dev/null
+++ b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/cross-arm-none-eabi-gdb/template b/srcpkgs/cross-arm-none-eabi-gdb/template
index 798295baef8..9dce420b545 100644
--- a/srcpkgs/cross-arm-none-eabi-gdb/template
+++ b/srcpkgs/cross-arm-none-eabi-gdb/template
@@ -1,46 +1,38 @@
-# Template file for 'cross-${_triplet}-${_pkgname}'
-_triplet=arm-none-eabi
-_pkgname=gdb
-pkgname=cross-${_triplet}-${_pkgname}
-version=8.3
+# Template file for 'cross-arm-none-eabi-gdb'
+pkgname=cross-arm-none-eabi-gdb
+version=10.1
 revision=1
-wrksrc="${_pkgname}-${version}"
+wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/${_pkgname}"
-configure_args="
- --disable-gdbserver
- --disable-nls
- --disable-werror
- --host=${XBPS_CROSS_TRIPLE}
- --prefix=/usr
- --target=${_triplet}
- --with-babeltrace
- --with-expat
- --with-mpfr
- --with-system-readline
- --with-system-zlib
- --without-isl
- $(vopt_with guile)
- $(vopt_with python)
-"
-hostmakedepends="autoconf automake bison flex pkg-config texinfo"
-makedepends="babeltrace-devel expat-devel mpfr-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel) $(vopt_if python 'python3-devel gettext-libs')"
-short_desc="GNU Debugger"
+configure_args="--disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib --without-isl
+ $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
+ --target=arm-none-eabi"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python python3-devel) babeltrace-devel mpfr-devel"
+depends="gdb-common"
+short_desc="GNU Debugger for ARM"
 maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/${_pkgname}"
-distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}.tar.xz"
-checksum=802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e
-python_version=2 #unverified
-build_options="guile python"
-# don't enable guile and python interfaces until they are moved into
-# platform independent packages
-build_options_default=" "
-nocross=yes
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
+checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=no  # See gdb/template.
 
-CFLAGS="-fcommon"
+if [ "${CROSS_BUILD}" ]; then
+	# Make python3.x detection work in cross builds
+	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
+fi
+
+# Package build options
+build_options="static guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr ${DESTDIR}/usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -rf ${DESTDIR}/usr/{share/{gdb,info},include}
 }

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
  2021-03-11  0:38 ` [PR REVIEW] " sgn
  2021-03-11  5:45 ` [PR PATCH] [Updated] " unspecd
@ 2021-03-11  7:33 ` unspecd
  2021-03-18  9:26 ` [PR PATCH] [Updated] " unspecd
                   ` (49 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-03-11  7:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 165 bytes --]

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r592123923

Comment:
Ok, added it back.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR PATCH] [Updated] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (2 preceding siblings ...)
  2021-03-11  7:33 ` [PR REVIEW] " unspecd
@ 2021-03-18  9:26 ` unspecd
  2021-03-18  9:46 ` unspecd
                   ` (48 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-03-18  9:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]

There is an updated pull request by unspecd against master on the void-packages repository

https://github.com/unspecd/void-packages gdb
https://github.com/void-linux/void-packages/pull/29382

gdb: clean up templates
Improved consistency across templates.

Also:
- Fixed `post_install` in srcpkgs/avr-gdb.
- Added build option for Guile.
- Updated cross-arm-none-eabi-gdb to 10.1.

<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, x86_64-musl
- [x] I built this PR locally for these architectures:
  - [x] aarch64
  - [x] aarch64-musl
  - [x] armv7l
  - [ ] ppc
  - [ ] ppc-musl


A patch file from https://github.com/void-linux/void-packages/pull/29382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gdb-29382.patch --]
[-- Type: text/x-diff, Size: 13307 bytes --]

From a969ec00d20cd85bace9790d01cf3ae61a098105 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Wed, 10 Mar 2021 23:26:08 +1100
Subject: [PATCH 1/3] gdb: clean up

---
 srcpkgs/gdb-common                           |  1 +
 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch | 11 ++++
 srcpkgs/gdb/template                         | 64 +++++++++-----------
 3 files changed, 41 insertions(+), 35 deletions(-)
 create mode 120000 srcpkgs/gdb-common
 create mode 100644 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/gdb-common b/srcpkgs/gdb-common
new file mode 120000
index 000000000000..f3e03e3f1a44
--- /dev/null
+++ b/srcpkgs/gdb-common
@@ -0,0 +1 @@
+gdb
\ No newline at end of file
diff --git a/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..54191222f4a6
--- /dev/null
+++ b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index e63224696bd3..4728326183bb 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,36 +1,44 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=10.1
-revision=3
+revision=4
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
  --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib $(vopt_enable gdbserver)
  $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
- $(vopt_if python --with-python=/usr/bin/python3)
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
  $(vopt_with debuginfod)"
-hostmakedepends="texinfo perl pkg-config $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
- $(vopt_if python 'python3-devel gettext-libs')
- $(vopt_if debuginfod elfutils-devel)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python python3-devel) $(vopt_if debuginfod elfutils-devel)"
+depends="gdb-common-${version}_${revision}"
+checkdepends="dejagnu"
 short_desc="GNU Debugger"
 maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
-distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=extended  # Tests take too long, not all of them pass.
 python_version=3
-patch_args="-Np1"
+ignore_elf_files="
+ /usr/share/gdb/guile/gdb/support.go
+ /usr/share/gdb/guile/gdb/experimental.go
+ /usr/share/gdb/guile/gdb/iterator.go
+ /usr/share/gdb/guile/gdb/types.go
+ /usr/share/gdb/guile/gdb/printing.go
+ /usr/share/gdb/guile/gdb.go"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
+
 # Package build options
-build_options="gdbserver static python debuginfod"
+build_options="debuginfod gdbserver guile python static"
 desc_option_gdbserver="Enable support for building GDB server"
 desc_option_debuginfod="Enable support for libdebuginfod"
 # Enable gdbserver if !static.
@@ -38,28 +46,14 @@ build_options_default="gdbserver python debuginfod"
 # Both options cannot be enabled at the same time
 vopt_conflict gdbserver static
 
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
+post_install() {
 	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/{include,lib,lib64}
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
+	rm -rf ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+}
+
+gdb-common_package() {
+	short_desc+=" - common files"
+	pkg_install() {
+		vmove usr/share
+	}
 }

From cfea60caa2cf964b3df75fc53d09f34c9ad07823 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:12:29 +1100
Subject: [PATCH 2/3] avr-gdb: clean up

---
 .../avr-gdb/patches/gdb-mips-linux-nat.patch  | 11 +++
 srcpkgs/avr-gdb/template                      | 76 +++++--------------
 2 files changed, 29 insertions(+), 58 deletions(-)
 create mode 100644 srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..54191222f4a6
--- /dev/null
+++ b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/avr-gdb/template b/srcpkgs/avr-gdb/template
index 2635f382fce7..86db674fe656 100644
--- a/srcpkgs/avr-gdb/template
+++ b/srcpkgs/avr-gdb/template
@@ -1,79 +1,39 @@
 # Template file for 'avr-gdb'
 pkgname=avr-gdb
 version=10.1
-revision=1
+revision=2
 wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/gdb/python"
-configure_args="\
-	--target=avr \
-	--program-prefix=avr- \
-	--disable-werror \
-	--disable-nls \
-	--with-system-readline \
-	--with-system-gdbinit=/etc/gdb/gdbinit \
-	--with-system-zlib $(vopt_enable gdbserver) \
-	$(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static') \
-	$(vopt_if python --with-python=/usr/bin/python3)"
-hostmakedepends="texinfo perl $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
-	$(vopt_if python 'python3-devel gettext-libs')"
-depends=gdb
+configure_args="--disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
+ $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
+ --target=avr"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python python3-devel)"
+depends="gdb-common"
 short_desc="GNU Debugger for AVR"
 maintainer="Artur Sinila <opensource@logarithmus.dev>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
+homepage="https://www.gnu.org/software/gdb"
 distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
-python_version=3
+make_check=no  # See gdb/template.
 replaces="cross-avr-gdb>=0"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
-# Package build options
-build_options="gdbserver static python"
-desc_option_gdbserver="Enable support for building GDB server"
-# By default, don't enable any of build options
-#build_options_default="gdbserver"
-# Both options cannot be enabled at the same time
-vopt_conflict gdbserver static
-
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
 
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
-	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/include ${DESTDIR}/usr/lib
-	rm -rf ${DESTDIR}/usr/lib64
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
-}
+# Package build options
+build_options="static python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -rf ${DESTDIR}/usr/{share/{gdb,info},include}
 }

From 46967997293c098d8ce3f6b8d57005adfaf33ee2 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:14:22 +1100
Subject: [PATCH 3/3] cross-arm-none-eabi-gdb: update to 10.1, clean up

---
 .../patches/gdb-mips-linux-nat.patch          | 11 +++
 srcpkgs/cross-arm-none-eabi-gdb/template      | 68 ++++++++-----------
 2 files changed, 41 insertions(+), 38 deletions(-)
 create mode 100644 srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..54191222f4a6
--- /dev/null
+++ b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/cross-arm-none-eabi-gdb/template b/srcpkgs/cross-arm-none-eabi-gdb/template
index 798295baef89..9dce420b545b 100644
--- a/srcpkgs/cross-arm-none-eabi-gdb/template
+++ b/srcpkgs/cross-arm-none-eabi-gdb/template
@@ -1,46 +1,38 @@
-# Template file for 'cross-${_triplet}-${_pkgname}'
-_triplet=arm-none-eabi
-_pkgname=gdb
-pkgname=cross-${_triplet}-${_pkgname}
-version=8.3
+# Template file for 'cross-arm-none-eabi-gdb'
+pkgname=cross-arm-none-eabi-gdb
+version=10.1
 revision=1
-wrksrc="${_pkgname}-${version}"
+wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/${_pkgname}"
-configure_args="
- --disable-gdbserver
- --disable-nls
- --disable-werror
- --host=${XBPS_CROSS_TRIPLE}
- --prefix=/usr
- --target=${_triplet}
- --with-babeltrace
- --with-expat
- --with-mpfr
- --with-system-readline
- --with-system-zlib
- --without-isl
- $(vopt_with guile)
- $(vopt_with python)
-"
-hostmakedepends="autoconf automake bison flex pkg-config texinfo"
-makedepends="babeltrace-devel expat-devel mpfr-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel) $(vopt_if python 'python3-devel gettext-libs')"
-short_desc="GNU Debugger"
+configure_args="--disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib --without-isl
+ $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
+ --target=arm-none-eabi"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python python3-devel) babeltrace-devel mpfr-devel"
+depends="gdb-common"
+short_desc="GNU Debugger for ARM"
 maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/${_pkgname}"
-distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}.tar.xz"
-checksum=802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e
-python_version=2 #unverified
-build_options="guile python"
-# don't enable guile and python interfaces until they are moved into
-# platform independent packages
-build_options_default=" "
-nocross=yes
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
+checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=no  # See gdb/template.
 
-CFLAGS="-fcommon"
+if [ "${CROSS_BUILD}" ]; then
+	# Make python3.x detection work in cross builds
+	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
+fi
+
+# Package build options
+build_options="static guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr ${DESTDIR}/usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -rf ${DESTDIR}/usr/{share/{gdb,info},include}
 }

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR PATCH] [Updated] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (3 preceding siblings ...)
  2021-03-18  9:26 ` [PR PATCH] [Updated] " unspecd
@ 2021-03-18  9:46 ` unspecd
  2021-03-28  0:46 ` unspecd
                   ` (47 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-03-18  9:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]

There is an updated pull request by unspecd against master on the void-packages repository

https://github.com/unspecd/void-packages gdb
https://github.com/void-linux/void-packages/pull/29382

gdb: clean up templates
Improved consistency across templates.

Also:
- Fixed `post_install` in srcpkgs/avr-gdb.
- Added build option for Guile.
- Updated cross-arm-none-eabi-gdb to 10.1.

<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, x86_64-musl
- [x] I built this PR locally for these architectures:
  - [x] aarch64
  - [x] aarch64-musl
  - [x] armv7l
  - [ ] ppc
  - [ ] ppc-musl


A patch file from https://github.com/void-linux/void-packages/pull/29382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gdb-29382.patch --]
[-- Type: text/x-diff, Size: 13306 bytes --]

From 9c22197d4e3a67bc69bcdcef6d7d57bf69326e41 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Wed, 10 Mar 2021 23:26:08 +1100
Subject: [PATCH 1/3] gdb: clean up

---
 srcpkgs/gdb-common                           |  1 +
 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch | 11 ++++
 srcpkgs/gdb/template                         | 63 +++++++++-----------
 3 files changed, 41 insertions(+), 34 deletions(-)
 create mode 120000 srcpkgs/gdb-common
 create mode 100644 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/gdb-common b/srcpkgs/gdb-common
new file mode 120000
index 000000000000..f3e03e3f1a44
--- /dev/null
+++ b/srcpkgs/gdb-common
@@ -0,0 +1 @@
+gdb
\ No newline at end of file
diff --git a/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index e63224696bd3..baffeb646a42 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,36 +1,45 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=10.1
-revision=3
+revision=4
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
  --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib $(vopt_enable gdbserver)
  $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
- $(vopt_if python --with-python=/usr/bin/python3)
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
  $(vopt_with debuginfod)"
-hostmakedepends="texinfo perl pkg-config $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
- $(vopt_if python 'python3-devel gettext-libs')
- $(vopt_if debuginfod elfutils-devel)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python python3-devel) $(vopt_if debuginfod elfutils-devel)"
+depends="gdb-common-${version}_${revision}"
+checkdepends="dejagnu"
 short_desc="GNU Debugger"
 maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
-distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=extended  # Tests take too long, not all of them pass.
 python_version=3
 patch_args="-Np1"
+ignore_elf_files="
+ /usr/share/gdb/guile/gdb/support.go
+ /usr/share/gdb/guile/gdb/experimental.go
+ /usr/share/gdb/guile/gdb/iterator.go
+ /usr/share/gdb/guile/gdb/types.go
+ /usr/share/gdb/guile/gdb/printing.go
+ /usr/share/gdb/guile/gdb.go"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
+
 # Package build options
-build_options="gdbserver static python debuginfod"
+build_options="debuginfod gdbserver guile python static"
 desc_option_gdbserver="Enable support for building GDB server"
 desc_option_debuginfod="Enable support for libdebuginfod"
 # Enable gdbserver if !static.
@@ -38,28 +47,14 @@ build_options_default="gdbserver python debuginfod"
 # Both options cannot be enabled at the same time
 vopt_conflict gdbserver static
 
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
+post_install() {
 	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/{include,lib,lib64}
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
+	rm -rf ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+}
+
+gdb-common_package() {
+	short_desc+=" - common files"
+	pkg_install() {
+		vmove usr/share
+	}
 }

From 21d6bbe9ef82db6b43f54ad92e23316c769e6461 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:12:29 +1100
Subject: [PATCH 2/3] avr-gdb: clean up

---
 .../avr-gdb/patches/gdb-mips-linux-nat.patch  | 11 +++
 srcpkgs/avr-gdb/template                      | 76 +++++--------------
 2 files changed, 29 insertions(+), 58 deletions(-)
 create mode 100644 srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..54191222f4a6
--- /dev/null
+++ b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/avr-gdb/template b/srcpkgs/avr-gdb/template
index 2635f382fce7..86db674fe656 100644
--- a/srcpkgs/avr-gdb/template
+++ b/srcpkgs/avr-gdb/template
@@ -1,79 +1,39 @@
 # Template file for 'avr-gdb'
 pkgname=avr-gdb
 version=10.1
-revision=1
+revision=2
 wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/gdb/python"
-configure_args="\
-	--target=avr \
-	--program-prefix=avr- \
-	--disable-werror \
-	--disable-nls \
-	--with-system-readline \
-	--with-system-gdbinit=/etc/gdb/gdbinit \
-	--with-system-zlib $(vopt_enable gdbserver) \
-	$(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static') \
-	$(vopt_if python --with-python=/usr/bin/python3)"
-hostmakedepends="texinfo perl $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
-	$(vopt_if python 'python3-devel gettext-libs')"
-depends=gdb
+configure_args="--disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
+ $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
+ --target=avr"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python python3-devel)"
+depends="gdb-common"
 short_desc="GNU Debugger for AVR"
 maintainer="Artur Sinila <opensource@logarithmus.dev>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
+homepage="https://www.gnu.org/software/gdb"
 distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
-python_version=3
+make_check=no  # See gdb/template.
 replaces="cross-avr-gdb>=0"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
-# Package build options
-build_options="gdbserver static python"
-desc_option_gdbserver="Enable support for building GDB server"
-# By default, don't enable any of build options
-#build_options_default="gdbserver"
-# Both options cannot be enabled at the same time
-vopt_conflict gdbserver static
-
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
 
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
-	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/include ${DESTDIR}/usr/lib
-	rm -rf ${DESTDIR}/usr/lib64
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
-}
+# Package build options
+build_options="static python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -rf ${DESTDIR}/usr/{share/{gdb,info},include}
 }

From 90d8adea8b91c60c0942e1e2393a1e851dd7b915 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:14:22 +1100
Subject: [PATCH 3/3] cross-arm-none-eabi-gdb: update to 10.1, clean up

---
 .../patches/gdb-mips-linux-nat.patch          | 11 +++
 srcpkgs/cross-arm-none-eabi-gdb/template      | 68 ++++++++-----------
 2 files changed, 41 insertions(+), 38 deletions(-)
 create mode 100644 srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..54191222f4a6
--- /dev/null
+++ b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/cross-arm-none-eabi-gdb/template b/srcpkgs/cross-arm-none-eabi-gdb/template
index 798295baef89..9dce420b545b 100644
--- a/srcpkgs/cross-arm-none-eabi-gdb/template
+++ b/srcpkgs/cross-arm-none-eabi-gdb/template
@@ -1,46 +1,38 @@
-# Template file for 'cross-${_triplet}-${_pkgname}'
-_triplet=arm-none-eabi
-_pkgname=gdb
-pkgname=cross-${_triplet}-${_pkgname}
-version=8.3
+# Template file for 'cross-arm-none-eabi-gdb'
+pkgname=cross-arm-none-eabi-gdb
+version=10.1
 revision=1
-wrksrc="${_pkgname}-${version}"
+wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/${_pkgname}"
-configure_args="
- --disable-gdbserver
- --disable-nls
- --disable-werror
- --host=${XBPS_CROSS_TRIPLE}
- --prefix=/usr
- --target=${_triplet}
- --with-babeltrace
- --with-expat
- --with-mpfr
- --with-system-readline
- --with-system-zlib
- --without-isl
- $(vopt_with guile)
- $(vopt_with python)
-"
-hostmakedepends="autoconf automake bison flex pkg-config texinfo"
-makedepends="babeltrace-devel expat-devel mpfr-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel) $(vopt_if python 'python3-devel gettext-libs')"
-short_desc="GNU Debugger"
+configure_args="--disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib --without-isl
+ $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
+ --target=arm-none-eabi"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python python3-devel) babeltrace-devel mpfr-devel"
+depends="gdb-common"
+short_desc="GNU Debugger for ARM"
 maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/${_pkgname}"
-distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}.tar.xz"
-checksum=802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e
-python_version=2 #unverified
-build_options="guile python"
-# don't enable guile and python interfaces until they are moved into
-# platform independent packages
-build_options_default=" "
-nocross=yes
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
+checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=no  # See gdb/template.
 
-CFLAGS="-fcommon"
+if [ "${CROSS_BUILD}" ]; then
+	# Make python3.x detection work in cross builds
+	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
+fi
+
+# Package build options
+build_options="static guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr ${DESTDIR}/usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -rf ${DESTDIR}/usr/{share/{gdb,info},include}
 }

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR PATCH] [Updated] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (4 preceding siblings ...)
  2021-03-18  9:46 ` unspecd
@ 2021-03-28  0:46 ` unspecd
  2021-04-04 23:11 ` [PR REVIEW] " ericonr
                   ` (46 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-03-28  0:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]

There is an updated pull request by unspecd against master on the void-packages repository

https://github.com/unspecd/void-packages gdb
https://github.com/void-linux/void-packages/pull/29382

gdb: clean up templates
Improved consistency across templates.

Also:
- Fixed `post_install` in srcpkgs/avr-gdb.
- Added build option for Guile.
- Updated cross-arm-none-eabi-gdb to 10.1.

<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, x86_64-musl
- [x] I built this PR locally for these architectures:
  - [x] aarch64
  - [x] aarch64-musl
  - [x] armv7l
  - [ ] ppc
  - [ ] ppc-musl


A patch file from https://github.com/void-linux/void-packages/pull/29382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gdb-29382.patch --]
[-- Type: text/x-diff, Size: 13310 bytes --]

From 670b1385ded0625817504794df0403c50f138346 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Wed, 10 Mar 2021 23:26:08 +1100
Subject: [PATCH 1/3] gdb: clean up

---
 srcpkgs/gdb-common                           |  1 +
 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch | 11 ++++
 srcpkgs/gdb/template                         | 63 +++++++++-----------
 3 files changed, 41 insertions(+), 34 deletions(-)
 create mode 120000 srcpkgs/gdb-common
 create mode 100644 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/gdb-common b/srcpkgs/gdb-common
new file mode 120000
index 000000000000..f3e03e3f1a44
--- /dev/null
+++ b/srcpkgs/gdb-common
@@ -0,0 +1 @@
+gdb
\ No newline at end of file
diff --git a/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 64787a9ade34..1e67bf9d2019 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,36 +1,45 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=10.1
-revision=3
+revision=4
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
  --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib $(vopt_enable gdbserver)
  $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
- $(vopt_if python --with-python=/usr/bin/python3)
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
  $(vopt_with debuginfod)"
-hostmakedepends="texinfo perl pkg-config $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
- $(vopt_if python 'python3-devel gettext-devel')
- $(vopt_if debuginfod elfutils-devel)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') $(vopt_if debuginfod elfutils-devel)"
+depends="gdb-common-${version}_${revision}"
+checkdepends="dejagnu"
 short_desc="GNU Debugger"
 maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
-distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=extended  # Tests take too long, not all of them pass.
 python_version=3
 patch_args="-Np1"
+ignore_elf_files="
+ /usr/share/gdb/guile/gdb/support.go
+ /usr/share/gdb/guile/gdb/experimental.go
+ /usr/share/gdb/guile/gdb/iterator.go
+ /usr/share/gdb/guile/gdb/types.go
+ /usr/share/gdb/guile/gdb/printing.go
+ /usr/share/gdb/guile/gdb.go"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
+
 # Package build options
-build_options="gdbserver static python debuginfod"
+build_options="debuginfod gdbserver guile python static"
 desc_option_gdbserver="Enable support for building GDB server"
 desc_option_debuginfod="Enable support for libdebuginfod"
 # Enable gdbserver if !static.
@@ -38,28 +47,14 @@ build_options_default="gdbserver python debuginfod"
 # Both options cannot be enabled at the same time
 vopt_conflict gdbserver static
 
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
+post_install() {
 	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/{include,lib,lib64}
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
+	rm -rf ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+}
+
+gdb-common_package() {
+	short_desc+=" - common files"
+	pkg_install() {
+		vmove usr/share
+	}
 }

From c9b849c2fb37cde3d4e4c1cb9e75d5afd1d65679 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:12:29 +1100
Subject: [PATCH 2/3] avr-gdb: clean up

---
 .../avr-gdb/patches/gdb-mips-linux-nat.patch  | 11 +++
 srcpkgs/avr-gdb/template                      | 74 +++++--------------
 2 files changed, 28 insertions(+), 57 deletions(-)
 create mode 100644 srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..54191222f4a6
--- /dev/null
+++ b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/avr-gdb/template b/srcpkgs/avr-gdb/template
index 73d9f9ac7456..7f267e1a3c9e 100644
--- a/srcpkgs/avr-gdb/template
+++ b/srcpkgs/avr-gdb/template
@@ -1,79 +1,39 @@
 # Template file for 'avr-gdb'
 pkgname=avr-gdb
 version=10.1
-revision=1
+revision=2
 wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/gdb/python"
-configure_args="\
-	--target=avr \
-	--program-prefix=avr- \
-	--disable-werror \
-	--disable-nls \
-	--with-system-readline \
-	--with-system-gdbinit=/etc/gdb/gdbinit \
-	--with-system-zlib $(vopt_enable gdbserver) \
-	$(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static') \
-	$(vopt_if python --with-python=/usr/bin/python3)"
-hostmakedepends="texinfo perl $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
+configure_args="--disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
+ $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
+ --target=avr"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
  $(vopt_if python 'python3-devel gettext-devel')"
-depends=gdb
+depends="gdb-common"
 short_desc="GNU Debugger for AVR"
 maintainer="Artur Sinila <opensource@logarithmus.dev>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
+homepage="https://www.gnu.org/software/gdb"
 distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
-python_version=3
+make_check=no  # See gdb/template.
 replaces="cross-avr-gdb>=0"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
-# Package build options
-build_options="gdbserver static python"
-desc_option_gdbserver="Enable support for building GDB server"
-# By default, don't enable any of build options
-#build_options_default="gdbserver"
-# Both options cannot be enabled at the same time
-vopt_conflict gdbserver static
-
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
 
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
-	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/include ${DESTDIR}/usr/lib
-	rm -rf ${DESTDIR}/usr/lib64
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
-}
+# Package build options
+build_options="static python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -rf ${DESTDIR}/usr/{share/{gdb,info},include}
 }

From 6305813621d869b4762a53e1340437798d640d95 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:14:22 +1100
Subject: [PATCH 3/3] cross-arm-none-eabi-gdb: update to 10.1, clean up

---
 .../patches/gdb-mips-linux-nat.patch          | 11 +++
 srcpkgs/cross-arm-none-eabi-gdb/template      | 70 ++++++++-----------
 2 files changed, 41 insertions(+), 40 deletions(-)
 create mode 100644 srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..54191222f4a6
--- /dev/null
+++ b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/cross-arm-none-eabi-gdb/template b/srcpkgs/cross-arm-none-eabi-gdb/template
index ac8e6837d72c..7caf6428fef1 100644
--- a/srcpkgs/cross-arm-none-eabi-gdb/template
+++ b/srcpkgs/cross-arm-none-eabi-gdb/template
@@ -1,48 +1,38 @@
-# Template file for 'cross-${_triplet}-${_pkgname}'
-_triplet=arm-none-eabi
-_pkgname=gdb
-pkgname=cross-${_triplet}-${_pkgname}
-version=8.3
+# Template file for 'cross-arm-none-eabi-gdb'
+pkgname=cross-arm-none-eabi-gdb
+version=10.1
 revision=1
-wrksrc="${_pkgname}-${version}"
+wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/${_pkgname}"
-configure_args="
- --disable-gdbserver
- --disable-nls
- --disable-werror
- --host=${XBPS_CROSS_TRIPLE}
- --prefix=/usr
- --target=${_triplet}
- --with-babeltrace
- --with-expat
- --with-mpfr
- --with-system-readline
- --with-system-zlib
- --without-isl
- $(vopt_with guile)
- $(vopt_with python)
-"
-hostmakedepends="autoconf automake bison flex pkg-config texinfo"
-makedepends="babeltrace-devel expat-devel mpfr-devel ncurses-devel
- readline-devel zlib-devel $(vopt_if guile guile-devel)
- $(vopt_if python 'python3-devel gettext-devel')"
-short_desc="GNU Debugger"
+configure_args="--disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib --without-isl
+ $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
+ --target=arm-none-eabi"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') babeltrace-devel mpfr-devel"
+depends="gdb-common"
+short_desc="GNU Debugger for ARM"
 maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/${_pkgname}"
-distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}.tar.xz"
-checksum=802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e
-python_version=2 #unverified
-build_options="guile python"
-# don't enable guile and python interfaces until they are moved into
-# platform independent packages
-build_options_default=" "
-nocross=yes
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
+checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=no  # See gdb/template.
 
-CFLAGS="-fcommon"
+if [ "${CROSS_BUILD}" ]; then
+	# Make python3.x detection work in cross builds
+	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
+fi
+
+# Package build options
+build_options="static guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr ${DESTDIR}/usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -rf ${DESTDIR}/usr/{share/{gdb,info},include}
 }

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (5 preceding siblings ...)
  2021-03-28  0:46 ` unspecd
@ 2021-04-04 23:11 ` ericonr
  2021-04-11  4:19 ` ericonr
                   ` (45 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-04 23:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r606865403

Comment:
IMO remove `static` build option, should simplify it further.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (6 preceding siblings ...)
  2021-04-04 23:11 ` [PR REVIEW] " ericonr
@ 2021-04-11  4:19 ` ericonr
  2021-04-11  4:19 ` ericonr
                   ` (44 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-11  4:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 211 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r611127785

Comment:
```suggestion
depends="gdb-common>=${version}_${revision}"
```

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (7 preceding siblings ...)
  2021-04-11  4:19 ` ericonr
@ 2021-04-11  4:19 ` ericonr
  2021-04-11  4:19 ` ericonr
                   ` (43 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-11  4:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 215 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r611127710

Comment:
Yeah this one can drop static too... Sorry for not noticing earlier.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (10 preceding siblings ...)
  2021-04-11  4:19 ` ericonr
@ 2021-04-11  4:19 ` ericonr
  2021-04-14  3:49 ` [PR PATCH] [Updated] " unspecd
                   ` (40 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-11  4:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 241 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r611127980

Comment:
Why not remove `configure` and `standards`?

Also, if possible, use `rm -r` instead of `-rf`

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (8 preceding siblings ...)
  2021-04-11  4:19 ` ericonr
@ 2021-04-11  4:19 ` ericonr
  2021-04-11  4:19 ` ericonr
                   ` (42 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-11  4:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 184 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r611127830

Comment:
Makes sense to reorder these as well?

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (9 preceding siblings ...)
  2021-04-11  4:19 ` ericonr
@ 2021-04-11  4:19 ` ericonr
  2021-04-11  4:19 ` ericonr
                   ` (41 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-11  4:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 199 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r611127887

Comment:
commit should mention addition of guile build option

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR PATCH] [Updated] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (11 preceding siblings ...)
  2021-04-11  4:19 ` ericonr
@ 2021-04-14  3:49 ` unspecd
  2021-04-14  3:56 ` [PR REVIEW] " unspecd
                   ` (39 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-14  3:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]

There is an updated pull request by unspecd against master on the void-packages repository

https://github.com/unspecd/void-packages gdb
https://github.com/void-linux/void-packages/pull/29382

gdb: clean up templates
Improved consistency across templates.

Also:
- Fixed `post_install` in srcpkgs/avr-gdb.
- Added build option for Guile.
- Updated cross-arm-none-eabi-gdb to 10.1.

<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, x86_64-musl
- [x] I built this PR locally for these architectures:
  - [x] aarch64
  - [x] aarch64-musl
  - [x] armv7l
  - [ ] ppc
  - [ ] ppc-musl


A patch file from https://github.com/void-linux/void-packages/pull/29382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gdb-29382.patch --]
[-- Type: text/x-diff, Size: 13156 bytes --]

From 52f4ff6150e730c25e010424df89a02802d6a4f7 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Wed, 10 Mar 2021 23:26:08 +1100
Subject: [PATCH 1/3] gdb: clean up

---
 srcpkgs/gdb-common                           |  1 +
 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch | 11 ++++
 srcpkgs/gdb/template                         | 63 +++++++++-----------
 3 files changed, 41 insertions(+), 34 deletions(-)
 create mode 120000 srcpkgs/gdb-common
 create mode 100644 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/gdb-common b/srcpkgs/gdb-common
new file mode 120000
index 000000000000..f3e03e3f1a44
--- /dev/null
+++ b/srcpkgs/gdb-common
@@ -0,0 +1 @@
+gdb
\ No newline at end of file
diff --git a/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 64787a9ade34..f397a4c4d985 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,36 +1,45 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=10.1
-revision=3
+revision=4
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
  --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib $(vopt_enable gdbserver)
  $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
- $(vopt_if python --with-python=/usr/bin/python3)
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
  $(vopt_with debuginfod)"
-hostmakedepends="texinfo perl pkg-config $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
- $(vopt_if python 'python3-devel gettext-devel')
- $(vopt_if debuginfod elfutils-devel)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') $(vopt_if debuginfod elfutils-devel)"
+depends="gdb-common>=${version}_${revision}"
+checkdepends="dejagnu"
 short_desc="GNU Debugger"
 maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
-distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=extended  # Tests take too long, not all of them pass.
 python_version=3
 patch_args="-Np1"
+ignore_elf_files="
+ /usr/share/gdb/guile/gdb/support.go
+ /usr/share/gdb/guile/gdb/experimental.go
+ /usr/share/gdb/guile/gdb/iterator.go
+ /usr/share/gdb/guile/gdb/types.go
+ /usr/share/gdb/guile/gdb/printing.go
+ /usr/share/gdb/guile/gdb.go"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
+
 # Package build options
-build_options="gdbserver static python debuginfod"
+build_options="debuginfod gdbserver guile python static"
 desc_option_gdbserver="Enable support for building GDB server"
 desc_option_debuginfod="Enable support for libdebuginfod"
 # Enable gdbserver if !static.
@@ -38,28 +47,14 @@ build_options_default="gdbserver python debuginfod"
 # Both options cannot be enabled at the same time
 vopt_conflict gdbserver static
 
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
+post_install() {
 	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/{include,lib,lib64}
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
+	rm -f ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+}
+
+gdb-common_package() {
+	short_desc+=" - common files"
+	pkg_install() {
+		vmove usr/share
+	}
 }

From f61cbf62c207b875bc6d7e1c632b850ab11d847e Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:12:29 +1100
Subject: [PATCH 2/3] avr-gdb: clean up

---
 .../avr-gdb/patches/gdb-mips-linux-nat.patch  | 11 +++
 srcpkgs/avr-gdb/template                      | 73 ++++---------------
 2 files changed, 27 insertions(+), 57 deletions(-)
 create mode 100644 srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..54191222f4a6
--- /dev/null
+++ b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/avr-gdb/template b/srcpkgs/avr-gdb/template
index 73d9f9ac7456..a9ba1e8bc0d5 100644
--- a/srcpkgs/avr-gdb/template
+++ b/srcpkgs/avr-gdb/template
@@ -1,79 +1,38 @@
 # Template file for 'avr-gdb'
 pkgname=avr-gdb
 version=10.1
-revision=1
+revision=2
 wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/gdb/python"
-configure_args="\
-	--target=avr \
-	--program-prefix=avr- \
-	--disable-werror \
-	--disable-nls \
-	--with-system-readline \
-	--with-system-gdbinit=/etc/gdb/gdbinit \
-	--with-system-zlib $(vopt_enable gdbserver) \
-	$(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static') \
-	$(vopt_if python --with-python=/usr/bin/python3)"
-hostmakedepends="texinfo perl $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
+configure_args="--disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
+ --target=avr"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
  $(vopt_if python 'python3-devel gettext-devel')"
-depends=gdb
+depends="gdb-common"
 short_desc="GNU Debugger for AVR"
 maintainer="Artur Sinila <opensource@logarithmus.dev>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
+homepage="https://www.gnu.org/software/gdb"
 distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
-python_version=3
+make_check=no  # See gdb/template.
 replaces="cross-avr-gdb>=0"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
-# Package build options
-build_options="gdbserver static python"
-desc_option_gdbserver="Enable support for building GDB server"
-# By default, don't enable any of build options
-#build_options_default="gdbserver"
-# Both options cannot be enabled at the same time
-vopt_conflict gdbserver static
-
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
 
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
-	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/include ${DESTDIR}/usr/lib
-	rm -rf ${DESTDIR}/usr/lib64
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
-}
+# Package build options
+build_options="python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -rf ${DESTDIR}/usr/{share/{gdb,info},include}
 }

From 9c9c6c1350d8511d1e4fcb9dc650c1ce902581cc Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:14:22 +1100
Subject: [PATCH 3/3] cross-arm-none-eabi-gdb: update to 10.1, clean up

---
 .../patches/gdb-mips-linux-nat.patch          | 11 +++
 srcpkgs/cross-arm-none-eabi-gdb/template      | 69 ++++++++-----------
 2 files changed, 40 insertions(+), 40 deletions(-)
 create mode 100644 srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..54191222f4a6
--- /dev/null
+++ b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/cross-arm-none-eabi-gdb/template b/srcpkgs/cross-arm-none-eabi-gdb/template
index ac8e6837d72c..b7648d4410d4 100644
--- a/srcpkgs/cross-arm-none-eabi-gdb/template
+++ b/srcpkgs/cross-arm-none-eabi-gdb/template
@@ -1,48 +1,37 @@
-# Template file for 'cross-${_triplet}-${_pkgname}'
-_triplet=arm-none-eabi
-_pkgname=gdb
-pkgname=cross-${_triplet}-${_pkgname}
-version=8.3
+# Template file for 'cross-arm-none-eabi-gdb'
+pkgname=cross-arm-none-eabi-gdb
+version=10.1
 revision=1
-wrksrc="${_pkgname}-${version}"
+wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/${_pkgname}"
-configure_args="
- --disable-gdbserver
- --disable-nls
- --disable-werror
- --host=${XBPS_CROSS_TRIPLE}
- --prefix=/usr
- --target=${_triplet}
- --with-babeltrace
- --with-expat
- --with-mpfr
- --with-system-readline
- --with-system-zlib
- --without-isl
- $(vopt_with guile)
- $(vopt_with python)
-"
-hostmakedepends="autoconf automake bison flex pkg-config texinfo"
-makedepends="babeltrace-devel expat-devel mpfr-devel ncurses-devel
- readline-devel zlib-devel $(vopt_if guile guile-devel)
- $(vopt_if python 'python3-devel gettext-devel')"
-short_desc="GNU Debugger"
+configure_args="--disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib --without-isl
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
+ --target=arm-none-eabi"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') babeltrace-devel mpfr-devel"
+depends="gdb-common"
+short_desc="GNU Debugger for ARM"
 maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/${_pkgname}"
-distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}.tar.xz"
-checksum=802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e
-python_version=2 #unverified
-build_options="guile python"
-# don't enable guile and python interfaces until they are moved into
-# platform independent packages
-build_options_default=" "
-nocross=yes
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
+checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=no  # See gdb/template.
+
+if [ "${CROSS_BUILD}" ]; then
+	# Make python3.x detection work in cross builds
+	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
+fi
 
-CFLAGS="-fcommon"
+# Package build options
+build_options="guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr ${DESTDIR}/usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -rf ${DESTDIR}/usr/{share/{gdb,info},include}
 }

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (12 preceding siblings ...)
  2021-04-14  3:49 ` [PR PATCH] [Updated] " unspecd
@ 2021-04-14  3:56 ` unspecd
  2021-04-14  3:57 ` unspecd
                   ` (38 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-14  3:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r612919290

Comment:
> Why not remove configure and standards?

These files just don't exist.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (13 preceding siblings ...)
  2021-04-14  3:56 ` [PR REVIEW] " unspecd
@ 2021-04-14  3:57 ` unspecd
  2021-04-14  4:04 ` [PR PATCH] [Updated] " unspecd
                   ` (37 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-14  3:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 153 bytes --]

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r612919557

Comment:
Fixed.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR PATCH] [Updated] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (14 preceding siblings ...)
  2021-04-14  3:57 ` unspecd
@ 2021-04-14  4:04 ` unspecd
  2021-04-14  5:09 ` [PR REVIEW] " unspecd
                   ` (36 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-14  4:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]

There is an updated pull request by unspecd against master on the void-packages repository

https://github.com/unspecd/void-packages gdb
https://github.com/void-linux/void-packages/pull/29382

gdb: clean up templates
Improved consistency across templates.

Also:
- Fixed `post_install` in srcpkgs/avr-gdb.
- Added build option for Guile.
- Updated cross-arm-none-eabi-gdb to 10.1.

<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, x86_64-musl
- [x] I built this PR locally for these architectures:
  - [x] aarch64
  - [x] aarch64-musl
  - [x] armv7l
  - [ ] ppc
  - [ ] ppc-musl


A patch file from https://github.com/void-linux/void-packages/pull/29382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gdb-29382.patch --]
[-- Type: text/x-diff, Size: 13191 bytes --]

From 298b71e7c2deaafd0824742dad54c11a3c505d50 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Wed, 10 Mar 2021 23:26:08 +1100
Subject: [PATCH 1/3] gdb: clean up

Also added build option for Guile.
---
 srcpkgs/gdb-common                           |  1 +
 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch | 11 ++++
 srcpkgs/gdb/template                         | 63 +++++++++-----------
 3 files changed, 41 insertions(+), 34 deletions(-)
 create mode 120000 srcpkgs/gdb-common
 create mode 100644 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/gdb-common b/srcpkgs/gdb-common
new file mode 120000
index 000000000000..f3e03e3f1a44
--- /dev/null
+++ b/srcpkgs/gdb-common
@@ -0,0 +1 @@
+gdb
\ No newline at end of file
diff --git a/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 64787a9ade34..f8feba70f125 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,36 +1,45 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=10.1
-revision=3
+revision=4
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
  --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib $(vopt_enable gdbserver)
  $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
- $(vopt_if python --with-python=/usr/bin/python3)
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
  $(vopt_with debuginfod)"
-hostmakedepends="texinfo perl pkg-config $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
- $(vopt_if python 'python3-devel gettext-devel')
- $(vopt_if debuginfod elfutils-devel)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') $(vopt_if debuginfod elfutils-devel)"
+depends="gdb-common>=${version}_${revision}"
+checkdepends="dejagnu"
 short_desc="GNU Debugger"
 maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
-distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=extended  # Tests take too long, not all of them pass.
 python_version=3
 patch_args="-Np1"
+ignore_elf_files="
+ /usr/share/gdb/guile/gdb/support.go
+ /usr/share/gdb/guile/gdb/experimental.go
+ /usr/share/gdb/guile/gdb/iterator.go
+ /usr/share/gdb/guile/gdb/types.go
+ /usr/share/gdb/guile/gdb/printing.go
+ /usr/share/gdb/guile/gdb.go"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
+
 # Package build options
-build_options="gdbserver static python debuginfod"
+build_options="debuginfod gdbserver guile python static"
 desc_option_gdbserver="Enable support for building GDB server"
 desc_option_debuginfod="Enable support for libdebuginfod"
 # Enable gdbserver if !static.
@@ -38,28 +47,14 @@ build_options_default="gdbserver python debuginfod"
 # Both options cannot be enabled at the same time
 vopt_conflict gdbserver static
 
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
+post_install() {
 	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/{include,lib,lib64}
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
+	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+}
+
+gdb-common_package() {
+	short_desc+=" - common files"
+	pkg_install() {
+		vmove usr/share
+	}
 }

From fee272a313cd4d3df6f51ab296adbeaa079d9eee Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:12:29 +1100
Subject: [PATCH 2/3] avr-gdb: clean up

---
 .../avr-gdb/patches/gdb-mips-linux-nat.patch  | 11 +++
 srcpkgs/avr-gdb/template                      | 73 ++++---------------
 2 files changed, 27 insertions(+), 57 deletions(-)
 create mode 100644 srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..54191222f4a6
--- /dev/null
+++ b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/avr-gdb/template b/srcpkgs/avr-gdb/template
index 73d9f9ac7456..a9ba1e8bc0d5 100644
--- a/srcpkgs/avr-gdb/template
+++ b/srcpkgs/avr-gdb/template
@@ -1,79 +1,38 @@
 # Template file for 'avr-gdb'
 pkgname=avr-gdb
 version=10.1
-revision=1
+revision=2
 wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/gdb/python"
-configure_args="\
-	--target=avr \
-	--program-prefix=avr- \
-	--disable-werror \
-	--disable-nls \
-	--with-system-readline \
-	--with-system-gdbinit=/etc/gdb/gdbinit \
-	--with-system-zlib $(vopt_enable gdbserver) \
-	$(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static') \
-	$(vopt_if python --with-python=/usr/bin/python3)"
-hostmakedepends="texinfo perl $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
+configure_args="--disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
+ --target=avr"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
  $(vopt_if python 'python3-devel gettext-devel')"
-depends=gdb
+depends="gdb-common"
 short_desc="GNU Debugger for AVR"
 maintainer="Artur Sinila <opensource@logarithmus.dev>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
+homepage="https://www.gnu.org/software/gdb"
 distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
-python_version=3
+make_check=no  # See gdb/template.
 replaces="cross-avr-gdb>=0"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
-# Package build options
-build_options="gdbserver static python"
-desc_option_gdbserver="Enable support for building GDB server"
-# By default, don't enable any of build options
-#build_options_default="gdbserver"
-# Both options cannot be enabled at the same time
-vopt_conflict gdbserver static
-
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
 
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
-	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/include ${DESTDIR}/usr/lib
-	rm -rf ${DESTDIR}/usr/lib64
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
-}
+# Package build options
+build_options="python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -rf ${DESTDIR}/usr/{share/{gdb,info},include}
 }

From 0237a33499fe01950619657bef0e6c6f96847c38 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:14:22 +1100
Subject: [PATCH 3/3] cross-arm-none-eabi-gdb: update to 10.1, clean up

---
 .../patches/gdb-mips-linux-nat.patch          | 11 +++
 srcpkgs/cross-arm-none-eabi-gdb/template      | 69 ++++++++-----------
 2 files changed, 40 insertions(+), 40 deletions(-)
 create mode 100644 srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..54191222f4a6
--- /dev/null
+++ b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/cross-arm-none-eabi-gdb/template b/srcpkgs/cross-arm-none-eabi-gdb/template
index ac8e6837d72c..b7648d4410d4 100644
--- a/srcpkgs/cross-arm-none-eabi-gdb/template
+++ b/srcpkgs/cross-arm-none-eabi-gdb/template
@@ -1,48 +1,37 @@
-# Template file for 'cross-${_triplet}-${_pkgname}'
-_triplet=arm-none-eabi
-_pkgname=gdb
-pkgname=cross-${_triplet}-${_pkgname}
-version=8.3
+# Template file for 'cross-arm-none-eabi-gdb'
+pkgname=cross-arm-none-eabi-gdb
+version=10.1
 revision=1
-wrksrc="${_pkgname}-${version}"
+wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/${_pkgname}"
-configure_args="
- --disable-gdbserver
- --disable-nls
- --disable-werror
- --host=${XBPS_CROSS_TRIPLE}
- --prefix=/usr
- --target=${_triplet}
- --with-babeltrace
- --with-expat
- --with-mpfr
- --with-system-readline
- --with-system-zlib
- --without-isl
- $(vopt_with guile)
- $(vopt_with python)
-"
-hostmakedepends="autoconf automake bison flex pkg-config texinfo"
-makedepends="babeltrace-devel expat-devel mpfr-devel ncurses-devel
- readline-devel zlib-devel $(vopt_if guile guile-devel)
- $(vopt_if python 'python3-devel gettext-devel')"
-short_desc="GNU Debugger"
+configure_args="--disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib --without-isl
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
+ --target=arm-none-eabi"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') babeltrace-devel mpfr-devel"
+depends="gdb-common"
+short_desc="GNU Debugger for ARM"
 maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/${_pkgname}"
-distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}.tar.xz"
-checksum=802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e
-python_version=2 #unverified
-build_options="guile python"
-# don't enable guile and python interfaces until they are moved into
-# platform independent packages
-build_options_default=" "
-nocross=yes
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
+checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=no  # See gdb/template.
+
+if [ "${CROSS_BUILD}" ]; then
+	# Make python3.x detection work in cross builds
+	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" libatomic_ops-devel" # guile
+fi
 
-CFLAGS="-fcommon"
+# Package build options
+build_options="guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr ${DESTDIR}/usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -rf ${DESTDIR}/usr/{share/{gdb,info},include}
 }

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (15 preceding siblings ...)
  2021-04-14  4:04 ` [PR PATCH] [Updated] " unspecd
@ 2021-04-14  5:09 ` unspecd
  2021-04-14  5:15 ` ericonr
                   ` (35 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-14  5:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 206 bytes --]

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r612939905

Comment:
It's just personal preference :) Should I undo the changes?

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (16 preceding siblings ...)
  2021-04-14  5:09 ` [PR REVIEW] " unspecd
@ 2021-04-14  5:15 ` ericonr
  2021-04-14  5:15 ` ericonr
                   ` (34 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-14  5:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 158 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r612940933

Comment:
Use `rm -r`

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (19 preceding siblings ...)
  2021-04-14  5:15 ` ericonr
@ 2021-04-14  5:15 ` ericonr
  2021-04-14  5:15 ` ericonr
                   ` (31 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-14  5:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 287 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r612941315

Comment:
For consistency, I'd rather have target as the first configure arg and leave the optional ones for last; this applies for all the templates.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (18 preceding siblings ...)
  2021-04-14  5:15 ` ericonr
@ 2021-04-14  5:15 ` ericonr
  2021-04-14  5:15 ` ericonr
                   ` (32 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-14  5:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r612940451

Comment:
If you are adding the guile build option, it should be listed here :p

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (17 preceding siblings ...)
  2021-04-14  5:15 ` ericonr
@ 2021-04-14  5:15 ` ericonr
  2021-04-14  5:15 ` ericonr
                   ` (33 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-14  5:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 424 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r612939332

Comment:
`makedepends` should be unconditional, most of the time. Are you sure this isn't because you were cross building for a target like `armv6l`, which fits under our `XBPS_TARGET_NO_ATOMIC8` conditional?

Anyway, if this is guile related it should also be hidden behind `vopt_if`

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (21 preceding siblings ...)
  2021-04-14  5:15 ` ericonr
@ 2021-04-14  5:15 ` ericonr
  2021-04-14  5:15 ` ericonr
                   ` (29 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-14  5:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 165 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r612941416

Comment:
same note as above

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (20 preceding siblings ...)
  2021-04-14  5:15 ` ericonr
@ 2021-04-14  5:15 ` ericonr
  2021-04-14  5:15 ` ericonr
                   ` (30 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-14  5:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 276 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r612941731

Comment:
For consistency, I'd make the other packages use the same patch format.

Not really a requirement, though, mostly a suggestion.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (22 preceding siblings ...)
  2021-04-14  5:15 ` ericonr
@ 2021-04-14  5:15 ` ericonr
  2021-04-14  5:17 ` ericonr
                   ` (28 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-14  5:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 449 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r612939332

Comment:
`makedepends` should be unconditional (regarding cross builds), most of the time. Are you sure this isn't because you were cross building for a target like `armv6l`, which fits under our `XBPS_TARGET_NO_ATOMIC8` conditional?

Anyway, if this is guile related it should also be hidden behind `vopt_if`

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (23 preceding siblings ...)
  2021-04-14  5:15 ` ericonr
@ 2021-04-14  5:17 ` ericonr
  2021-04-14  5:17 ` ericonr
                   ` (27 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-14  5:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 286 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r612942602

Comment:
I don't think undoing is necessary; just suggesting keeping `default` in the same order as `build_options`. Alphabetical is as good as any.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (24 preceding siblings ...)
  2021-04-14  5:17 ` ericonr
@ 2021-04-14  5:17 ` ericonr
  2021-04-14 11:39 ` [PR PATCH] [Updated] " unspecd
                   ` (26 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-14  5:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 286 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r612942630

Comment:
I don't think undoing is necessary; just suggesting keeping `default` in the same order as `build_options`. Alphabetical is as good as any.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR PATCH] [Updated] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (25 preceding siblings ...)
  2021-04-14  5:17 ` ericonr
@ 2021-04-14 11:39 ` unspecd
  2021-04-14 11:40 ` [PR REVIEW] " unspecd
                   ` (25 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-14 11:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]

There is an updated pull request by unspecd against master on the void-packages repository

https://github.com/unspecd/void-packages gdb
https://github.com/void-linux/void-packages/pull/29382

gdb: clean up templates
Improved consistency across templates.

Also:
- Fixed `post_install` in srcpkgs/avr-gdb.
- Added build option for Guile.
- Updated cross-arm-none-eabi-gdb to 10.1.

<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, x86_64-musl
- [x] I built this PR locally for these architectures:
  - [x] aarch64
  - [x] aarch64-musl
  - [x] armv7l
  - [ ] ppc
  - [x] ppc-musl


A patch file from https://github.com/void-linux/void-packages/pull/29382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gdb-29382.patch --]
[-- Type: text/x-diff, Size: 13287 bytes --]

From 3522b71abafe5c98714d800bbb292fa6d837c951 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Wed, 10 Mar 2021 23:26:08 +1100
Subject: [PATCH 1/3] gdb: clean up

Also added build option for Guile.
---
 srcpkgs/gdb-common                           |  1 +
 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch | 11 ++++
 srcpkgs/gdb/template                         | 65 +++++++++-----------
 3 files changed, 42 insertions(+), 35 deletions(-)
 create mode 120000 srcpkgs/gdb-common
 create mode 100644 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/gdb-common b/srcpkgs/gdb-common
new file mode 120000
index 000000000000..f3e03e3f1a44
--- /dev/null
+++ b/srcpkgs/gdb-common
@@ -0,0 +1 @@
+gdb
\ No newline at end of file
diff --git a/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 64787a9ade34..09cbe518c7df 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,65 +1,60 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=10.1
-revision=3
+revision=4
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
  --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib $(vopt_enable gdbserver)
  $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
- $(vopt_if python --with-python=/usr/bin/python3)
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
  $(vopt_with debuginfod)"
-hostmakedepends="texinfo perl pkg-config $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
- $(vopt_if python 'python3-devel gettext-devel')
- $(vopt_if debuginfod elfutils-devel)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') $(vopt_if debuginfod elfutils-devel)"
+depends="gdb-common>=${version}_${revision}"
+checkdepends="dejagnu"
 short_desc="GNU Debugger"
 maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
-distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=extended  # Tests take too long, not all of them pass.
 python_version=3
 patch_args="-Np1"
+ignore_elf_files="
+ /usr/share/gdb/guile/gdb/support.go
+ /usr/share/gdb/guile/gdb/experimental.go
+ /usr/share/gdb/guile/gdb/iterator.go
+ /usr/share/gdb/guile/gdb/types.go
+ /usr/share/gdb/guile/gdb/printing.go
+ /usr/share/gdb/guile/gdb.go"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" $(vopt_if guile libatomic_ops-devel)"
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
+
 # Package build options
-build_options="gdbserver static python debuginfod"
+build_options="debuginfod gdbserver guile python static"
 desc_option_gdbserver="Enable support for building GDB server"
 desc_option_debuginfod="Enable support for libdebuginfod"
 # Enable gdbserver if !static.
-build_options_default="gdbserver python debuginfod"
+build_options_default="debuginfod gdbserver python"
 # Both options cannot be enabled at the same time
 vopt_conflict gdbserver static
 
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
+post_install() {
 	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/{include,lib,lib64}
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
+	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+}
+
+gdb-common_package() {
+	short_desc+=" - common files"
+	pkg_install() {
+		vmove usr/share
+	}
 }

From a94e1d927576f20bb298cd2a8efbefa95cb63e6a Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:12:29 +1100
Subject: [PATCH 2/3] avr-gdb: clean up

Also added build option for Guile.
---
 .../avr-gdb/patches/gdb-mips-linux-nat.patch  | 11 +++
 srcpkgs/avr-gdb/template                      | 72 ++++---------------
 2 files changed, 26 insertions(+), 57 deletions(-)
 create mode 100644 srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..54191222f4a6
--- /dev/null
+++ b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/avr-gdb/template b/srcpkgs/avr-gdb/template
index 73d9f9ac7456..cd80ef3b0bbf 100644
--- a/srcpkgs/avr-gdb/template
+++ b/srcpkgs/avr-gdb/template
@@ -1,79 +1,37 @@
 # Template file for 'avr-gdb'
 pkgname=avr-gdb
 version=10.1
-revision=1
+revision=2
 wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/gdb/python"
-configure_args="\
-	--target=avr \
-	--program-prefix=avr- \
-	--disable-werror \
-	--disable-nls \
-	--with-system-readline \
-	--with-system-gdbinit=/etc/gdb/gdbinit \
-	--with-system-zlib $(vopt_enable gdbserver) \
-	$(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static') \
-	$(vopt_if python --with-python=/usr/bin/python3)"
-hostmakedepends="texinfo perl $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
+configure_args="--target=avr --disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
  $(vopt_if python 'python3-devel gettext-devel')"
-depends=gdb
+depends="gdb-common"
 short_desc="GNU Debugger for AVR"
 maintainer="Artur Sinila <opensource@logarithmus.dev>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
+homepage="https://www.gnu.org/software/gdb"
 distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
-python_version=3
+make_check=no  # See gdb/template.
 replaces="cross-avr-gdb>=0"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" $(vopt_if guile libatomic_ops-devel)"
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
-# Package build options
-build_options="gdbserver static python"
-desc_option_gdbserver="Enable support for building GDB server"
-# By default, don't enable any of build options
-#build_options_default="gdbserver"
-# Both options cannot be enabled at the same time
-vopt_conflict gdbserver static
-
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
 
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
-	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/include ${DESTDIR}/usr/lib
-	rm -rf ${DESTDIR}/usr/lib64
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
-}
+# Package build options
+build_options="guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -r ${DESTDIR}/usr/{share/{gdb,info},include}
 }

From 435540818e0cc92dd785077a3bbed5aab42d1298 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:14:22 +1100
Subject: [PATCH 3/3] cross-arm-none-eabi-gdb: update to 10.1, clean up

---
 .../patches/gdb-mips-linux-nat.patch          | 11 +++
 srcpkgs/cross-arm-none-eabi-gdb/template      | 68 ++++++++-----------
 2 files changed, 39 insertions(+), 40 deletions(-)
 create mode 100644 srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..54191222f4a6
--- /dev/null
+++ b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- gdb/mips-linux-nat.c.orig
++++ gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/cross-arm-none-eabi-gdb/template b/srcpkgs/cross-arm-none-eabi-gdb/template
index ac8e6837d72c..aa3e72c4d936 100644
--- a/srcpkgs/cross-arm-none-eabi-gdb/template
+++ b/srcpkgs/cross-arm-none-eabi-gdb/template
@@ -1,48 +1,36 @@
-# Template file for 'cross-${_triplet}-${_pkgname}'
-_triplet=arm-none-eabi
-_pkgname=gdb
-pkgname=cross-${_triplet}-${_pkgname}
-version=8.3
+# Template file for 'cross-arm-none-eabi-gdb'
+pkgname=cross-arm-none-eabi-gdb
+version=10.1
 revision=1
-wrksrc="${_pkgname}-${version}"
+wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/${_pkgname}"
-configure_args="
- --disable-gdbserver
- --disable-nls
- --disable-werror
- --host=${XBPS_CROSS_TRIPLE}
- --prefix=/usr
- --target=${_triplet}
- --with-babeltrace
- --with-expat
- --with-mpfr
- --with-system-readline
- --with-system-zlib
- --without-isl
- $(vopt_with guile)
- $(vopt_with python)
-"
-hostmakedepends="autoconf automake bison flex pkg-config texinfo"
-makedepends="babeltrace-devel expat-devel mpfr-devel ncurses-devel
- readline-devel zlib-devel $(vopt_if guile guile-devel)
- $(vopt_if python 'python3-devel gettext-devel')"
-short_desc="GNU Debugger"
+configure_args="--target=arm-none-eabi --disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib --without-isl
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') babeltrace-devel mpfr-devel"
+depends="gdb-common"
+short_desc="GNU Debugger for ARM"
 maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/${_pkgname}"
-distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}.tar.xz"
-checksum=802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e
-python_version=2 #unverified
-build_options="guile python"
-# don't enable guile and python interfaces until they are moved into
-# platform independent packages
-build_options_default=" "
-nocross=yes
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
+checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=no  # See gdb/template.
+
+if [ "${CROSS_BUILD}" ]; then
+	# Make python3.x detection work in cross builds
+	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" $(vopt_if guile libatomic_ops-devel)"
+fi
 
-CFLAGS="-fcommon"
+# Package build options
+build_options="guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr ${DESTDIR}/usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -r ${DESTDIR}/usr/{share/{gdb,info},include}
 }

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (26 preceding siblings ...)
  2021-04-14 11:39 ` [PR PATCH] [Updated] " unspecd
@ 2021-04-14 11:40 ` unspecd
  2021-04-14 11:41 ` unspecd
                   ` (24 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-14 11:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 171 bytes --]

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r613170964

Comment:
Oh, missed that. Thanks!

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (27 preceding siblings ...)
  2021-04-14 11:40 ` [PR REVIEW] " unspecd
@ 2021-04-14 11:41 ` unspecd
  2021-04-14 11:52 ` unspecd
                   ` (23 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-14 11:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 220 bytes --]

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r613171655

Comment:
> suggesting keeping default in the same order as build_options

Fixed.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (28 preceding siblings ...)
  2021-04-14 11:41 ` unspecd
@ 2021-04-14 11:52 ` unspecd
  2021-04-14 12:10 ` unspecd
                   ` (22 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-14 11:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 301 bytes --]

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r613178663

Comment:
> That'd be nice to fix, but not now

I would prefer to do it in a separate pull request.

> Also, please use rm -r

Replaced `rm -rf` with `rm -r`.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (29 preceding siblings ...)
  2021-04-14 11:52 ` unspecd
@ 2021-04-14 12:10 ` unspecd
  2021-04-14 12:22 ` ericonr
                   ` (21 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-14 12:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1791 bytes --]

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r613190007

Comment:
Here is what I get without `libatomic_ops-devel`:

```console
$ ./xbps-src -a aarch64-musl -o guile pkg gdb
…
configure: error: in `/builddir/gdb-10.1/gdb':
configure: error: linking guile version guile-2.2 test program failed
See `config.log' for more details
make[1]: *** [Makefile:9734: configure-gdb] Error 1
make[1]: *** Waiting for unfinished jobs....

$ grep -C1 'cannot find -latomic_ops' masterdir/builddir/gdb-10.1/gdb/config.log
configure:11330: aarch64-linux-musl-gcc -o conftest -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -pipe -march=armv8-a -I/usr/aarch64-linux-musl/usr/include/python3.9 -g -I/usr/aarch64-linux-musl/usr/include    -I/usr/aarch64-linux-musl/usr/include -I/usr/aarch64-linux-musl/usr/include/guile/2.2  -Wl,-z,relro -Wl,-z,now -Wl,--as-needed    -L/usr/aarch64-linux-musl/usr/lib conftest.c -lncursesw -lm  -lguile-2.2 -latomic_ops -lgc >&5
/usr/lib/gcc/aarch64-linux-musl/10.2.1/../../../../aarch64-linux-musl/bin/ld: cannot find -latomic_ops
collect2: error: ld returned 1 exit status
--
configure:11339: aarch64-linux-musl-gcc -o conftest -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -pipe -march=armv8-a -I/usr/aarch64-linux-musl/usr/include/python3.9 -g -I/usr/aarch64-linux-musl/usr/include    -I/usr/aarch64-linux-musl/usr/include -I/usr/aarch64-linux-musl/usr/include/guile/2.2  -Wl,-z,relro -Wl,-z,now -Wl,--as-needed    -L/usr/aarch64-linux-musl/usr/lib conftest.c -lncursesw -lm  -lguile-2.2 -latomic_ops -lgc >&5
/usr/lib/gcc/aarch64-linux-musl/10.2.1/../../../../aarch64-linux-musl/bin/ld: cannot find -latomic_ops
collect2: error: ld returned 1 exit status
```
```


^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (30 preceding siblings ...)
  2021-04-14 12:10 ` unspecd
@ 2021-04-14 12:22 ` ericonr
  2021-04-15  2:45 ` [PR PATCH] [Updated] " unspecd
                   ` (20 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-14 12:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 325 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r613197377

Comment:
So, pkgconfig on armv6l says:

```
Libs: -L${libdir} -lguile-2.2 -latomic_ops -lgc
```

I'd suggest adding `libatomic_ops-devel` as a dependency of `guile-devel` instead :)

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR PATCH] [Updated] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (31 preceding siblings ...)
  2021-04-14 12:22 ` ericonr
@ 2021-04-15  2:45 ` unspecd
  2021-04-15  3:20 ` [PR REVIEW] " unspecd
                   ` (19 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-15  2:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]

There is an updated pull request by unspecd against master on the void-packages repository

https://github.com/unspecd/void-packages gdb
https://github.com/void-linux/void-packages/pull/29382

gdb: clean up templates
Improved consistency across templates.

Also:
- Fixed `post_install` in srcpkgs/avr-gdb.
- Added build option for Guile.
- Updated cross-arm-none-eabi-gdb to 10.1.

<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, x86_64-musl
- [x] I built this PR locally for these architectures:
  - [x] aarch64
  - [x] aarch64-musl
  - [x] armv7l
  - [ ] ppc
  - [x] ppc-musl


A patch file from https://github.com/void-linux/void-packages/pull/29382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gdb-29382.patch --]
[-- Type: text/x-diff, Size: 13323 bytes --]

From 3522b71abafe5c98714d800bbb292fa6d837c951 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Wed, 10 Mar 2021 23:26:08 +1100
Subject: [PATCH 1/3] gdb: clean up

Also added build option for Guile.
---
 srcpkgs/gdb-common                           |  1 +
 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch | 11 ++++
 srcpkgs/gdb/template                         | 65 +++++++++-----------
 3 files changed, 42 insertions(+), 35 deletions(-)
 create mode 120000 srcpkgs/gdb-common
 create mode 100644 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/gdb-common b/srcpkgs/gdb-common
new file mode 120000
index 000000000000..f3e03e3f1a44
--- /dev/null
+++ b/srcpkgs/gdb-common
@@ -0,0 +1 @@
+gdb
\ No newline at end of file
diff --git a/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 64787a9ade34..09cbe518c7df 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,65 +1,60 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=10.1
-revision=3
+revision=4
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
  --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib $(vopt_enable gdbserver)
  $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
- $(vopt_if python --with-python=/usr/bin/python3)
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
  $(vopt_with debuginfod)"
-hostmakedepends="texinfo perl pkg-config $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
- $(vopt_if python 'python3-devel gettext-devel')
- $(vopt_if debuginfod elfutils-devel)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') $(vopt_if debuginfod elfutils-devel)"
+depends="gdb-common>=${version}_${revision}"
+checkdepends="dejagnu"
 short_desc="GNU Debugger"
 maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
-distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=extended  # Tests take too long, not all of them pass.
 python_version=3
 patch_args="-Np1"
+ignore_elf_files="
+ /usr/share/gdb/guile/gdb/support.go
+ /usr/share/gdb/guile/gdb/experimental.go
+ /usr/share/gdb/guile/gdb/iterator.go
+ /usr/share/gdb/guile/gdb/types.go
+ /usr/share/gdb/guile/gdb/printing.go
+ /usr/share/gdb/guile/gdb.go"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" $(vopt_if guile libatomic_ops-devel)"
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
+
 # Package build options
-build_options="gdbserver static python debuginfod"
+build_options="debuginfod gdbserver guile python static"
 desc_option_gdbserver="Enable support for building GDB server"
 desc_option_debuginfod="Enable support for libdebuginfod"
 # Enable gdbserver if !static.
-build_options_default="gdbserver python debuginfod"
+build_options_default="debuginfod gdbserver python"
 # Both options cannot be enabled at the same time
 vopt_conflict gdbserver static
 
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
+post_install() {
 	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/{include,lib,lib64}
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
+	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+}
+
+gdb-common_package() {
+	short_desc+=" - common files"
+	pkg_install() {
+		vmove usr/share
+	}
 }

From 0921c1e55e0eaf401e5d329e90e645685d99ab84 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:12:29 +1100
Subject: [PATCH 2/3] avr-gdb: clean up

Also added build option for Guile.
---
 .../avr-gdb/patches/gdb-mips-linux-nat.patch  | 11 +++
 srcpkgs/avr-gdb/template                      | 73 ++++---------------
 2 files changed, 27 insertions(+), 57 deletions(-)
 create mode 100644 srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/avr-gdb/template b/srcpkgs/avr-gdb/template
index 73d9f9ac7456..56c4f325e6ba 100644
--- a/srcpkgs/avr-gdb/template
+++ b/srcpkgs/avr-gdb/template
@@ -1,79 +1,38 @@
 # Template file for 'avr-gdb'
 pkgname=avr-gdb
 version=10.1
-revision=1
+revision=2
 wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/gdb/python"
-configure_args="\
-	--target=avr \
-	--program-prefix=avr- \
-	--disable-werror \
-	--disable-nls \
-	--with-system-readline \
-	--with-system-gdbinit=/etc/gdb/gdbinit \
-	--with-system-zlib $(vopt_enable gdbserver) \
-	$(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static') \
-	$(vopt_if python --with-python=/usr/bin/python3)"
-hostmakedepends="texinfo perl $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
+configure_args="--target=avr --disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
  $(vopt_if python 'python3-devel gettext-devel')"
-depends=gdb
+depends="gdb-common"
 short_desc="GNU Debugger for AVR"
 maintainer="Artur Sinila <opensource@logarithmus.dev>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
+homepage="https://www.gnu.org/software/gdb"
 distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
-python_version=3
+make_check=no  # See gdb/template.
 replaces="cross-avr-gdb>=0"
+patch_args="-Np1"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" $(vopt_if guile libatomic_ops-devel)"
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
-# Package build options
-build_options="gdbserver static python"
-desc_option_gdbserver="Enable support for building GDB server"
-# By default, don't enable any of build options
-#build_options_default="gdbserver"
-# Both options cannot be enabled at the same time
-vopt_conflict gdbserver static
-
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
 
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
-	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/include ${DESTDIR}/usr/lib
-	rm -rf ${DESTDIR}/usr/lib64
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
-}
+# Package build options
+build_options="guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -r ${DESTDIR}/usr/{share/{gdb,info},include}
 }

From 0d7306cfe6adb9266d9e251a9e32224753d9b673 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:14:22 +1100
Subject: [PATCH 3/3] cross-arm-none-eabi-gdb: update to 10.1, clean up

---
 .../patches/gdb-mips-linux-nat.patch          | 11 +++
 srcpkgs/cross-arm-none-eabi-gdb/template      | 69 ++++++++-----------
 2 files changed, 40 insertions(+), 40 deletions(-)
 create mode 100644 srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/cross-arm-none-eabi-gdb/template b/srcpkgs/cross-arm-none-eabi-gdb/template
index ac8e6837d72c..4534fc4c5557 100644
--- a/srcpkgs/cross-arm-none-eabi-gdb/template
+++ b/srcpkgs/cross-arm-none-eabi-gdb/template
@@ -1,48 +1,37 @@
-# Template file for 'cross-${_triplet}-${_pkgname}'
-_triplet=arm-none-eabi
-_pkgname=gdb
-pkgname=cross-${_triplet}-${_pkgname}
-version=8.3
+# Template file for 'cross-arm-none-eabi-gdb'
+pkgname=cross-arm-none-eabi-gdb
+version=10.1
 revision=1
-wrksrc="${_pkgname}-${version}"
+wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/${_pkgname}"
-configure_args="
- --disable-gdbserver
- --disable-nls
- --disable-werror
- --host=${XBPS_CROSS_TRIPLE}
- --prefix=/usr
- --target=${_triplet}
- --with-babeltrace
- --with-expat
- --with-mpfr
- --with-system-readline
- --with-system-zlib
- --without-isl
- $(vopt_with guile)
- $(vopt_with python)
-"
-hostmakedepends="autoconf automake bison flex pkg-config texinfo"
-makedepends="babeltrace-devel expat-devel mpfr-devel ncurses-devel
- readline-devel zlib-devel $(vopt_if guile guile-devel)
- $(vopt_if python 'python3-devel gettext-devel')"
-short_desc="GNU Debugger"
+configure_args="--target=arm-none-eabi --disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib --without-isl
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') babeltrace-devel mpfr-devel"
+depends="gdb-common"
+short_desc="GNU Debugger for ARM"
 maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/${_pkgname}"
-distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}.tar.xz"
-checksum=802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e
-python_version=2 #unverified
-build_options="guile python"
-# don't enable guile and python interfaces until they are moved into
-# platform independent packages
-build_options_default=" "
-nocross=yes
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
+checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
+make_check=no  # See gdb/template.
+patch_args="-Np1"
+
+if [ "${CROSS_BUILD}" ]; then
+	# Make python3.x detection work in cross builds
+	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" $(vopt_if guile libatomic_ops-devel)"
+fi
 
-CFLAGS="-fcommon"
+# Package build options
+build_options="guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr ${DESTDIR}/usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -r ${DESTDIR}/usr/{share/{gdb,info},include}
 }

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (32 preceding siblings ...)
  2021-04-15  2:45 ` [PR PATCH] [Updated] " unspecd
@ 2021-04-15  3:20 ` unspecd
  2021-04-26 16:58 ` ericonr
                   ` (18 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-15  3:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 153 bytes --]

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r613729564

Comment:
Fixed.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (33 preceding siblings ...)
  2021-04-15  3:20 ` [PR REVIEW] " unspecd
@ 2021-04-26 16:58 ` ericonr
  2021-04-30 16:31 ` [PR PATCH] [Updated] " unspecd
                   ` (17 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-26 16:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 151 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r620481260

Comment:
Ping

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR PATCH] [Updated] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (34 preceding siblings ...)
  2021-04-26 16:58 ` ericonr
@ 2021-04-30 16:31 ` unspecd
  2021-04-30 16:55 ` [PR REVIEW] " unspecd
                   ` (16 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-30 16:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]

There is an updated pull request by unspecd against master on the void-packages repository

https://github.com/unspecd/void-packages gdb
https://github.com/void-linux/void-packages/pull/29382

gdb: clean up templates
Improved consistency across templates.

Also:
- Fixed `post_install` in srcpkgs/avr-gdb.
- Added build option for Guile.
- Updated cross-arm-none-eabi-gdb to 10.1.

<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, x86_64-musl
- [x] I built this PR locally for these architectures:
  - [x] aarch64
  - [x] aarch64-musl
  - [x] armv7l
  - [ ] ppc
  - [x] ppc-musl


A patch file from https://github.com/void-linux/void-packages/pull/29382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gdb-29382.patch --]
[-- Type: text/x-diff, Size: 13341 bytes --]

From a42fb553d8ca426a68e1086f0d24c27ece840ece Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Wed, 10 Mar 2021 23:26:08 +1100
Subject: [PATCH 1/3] gdb: clean up

Also added build option for Guile.
---
 srcpkgs/gdb-common                           |  1 +
 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch | 11 ++++
 srcpkgs/gdb/template                         | 62 +++++++++-----------
 3 files changed, 41 insertions(+), 33 deletions(-)
 create mode 120000 srcpkgs/gdb-common
 create mode 100644 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/gdb-common b/srcpkgs/gdb-common
new file mode 120000
index 000000000000..f3e03e3f1a44
--- /dev/null
+++ b/srcpkgs/gdb-common
@@ -0,0 +1 @@
+gdb
\ No newline at end of file
diff --git a/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9648e927efad..e4538b871e3b 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -8,57 +8,53 @@ configure_args="--disable-werror --disable-nls --with-system-readline
  --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
  $(vopt_enable gdbserver) $(vopt_if multiarch --enable-targets=all)
  $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
- $(vopt_if python --with-python=/usr/bin/python3)
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
  $(vopt_with debuginfod)"
-hostmakedepends="texinfo perl pkg-config $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
- $(vopt_if python 'python3-devel gettext-devel')
- $(vopt_if debuginfod elfutils-devel)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') $(vopt_if debuginfod elfutils-devel)"
+depends="gdb-common>=${version}_${revision}"
+checkdepends="dejagnu"
 short_desc="GNU Debugger"
 maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
-distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
+make_check=extended  # Tests take too long, not all of them pass.
 python_version=3
 patch_args="-Np1"
+ignore_elf_files="
+ /usr/share/gdb/guile/gdb/support.go
+ /usr/share/gdb/guile/gdb/experimental.go
+ /usr/share/gdb/guile/gdb/iterator.go
+ /usr/share/gdb/guile/gdb/types.go
+ /usr/share/gdb/guile/gdb/printing.go
+ /usr/share/gdb/guile/gdb.go"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" $(vopt_if guile libatomic_ops-devel)"
 fi
 
-build_options="gdbserver multiarch static python debuginfod"
+build_options="debuginfod gdbserver guile multiarch python static"
+desc_option_gdbserver="Enable support for building GDB server"
 desc_option_debuginfod="Enable support for libdebuginfod"
 desc_option_multiarch="Enable support for all architectures"
-desc_option_gdbserver="Enable support for building GDB server"
-build_options_default="gdbserver python debuginfod"
+build_options_default="debuginfod gdbserver python"
 vopt_conflict gdbserver static
 vopt_conflict debuginfod static
 
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
+post_install() {
 	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/{include,lib,lib64}
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
+	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+}
+
+gdb-common_package() {
+	short_desc+=" - common files"
+	pkg_install() {
+		vmove usr/share
+	}
 }

From 973d5827b52e9bc2acedfd06c5b5c4112e0ae0f3 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:12:29 +1100
Subject: [PATCH 2/3] avr-gdb: update to 10.2; clean up

Also added build option for Guile.
---
 .../avr-gdb/patches/gdb-mips-linux-nat.patch  | 11 +++
 srcpkgs/avr-gdb/template                      | 75 +++++--------------
 2 files changed, 28 insertions(+), 58 deletions(-)
 create mode 100644 srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/avr-gdb/template b/srcpkgs/avr-gdb/template
index 73d9f9ac7456..185934a2a346 100644
--- a/srcpkgs/avr-gdb/template
+++ b/srcpkgs/avr-gdb/template
@@ -1,79 +1,38 @@
 # Template file for 'avr-gdb'
 pkgname=avr-gdb
-version=10.1
+version=10.2
 revision=1
 wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/gdb/python"
-configure_args="\
-	--target=avr \
-	--program-prefix=avr- \
-	--disable-werror \
-	--disable-nls \
-	--with-system-readline \
-	--with-system-gdbinit=/etc/gdb/gdbinit \
-	--with-system-zlib $(vopt_enable gdbserver) \
-	$(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static') \
-	$(vopt_if python --with-python=/usr/bin/python3)"
-hostmakedepends="texinfo perl $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
+configure_args="--target=avr --disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
  $(vopt_if python 'python3-devel gettext-devel')"
-depends=gdb
+depends="gdb-common"
 short_desc="GNU Debugger for AVR"
 maintainer="Artur Sinila <opensource@logarithmus.dev>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
+homepage="https://www.gnu.org/software/gdb"
 distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
-checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
-python_version=3
+checksum=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
+make_check=no  # See gdb/template.
 replaces="cross-avr-gdb>=0"
+patch_args="-Np1"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" $(vopt_if guile libatomic_ops-devel)"
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
-# Package build options
-build_options="gdbserver static python"
-desc_option_gdbserver="Enable support for building GDB server"
-# By default, don't enable any of build options
-#build_options_default="gdbserver"
-# Both options cannot be enabled at the same time
-vopt_conflict gdbserver static
-
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
 
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
-	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/include ${DESTDIR}/usr/lib
-	rm -rf ${DESTDIR}/usr/lib64
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
-}
+# Package build options
+build_options="guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -r ${DESTDIR}/usr/{share/{gdb,info},include}
 }

From ff755c0050da5223fd8b2574207682070221a451 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:14:22 +1100
Subject: [PATCH 3/3] cross-arm-none-eabi-gdb: update to 10.2, clean up

---
 .../patches/gdb-mips-linux-nat.patch          | 11 +++
 srcpkgs/cross-arm-none-eabi-gdb/template      | 69 ++++++++-----------
 2 files changed, 40 insertions(+), 40 deletions(-)
 create mode 100644 srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/cross-arm-none-eabi-gdb/template b/srcpkgs/cross-arm-none-eabi-gdb/template
index ac8e6837d72c..3f7803445c53 100644
--- a/srcpkgs/cross-arm-none-eabi-gdb/template
+++ b/srcpkgs/cross-arm-none-eabi-gdb/template
@@ -1,48 +1,37 @@
-# Template file for 'cross-${_triplet}-${_pkgname}'
-_triplet=arm-none-eabi
-_pkgname=gdb
-pkgname=cross-${_triplet}-${_pkgname}
-version=8.3
+# Template file for 'cross-arm-none-eabi-gdb'
+pkgname=cross-arm-none-eabi-gdb
+version=10.2
 revision=1
-wrksrc="${_pkgname}-${version}"
+wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/${_pkgname}"
-configure_args="
- --disable-gdbserver
- --disable-nls
- --disable-werror
- --host=${XBPS_CROSS_TRIPLE}
- --prefix=/usr
- --target=${_triplet}
- --with-babeltrace
- --with-expat
- --with-mpfr
- --with-system-readline
- --with-system-zlib
- --without-isl
- $(vopt_with guile)
- $(vopt_with python)
-"
-hostmakedepends="autoconf automake bison flex pkg-config texinfo"
-makedepends="babeltrace-devel expat-devel mpfr-devel ncurses-devel
- readline-devel zlib-devel $(vopt_if guile guile-devel)
- $(vopt_if python 'python3-devel gettext-devel')"
-short_desc="GNU Debugger"
+configure_args="--target=arm-none-eabi --disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib --without-isl
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') babeltrace-devel mpfr-devel"
+depends="gdb-common"
+short_desc="GNU Debugger for ARM"
 maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/${_pkgname}"
-distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}.tar.xz"
-checksum=802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e
-python_version=2 #unverified
-build_options="guile python"
-# don't enable guile and python interfaces until they are moved into
-# platform independent packages
-build_options_default=" "
-nocross=yes
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
+checksum=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
+make_check=no  # See gdb/template.
+patch_args="-Np1"
+
+if [ "${CROSS_BUILD}" ]; then
+	# Make python3.x detection work in cross builds
+	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	makedepends+=" $(vopt_if guile libatomic_ops-devel)"
+fi
 
-CFLAGS="-fcommon"
+# Package build options
+build_options="guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr ${DESTDIR}/usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -r ${DESTDIR}/usr/{share/{gdb,info},include}
 }

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (35 preceding siblings ...)
  2021-04-30 16:31 ` [PR PATCH] [Updated] " unspecd
@ 2021-04-30 16:55 ` unspecd
  2021-04-30 17:49 ` ericonr
                   ` (15 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-30 16:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 579 bytes --]

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r624024526

Comment:
Do I understand correctly that you suggest the following patch:

File: srcpkgs/guile/template
```diff
@@ -40,7 +40,7 @@ libguile_package() {
 
 guile-devel_package() {
 	short_desc+=" - development files"
-	depends="gmp-devel gc-devel guile>=${version}_${revision}"
+	depends="gmp-devel gc-devel guile>=${version}_${revision} libatomic_ops-devel"
 	pkg_install() {
 		vmove usr/bin/guile-config
 		vmove usr/include
```

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (36 preceding siblings ...)
  2021-04-30 16:55 ` [PR REVIEW] " unspecd
@ 2021-04-30 17:49 ` ericonr
  2021-04-30 18:28 ` [PR PATCH] [Updated] " unspecd
                   ` (14 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-30 17:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 157 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r624058160

Comment:
Exactly :)

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR PATCH] [Updated] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (37 preceding siblings ...)
  2021-04-30 17:49 ` ericonr
@ 2021-04-30 18:28 ` unspecd
  2021-04-30 18:35 ` unspecd
                   ` (13 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-30 18:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]

There is an updated pull request by unspecd against master on the void-packages repository

https://github.com/unspecd/void-packages gdb
https://github.com/void-linux/void-packages/pull/29382

gdb: clean up templates
Improved consistency across templates.

Also:
- Fixed `post_install` in srcpkgs/avr-gdb.
- Added build option for Guile.
- Updated cross-arm-none-eabi-gdb to 10.2.

<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, x86_64-musl
- [x] I built this PR locally for these architectures:
  - [x] aarch64
  - [x] aarch64-musl
  - [x] armv7l
  - [ ] ppc
  - [x] ppc-musl


A patch file from https://github.com/void-linux/void-packages/pull/29382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gdb-29382.patch --]
[-- Type: text/x-diff, Size: 13990 bytes --]

From b2d94adea803086d8cfb14cdfb03bb568bfba4a0 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Sat, 1 May 2021 05:21:55 +1100
Subject: [PATCH 1/4] guile: devel needs dependency on libatomic_ops-devel on
 some targets

---
 srcpkgs/guile/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/guile/template b/srcpkgs/guile/template
index f9ce43c06709..6495b94025ca 100644
--- a/srcpkgs/guile/template
+++ b/srcpkgs/guile/template
@@ -40,7 +40,7 @@ libguile_package() {
 
 guile-devel_package() {
 	short_desc+=" - development files"
-	depends="gmp-devel gc-devel guile>=${version}_${revision}"
+	depends="gmp-devel gc-devel guile>=${version}_${revision} libatomic_ops-devel"
 	pkg_install() {
 		vmove usr/bin/guile-config
 		vmove usr/include

From 2dcf28e8e567198d4312a9555860859278991ac1 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Wed, 10 Mar 2021 23:26:08 +1100
Subject: [PATCH 2/4] gdb: clean up

Also added build option for Guile.
---
 srcpkgs/gdb-common                           |  1 +
 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch | 11 ++++
 srcpkgs/gdb/template                         | 61 +++++++++-----------
 3 files changed, 40 insertions(+), 33 deletions(-)
 create mode 120000 srcpkgs/gdb-common
 create mode 100644 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/gdb-common b/srcpkgs/gdb-common
new file mode 120000
index 000000000000..f3e03e3f1a44
--- /dev/null
+++ b/srcpkgs/gdb-common
@@ -0,0 +1 @@
+gdb
\ No newline at end of file
diff --git a/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9648e927efad..5deb3c3c5301 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -8,20 +8,29 @@ configure_args="--disable-werror --disable-nls --with-system-readline
  --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
  $(vopt_enable gdbserver) $(vopt_if multiarch --enable-targets=all)
  $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
- $(vopt_if python --with-python=/usr/bin/python3)
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
  $(vopt_with debuginfod)"
-hostmakedepends="texinfo perl pkg-config $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
- $(vopt_if python 'python3-devel gettext-devel')
- $(vopt_if debuginfod elfutils-devel)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') $(vopt_if debuginfod elfutils-devel)"
+depends="gdb-common>=${version}_${revision}"
+checkdepends="dejagnu"
 short_desc="GNU Debugger"
 maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
-distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
+make_check=extended  # Tests take too long, not all of them pass.
 python_version=3
 patch_args="-Np1"
+ignore_elf_files="
+ /usr/share/gdb/guile/gdb/support.go
+ /usr/share/gdb/guile/gdb/experimental.go
+ /usr/share/gdb/guile/gdb/iterator.go
+ /usr/share/gdb/guile/gdb/types.go
+ /usr/share/gdb/guile/gdb/printing.go
+ /usr/share/gdb/guile/gdb.go"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
@@ -29,36 +38,22 @@ if [ "${CROSS_BUILD}" ]; then
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 fi
 
-build_options="gdbserver multiarch static python debuginfod"
+build_options="debuginfod gdbserver guile multiarch python static"
+desc_option_gdbserver="Enable support for building GDB server"
 desc_option_debuginfod="Enable support for libdebuginfod"
 desc_option_multiarch="Enable support for all architectures"
-desc_option_gdbserver="Enable support for building GDB server"
-build_options_default="gdbserver python debuginfod"
+build_options_default="debuginfod gdbserver python"
 vopt_conflict gdbserver static
 vopt_conflict debuginfod static
 
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
+post_install() {
 	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/{include,lib,lib64}
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
+	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+}
+
+gdb-common_package() {
+	short_desc+=" - common files"
+	pkg_install() {
+		vmove usr/share
+	}
 }

From 24ebac538b0a74c4e5effded186d5faa197a3dac Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:12:29 +1100
Subject: [PATCH 3/4] avr-gdb: update to 10.2; clean up

Also added build option for Guile.
---
 .../avr-gdb/patches/gdb-mips-linux-nat.patch  | 11 +++
 srcpkgs/avr-gdb/template                      | 74 ++++---------------
 2 files changed, 27 insertions(+), 58 deletions(-)
 create mode 100644 srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/avr-gdb/template b/srcpkgs/avr-gdb/template
index 73d9f9ac7456..bf97ef0be3c9 100644
--- a/srcpkgs/avr-gdb/template
+++ b/srcpkgs/avr-gdb/template
@@ -1,79 +1,37 @@
 # Template file for 'avr-gdb'
 pkgname=avr-gdb
-version=10.1
+version=10.2
 revision=1
 wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/gdb/python"
-configure_args="\
-	--target=avr \
-	--program-prefix=avr- \
-	--disable-werror \
-	--disable-nls \
-	--with-system-readline \
-	--with-system-gdbinit=/etc/gdb/gdbinit \
-	--with-system-zlib $(vopt_enable gdbserver) \
-	$(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static') \
-	$(vopt_if python --with-python=/usr/bin/python3)"
-hostmakedepends="texinfo perl $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
+configure_args="--target=avr --disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
  $(vopt_if python 'python3-devel gettext-devel')"
-depends=gdb
+depends="gdb-common"
 short_desc="GNU Debugger for AVR"
 maintainer="Artur Sinila <opensource@logarithmus.dev>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
+homepage="https://www.gnu.org/software/gdb"
 distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
-checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
-python_version=3
+checksum=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
+make_check=no  # See gdb/template.
 replaces="cross-avr-gdb>=0"
+patch_args="-Np1"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
-# Package build options
-build_options="gdbserver static python"
-desc_option_gdbserver="Enable support for building GDB server"
-# By default, don't enable any of build options
-#build_options_default="gdbserver"
-# Both options cannot be enabled at the same time
-vopt_conflict gdbserver static
-
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
 
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
-	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/include ${DESTDIR}/usr/lib
-	rm -rf ${DESTDIR}/usr/lib64
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
-}
+# Package build options
+build_options="guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -r ${DESTDIR}/usr/{share/{gdb,info},include}
 }

From fe9b63e03c0b206001976ce8824b94fa2e4618b7 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:14:22 +1100
Subject: [PATCH 4/4] cross-arm-none-eabi-gdb: update to 10.2, clean up

---
 .../patches/gdb-mips-linux-nat.patch          | 11 +++
 srcpkgs/cross-arm-none-eabi-gdb/template      | 68 ++++++++-----------
 2 files changed, 39 insertions(+), 40 deletions(-)
 create mode 100644 srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/cross-arm-none-eabi-gdb/template b/srcpkgs/cross-arm-none-eabi-gdb/template
index ac8e6837d72c..854b9f83b30d 100644
--- a/srcpkgs/cross-arm-none-eabi-gdb/template
+++ b/srcpkgs/cross-arm-none-eabi-gdb/template
@@ -1,48 +1,36 @@
-# Template file for 'cross-${_triplet}-${_pkgname}'
-_triplet=arm-none-eabi
-_pkgname=gdb
-pkgname=cross-${_triplet}-${_pkgname}
-version=8.3
+# Template file for 'cross-arm-none-eabi-gdb'
+pkgname=cross-arm-none-eabi-gdb
+version=10.2
 revision=1
-wrksrc="${_pkgname}-${version}"
+wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/${_pkgname}"
-configure_args="
- --disable-gdbserver
- --disable-nls
- --disable-werror
- --host=${XBPS_CROSS_TRIPLE}
- --prefix=/usr
- --target=${_triplet}
- --with-babeltrace
- --with-expat
- --with-mpfr
- --with-system-readline
- --with-system-zlib
- --without-isl
- $(vopt_with guile)
- $(vopt_with python)
-"
-hostmakedepends="autoconf automake bison flex pkg-config texinfo"
-makedepends="babeltrace-devel expat-devel mpfr-devel ncurses-devel
- readline-devel zlib-devel $(vopt_if guile guile-devel)
- $(vopt_if python 'python3-devel gettext-devel')"
-short_desc="GNU Debugger"
+configure_args="--target=arm-none-eabi --disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib --without-isl
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') babeltrace-devel mpfr-devel"
+depends="gdb-common"
+short_desc="GNU Debugger for ARM"
 maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/${_pkgname}"
-distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}.tar.xz"
-checksum=802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e
-python_version=2 #unverified
-build_options="guile python"
-# don't enable guile and python interfaces until they are moved into
-# platform independent packages
-build_options_default=" "
-nocross=yes
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
+checksum=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
+make_check=no  # See gdb/template.
+patch_args="-Np1"
+
+if [ "${CROSS_BUILD}" ]; then
+	# Make python3.x detection work in cross builds
+	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+fi
 
-CFLAGS="-fcommon"
+# Package build options
+build_options="guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr ${DESTDIR}/usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -r ${DESTDIR}/usr/{share/{gdb,info},include}
 }

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR PATCH] [Updated] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (38 preceding siblings ...)
  2021-04-30 18:28 ` [PR PATCH] [Updated] " unspecd
@ 2021-04-30 18:35 ` unspecd
  2021-04-30 19:15 ` [PR REVIEW] " unspecd
                   ` (12 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-30 18:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]

There is an updated pull request by unspecd against master on the void-packages repository

https://github.com/unspecd/void-packages gdb
https://github.com/void-linux/void-packages/pull/29382

gdb: clean up templates
Improved consistency across templates.

Also:
- Fixed `post_install` in srcpkgs/avr-gdb.
- Added build option for Guile.
- Updated cross-arm-none-eabi-gdb to 10.2.

<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, x86_64-musl
- [x] I built this PR locally for these architectures:
  - [x] aarch64
  - [x] aarch64-musl
  - [x] armv7l
  - [ ] ppc
  - [x] ppc-musl


A patch file from https://github.com/void-linux/void-packages/pull/29382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gdb-29382.patch --]
[-- Type: text/x-diff, Size: 14507 bytes --]

From 6c832fd08bed6c3ba2eb4ba18a60659b40143e49 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Sat, 1 May 2021 05:21:55 +1100
Subject: [PATCH 1/4] guile: devel needs dependency on libatomic_ops-devel on
 some targets

---
 srcpkgs/guile/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/guile/template b/srcpkgs/guile/template
index f9ce43c06709..8ea13881c73e 100644
--- a/srcpkgs/guile/template
+++ b/srcpkgs/guile/template
@@ -7,7 +7,7 @@ configure_args="--disable-static --disable-error-on-warning"
 hostmakedepends="pkg-config texinfo"
 makedepends="gc-devel gmp-devel libatomic_ops-devel libffi-devel libltdl-devel
  libunistring-devel readline-devel"
-short_desc="A portable, embeddable Scheme implementation written in C"
+short_desc="Portable, embeddable Scheme implementation written in C"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later, LGPL-3.0-or-later"
 homepage="http://www.gnu.org/software/guile"
@@ -40,7 +40,7 @@ libguile_package() {
 
 guile-devel_package() {
 	short_desc+=" - development files"
-	depends="gmp-devel gc-devel guile>=${version}_${revision}"
+	depends="gmp-devel gc-devel guile>=${version}_${revision} libatomic_ops-devel"
 	pkg_install() {
 		vmove usr/bin/guile-config
 		vmove usr/include

From 44e62c06e60dfc6bae3bd2ba6ac8ae5494278966 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Wed, 10 Mar 2021 23:26:08 +1100
Subject: [PATCH 2/4] gdb: clean up

Also added build option for Guile.
---
 srcpkgs/gdb-common                           |  1 +
 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch | 11 ++++
 srcpkgs/gdb/template                         | 61 +++++++++-----------
 3 files changed, 40 insertions(+), 33 deletions(-)
 create mode 120000 srcpkgs/gdb-common
 create mode 100644 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/gdb-common b/srcpkgs/gdb-common
new file mode 120000
index 000000000000..f3e03e3f1a44
--- /dev/null
+++ b/srcpkgs/gdb-common
@@ -0,0 +1 @@
+gdb
\ No newline at end of file
diff --git a/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9648e927efad..5deb3c3c5301 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -8,20 +8,29 @@ configure_args="--disable-werror --disable-nls --with-system-readline
  --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
  $(vopt_enable gdbserver) $(vopt_if multiarch --enable-targets=all)
  $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
- $(vopt_if python --with-python=/usr/bin/python3)
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
  $(vopt_with debuginfod)"
-hostmakedepends="texinfo perl pkg-config $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
- $(vopt_if python 'python3-devel gettext-devel')
- $(vopt_if debuginfod elfutils-devel)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') $(vopt_if debuginfod elfutils-devel)"
+depends="gdb-common>=${version}_${revision}"
+checkdepends="dejagnu"
 short_desc="GNU Debugger"
 maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
-distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
+make_check=extended  # Tests take too long, not all of them pass.
 python_version=3
 patch_args="-Np1"
+ignore_elf_files="
+ /usr/share/gdb/guile/gdb/support.go
+ /usr/share/gdb/guile/gdb/experimental.go
+ /usr/share/gdb/guile/gdb/iterator.go
+ /usr/share/gdb/guile/gdb/types.go
+ /usr/share/gdb/guile/gdb/printing.go
+ /usr/share/gdb/guile/gdb.go"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
@@ -29,36 +38,22 @@ if [ "${CROSS_BUILD}" ]; then
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 fi
 
-build_options="gdbserver multiarch static python debuginfod"
+build_options="debuginfod gdbserver guile multiarch python static"
+desc_option_gdbserver="Enable support for building GDB server"
 desc_option_debuginfod="Enable support for libdebuginfod"
 desc_option_multiarch="Enable support for all architectures"
-desc_option_gdbserver="Enable support for building GDB server"
-build_options_default="gdbserver python debuginfod"
+build_options_default="debuginfod gdbserver python"
 vopt_conflict gdbserver static
 vopt_conflict debuginfod static
 
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
+post_install() {
 	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/{include,lib,lib64}
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
+	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+}
+
+gdb-common_package() {
+	short_desc+=" - common files"
+	pkg_install() {
+		vmove usr/share
+	}
 }

From c94aefc325c80ba251b2e70ecab57769ddff9677 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:12:29 +1100
Subject: [PATCH 3/4] avr-gdb: update to 10.2; clean up

Also added build option for Guile.
---
 .../avr-gdb/patches/gdb-mips-linux-nat.patch  | 11 +++
 srcpkgs/avr-gdb/template                      | 74 ++++---------------
 2 files changed, 27 insertions(+), 58 deletions(-)
 create mode 100644 srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/avr-gdb/template b/srcpkgs/avr-gdb/template
index 73d9f9ac7456..bf97ef0be3c9 100644
--- a/srcpkgs/avr-gdb/template
+++ b/srcpkgs/avr-gdb/template
@@ -1,79 +1,37 @@
 # Template file for 'avr-gdb'
 pkgname=avr-gdb
-version=10.1
+version=10.2
 revision=1
 wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/gdb/python"
-configure_args="\
-	--target=avr \
-	--program-prefix=avr- \
-	--disable-werror \
-	--disable-nls \
-	--with-system-readline \
-	--with-system-gdbinit=/etc/gdb/gdbinit \
-	--with-system-zlib $(vopt_enable gdbserver) \
-	$(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static') \
-	$(vopt_if python --with-python=/usr/bin/python3)"
-hostmakedepends="texinfo perl $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
+configure_args="--target=avr --disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
  $(vopt_if python 'python3-devel gettext-devel')"
-depends=gdb
+depends="gdb-common"
 short_desc="GNU Debugger for AVR"
 maintainer="Artur Sinila <opensource@logarithmus.dev>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
+homepage="https://www.gnu.org/software/gdb"
 distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
-checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
-python_version=3
+checksum=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
+make_check=no  # See gdb/template.
 replaces="cross-avr-gdb>=0"
+patch_args="-Np1"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
-# Package build options
-build_options="gdbserver static python"
-desc_option_gdbserver="Enable support for building GDB server"
-# By default, don't enable any of build options
-#build_options_default="gdbserver"
-# Both options cannot be enabled at the same time
-vopt_conflict gdbserver static
-
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
 
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
-	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/include ${DESTDIR}/usr/lib
-	rm -rf ${DESTDIR}/usr/lib64
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
-}
+# Package build options
+build_options="guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -r ${DESTDIR}/usr/{share/{gdb,info},include}
 }

From 01bae33763c26d8fcfcb7e4a88c5098398af801e Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:14:22 +1100
Subject: [PATCH 4/4] cross-arm-none-eabi-gdb: update to 10.2, clean up

---
 .../patches/gdb-mips-linux-nat.patch          | 11 +++
 srcpkgs/cross-arm-none-eabi-gdb/template      | 68 ++++++++-----------
 2 files changed, 39 insertions(+), 40 deletions(-)
 create mode 100644 srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/cross-arm-none-eabi-gdb/template b/srcpkgs/cross-arm-none-eabi-gdb/template
index ac8e6837d72c..854b9f83b30d 100644
--- a/srcpkgs/cross-arm-none-eabi-gdb/template
+++ b/srcpkgs/cross-arm-none-eabi-gdb/template
@@ -1,48 +1,36 @@
-# Template file for 'cross-${_triplet}-${_pkgname}'
-_triplet=arm-none-eabi
-_pkgname=gdb
-pkgname=cross-${_triplet}-${_pkgname}
-version=8.3
+# Template file for 'cross-arm-none-eabi-gdb'
+pkgname=cross-arm-none-eabi-gdb
+version=10.2
 revision=1
-wrksrc="${_pkgname}-${version}"
+wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/${_pkgname}"
-configure_args="
- --disable-gdbserver
- --disable-nls
- --disable-werror
- --host=${XBPS_CROSS_TRIPLE}
- --prefix=/usr
- --target=${_triplet}
- --with-babeltrace
- --with-expat
- --with-mpfr
- --with-system-readline
- --with-system-zlib
- --without-isl
- $(vopt_with guile)
- $(vopt_with python)
-"
-hostmakedepends="autoconf automake bison flex pkg-config texinfo"
-makedepends="babeltrace-devel expat-devel mpfr-devel ncurses-devel
- readline-devel zlib-devel $(vopt_if guile guile-devel)
- $(vopt_if python 'python3-devel gettext-devel')"
-short_desc="GNU Debugger"
+configure_args="--target=arm-none-eabi --disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib --without-isl
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') babeltrace-devel mpfr-devel"
+depends="gdb-common"
+short_desc="GNU Debugger for ARM"
 maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/${_pkgname}"
-distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}.tar.xz"
-checksum=802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e
-python_version=2 #unverified
-build_options="guile python"
-# don't enable guile and python interfaces until they are moved into
-# platform independent packages
-build_options_default=" "
-nocross=yes
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
+checksum=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
+make_check=no  # See gdb/template.
+patch_args="-Np1"
+
+if [ "${CROSS_BUILD}" ]; then
+	# Make python3.x detection work in cross builds
+	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+fi
 
-CFLAGS="-fcommon"
+# Package build options
+build_options="guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr ${DESTDIR}/usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -r ${DESTDIR}/usr/{share/{gdb,info},include}
 }

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (39 preceding siblings ...)
  2021-04-30 18:35 ` unspecd
@ 2021-04-30 19:15 ` unspecd
  2021-04-30 19:44 ` ericonr
                   ` (11 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-30 19:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r624127473

Comment:
Oh, no, there is the same bug as in #27320.

https://github.com/void-linux/void-packages/pull/29382/checks?check_run_id=2478214035
```
…
FAIL: numbers.test: Number-theoretic division: euclidean/: mixed types: (130.0 10/7)
FAIL: numbers.test: Number-theoretic division: euclidean/: mixed types: (130.0 -10/7)
FAIL: numbers.test: Number-theoretic division: floor/: mixed types: (130.0 10/7)
FAIL: numbers.test: Number-theoretic division: floor/: mixed types: (-130.0 -10/7)
FAIL: numbers.test: Number-theoretic division: ceiling/: mixed types: (130.0 -10/7)
FAIL: numbers.test: Number-theoretic division: ceiling/: mixed types: (-130.0 10/7)
FAIL: numbers.test: Number-theoretic division: truncate/: mixed types: (130.0 10/7)
FAIL: numbers.test: Number-theoretic division: truncate/: mixed types: (130.0 -10/7)
FAIL: numbers.test: Number-theoretic division: truncate/: mixed types: (-130.0 10/7)
FAIL: numbers.test: Number-theoretic division: truncate/: mixed types: (-130.0 -10/7)
…
```

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (40 preceding siblings ...)
  2021-04-30 19:15 ` [PR REVIEW] " unspecd
@ 2021-04-30 19:44 ` ericonr
  2021-04-30 19:47 ` [PR PATCH] [Updated] " unspecd
                   ` (10 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-04-30 19:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 169 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r624150711

Comment:
You missed the revbump

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR PATCH] [Updated] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (41 preceding siblings ...)
  2021-04-30 19:44 ` ericonr
@ 2021-04-30 19:47 ` unspecd
  2021-04-30 19:49 ` [PR REVIEW] " unspecd
                   ` (9 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-30 19:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]

There is an updated pull request by unspecd against master on the void-packages repository

https://github.com/unspecd/void-packages gdb
https://github.com/void-linux/void-packages/pull/29382

gdb: clean up templates
Improved consistency across templates.

Also:
- Fixed `post_install` in srcpkgs/avr-gdb.
- Added build option for Guile.
- Updated cross-arm-none-eabi-gdb to 10.2.

<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, x86_64-musl
- [x] I built this PR locally for these architectures:
  - [x] aarch64
  - [x] aarch64-musl
  - [x] armv7l
  - [ ] ppc
  - [x] ppc-musl


A patch file from https://github.com/void-linux/void-packages/pull/29382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gdb-29382.patch --]
[-- Type: text/x-diff, Size: 14622 bytes --]

From edb90a19c9760b7b64cd23218da183b5423a5a21 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Sat, 1 May 2021 05:21:55 +1100
Subject: [PATCH 1/4] guile: devel needs dependency on libatomic_ops-devel on
 some targets

---
 srcpkgs/guile/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/guile/template b/srcpkgs/guile/template
index f9ce43c06709..f0f917b1c4ee 100644
--- a/srcpkgs/guile/template
+++ b/srcpkgs/guile/template
@@ -1,13 +1,13 @@
 # Template file for 'guile'
 pkgname=guile
 version=2.2.7
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-static --disable-error-on-warning"
 hostmakedepends="pkg-config texinfo"
 makedepends="gc-devel gmp-devel libatomic_ops-devel libffi-devel libltdl-devel
  libunistring-devel readline-devel"
-short_desc="A portable, embeddable Scheme implementation written in C"
+short_desc="Portable, embeddable Scheme implementation written in C"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later, LGPL-3.0-or-later"
 homepage="http://www.gnu.org/software/guile"
@@ -40,7 +40,7 @@ libguile_package() {
 
 guile-devel_package() {
 	short_desc+=" - development files"
-	depends="gmp-devel gc-devel guile>=${version}_${revision}"
+	depends="gmp-devel gc-devel guile>=${version}_${revision} libatomic_ops-devel"
 	pkg_install() {
 		vmove usr/bin/guile-config
 		vmove usr/include

From f797ecf1a96e3afbb05012ffd50f702a365301e8 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Wed, 10 Mar 2021 23:26:08 +1100
Subject: [PATCH 2/4] gdb: clean up

Also added build option for Guile.
---
 srcpkgs/gdb-common                           |  1 +
 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch | 11 ++++
 srcpkgs/gdb/template                         | 61 +++++++++-----------
 3 files changed, 40 insertions(+), 33 deletions(-)
 create mode 120000 srcpkgs/gdb-common
 create mode 100644 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/gdb-common b/srcpkgs/gdb-common
new file mode 120000
index 000000000000..f3e03e3f1a44
--- /dev/null
+++ b/srcpkgs/gdb-common
@@ -0,0 +1 @@
+gdb
\ No newline at end of file
diff --git a/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9648e927efad..5deb3c3c5301 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -8,20 +8,29 @@ configure_args="--disable-werror --disable-nls --with-system-readline
  --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
  $(vopt_enable gdbserver) $(vopt_if multiarch --enable-targets=all)
  $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
- $(vopt_if python --with-python=/usr/bin/python3)
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
  $(vopt_with debuginfod)"
-hostmakedepends="texinfo perl pkg-config $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
- $(vopt_if python 'python3-devel gettext-devel')
- $(vopt_if debuginfod elfutils-devel)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') $(vopt_if debuginfod elfutils-devel)"
+depends="gdb-common>=${version}_${revision}"
+checkdepends="dejagnu"
 short_desc="GNU Debugger"
 maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
-distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
+make_check=extended  # Tests take too long, not all of them pass.
 python_version=3
 patch_args="-Np1"
+ignore_elf_files="
+ /usr/share/gdb/guile/gdb/support.go
+ /usr/share/gdb/guile/gdb/experimental.go
+ /usr/share/gdb/guile/gdb/iterator.go
+ /usr/share/gdb/guile/gdb/types.go
+ /usr/share/gdb/guile/gdb/printing.go
+ /usr/share/gdb/guile/gdb.go"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
@@ -29,36 +38,22 @@ if [ "${CROSS_BUILD}" ]; then
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 fi
 
-build_options="gdbserver multiarch static python debuginfod"
+build_options="debuginfod gdbserver guile multiarch python static"
+desc_option_gdbserver="Enable support for building GDB server"
 desc_option_debuginfod="Enable support for libdebuginfod"
 desc_option_multiarch="Enable support for all architectures"
-desc_option_gdbserver="Enable support for building GDB server"
-build_options_default="gdbserver python debuginfod"
+build_options_default="debuginfod gdbserver python"
 vopt_conflict gdbserver static
 vopt_conflict debuginfod static
 
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
+post_install() {
 	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/{include,lib,lib64}
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
+	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+}
+
+gdb-common_package() {
+	short_desc+=" - common files"
+	pkg_install() {
+		vmove usr/share
+	}
 }

From 85da93a1825de50042f4a121594e839c3c7abac8 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:12:29 +1100
Subject: [PATCH 3/4] avr-gdb: update to 10.2; clean up

Also added build option for Guile.
---
 .../avr-gdb/patches/gdb-mips-linux-nat.patch  | 11 +++
 srcpkgs/avr-gdb/template                      | 74 ++++---------------
 2 files changed, 27 insertions(+), 58 deletions(-)
 create mode 100644 srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/avr-gdb/template b/srcpkgs/avr-gdb/template
index 73d9f9ac7456..bf97ef0be3c9 100644
--- a/srcpkgs/avr-gdb/template
+++ b/srcpkgs/avr-gdb/template
@@ -1,79 +1,37 @@
 # Template file for 'avr-gdb'
 pkgname=avr-gdb
-version=10.1
+version=10.2
 revision=1
 wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/gdb/python"
-configure_args="\
-	--target=avr \
-	--program-prefix=avr- \
-	--disable-werror \
-	--disable-nls \
-	--with-system-readline \
-	--with-system-gdbinit=/etc/gdb/gdbinit \
-	--with-system-zlib $(vopt_enable gdbserver) \
-	$(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static') \
-	$(vopt_if python --with-python=/usr/bin/python3)"
-hostmakedepends="texinfo perl $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
+configure_args="--target=avr --disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
  $(vopt_if python 'python3-devel gettext-devel')"
-depends=gdb
+depends="gdb-common"
 short_desc="GNU Debugger for AVR"
 maintainer="Artur Sinila <opensource@logarithmus.dev>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
+homepage="https://www.gnu.org/software/gdb"
 distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
-checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
-python_version=3
+checksum=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
+make_check=no  # See gdb/template.
 replaces="cross-avr-gdb>=0"
+patch_args="-Np1"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
-# Package build options
-build_options="gdbserver static python"
-desc_option_gdbserver="Enable support for building GDB server"
-# By default, don't enable any of build options
-#build_options_default="gdbserver"
-# Both options cannot be enabled at the same time
-vopt_conflict gdbserver static
-
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
 
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
-	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/include ${DESTDIR}/usr/lib
-	rm -rf ${DESTDIR}/usr/lib64
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
-}
+# Package build options
+build_options="guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -r ${DESTDIR}/usr/{share/{gdb,info},include}
 }

From 5876a5d89e9478c12f3c3d9125fef3f9e78f82c3 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:14:22 +1100
Subject: [PATCH 4/4] cross-arm-none-eabi-gdb: update to 10.2, clean up

---
 .../patches/gdb-mips-linux-nat.patch          | 11 +++
 srcpkgs/cross-arm-none-eabi-gdb/template      | 68 ++++++++-----------
 2 files changed, 39 insertions(+), 40 deletions(-)
 create mode 100644 srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/cross-arm-none-eabi-gdb/template b/srcpkgs/cross-arm-none-eabi-gdb/template
index ac8e6837d72c..854b9f83b30d 100644
--- a/srcpkgs/cross-arm-none-eabi-gdb/template
+++ b/srcpkgs/cross-arm-none-eabi-gdb/template
@@ -1,48 +1,36 @@
-# Template file for 'cross-${_triplet}-${_pkgname}'
-_triplet=arm-none-eabi
-_pkgname=gdb
-pkgname=cross-${_triplet}-${_pkgname}
-version=8.3
+# Template file for 'cross-arm-none-eabi-gdb'
+pkgname=cross-arm-none-eabi-gdb
+version=10.2
 revision=1
-wrksrc="${_pkgname}-${version}"
+wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/${_pkgname}"
-configure_args="
- --disable-gdbserver
- --disable-nls
- --disable-werror
- --host=${XBPS_CROSS_TRIPLE}
- --prefix=/usr
- --target=${_triplet}
- --with-babeltrace
- --with-expat
- --with-mpfr
- --with-system-readline
- --with-system-zlib
- --without-isl
- $(vopt_with guile)
- $(vopt_with python)
-"
-hostmakedepends="autoconf automake bison flex pkg-config texinfo"
-makedepends="babeltrace-devel expat-devel mpfr-devel ncurses-devel
- readline-devel zlib-devel $(vopt_if guile guile-devel)
- $(vopt_if python 'python3-devel gettext-devel')"
-short_desc="GNU Debugger"
+configure_args="--target=arm-none-eabi --disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib --without-isl
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') babeltrace-devel mpfr-devel"
+depends="gdb-common"
+short_desc="GNU Debugger for ARM"
 maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/${_pkgname}"
-distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}.tar.xz"
-checksum=802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e
-python_version=2 #unverified
-build_options="guile python"
-# don't enable guile and python interfaces until they are moved into
-# platform independent packages
-build_options_default=" "
-nocross=yes
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
+checksum=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
+make_check=no  # See gdb/template.
+patch_args="-Np1"
+
+if [ "${CROSS_BUILD}" ]; then
+	# Make python3.x detection work in cross builds
+	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+fi
 
-CFLAGS="-fcommon"
+# Package build options
+build_options="guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr ${DESTDIR}/usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -r ${DESTDIR}/usr/{share/{gdb,info},include}
 }

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (42 preceding siblings ...)
  2021-04-30 19:47 ` [PR PATCH] [Updated] " unspecd
@ 2021-04-30 19:49 ` unspecd
  2021-05-04 11:47 ` ericonr
                   ` (8 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-04-30 19:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 161 bytes --]

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r624152836

Comment:
Oops, fixed :)

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (43 preceding siblings ...)
  2021-04-30 19:49 ` [PR REVIEW] " unspecd
@ 2021-05-04 11:47 ` ericonr
  2021-05-04 11:52 ` [PR PATCH] [Updated] " unspecd
                   ` (7 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-05-04 11:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 176 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#issuecomment-831880218

Comment:
Missing a revbump for `gdb` itself.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR PATCH] [Updated] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (44 preceding siblings ...)
  2021-05-04 11:47 ` ericonr
@ 2021-05-04 11:52 ` unspecd
  2021-05-04 20:07 ` [PR REVIEW] " ericonr
                   ` (6 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-05-04 11:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]

There is an updated pull request by unspecd against master on the void-packages repository

https://github.com/unspecd/void-packages gdb
https://github.com/void-linux/void-packages/pull/29382

gdb: clean up templates
Improved consistency across templates.

Also:
- Fixed `post_install` in srcpkgs/avr-gdb.
- Added build option for Guile.
- Updated cross-arm-none-eabi-gdb to 10.2.

<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [x] I built this PR locally for my native architecture, x86_64-musl
- [x] I built this PR locally for these architectures:
  - [x] aarch64
  - [x] aarch64-musl
  - [x] armv7l
  - [ ] ppc
  - [x] ppc-musl


A patch file from https://github.com/void-linux/void-packages/pull/29382.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gdb-29382.patch --]
[-- Type: text/x-diff, Size: 14768 bytes --]

From edb90a19c9760b7b64cd23218da183b5423a5a21 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Sat, 1 May 2021 05:21:55 +1100
Subject: [PATCH 1/4] guile: devel needs dependency on libatomic_ops-devel on
 some targets

---
 srcpkgs/guile/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/guile/template b/srcpkgs/guile/template
index f9ce43c06709..f0f917b1c4ee 100644
--- a/srcpkgs/guile/template
+++ b/srcpkgs/guile/template
@@ -1,13 +1,13 @@
 # Template file for 'guile'
 pkgname=guile
 version=2.2.7
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-static --disable-error-on-warning"
 hostmakedepends="pkg-config texinfo"
 makedepends="gc-devel gmp-devel libatomic_ops-devel libffi-devel libltdl-devel
  libunistring-devel readline-devel"
-short_desc="A portable, embeddable Scheme implementation written in C"
+short_desc="Portable, embeddable Scheme implementation written in C"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-3.0-or-later, LGPL-3.0-or-later"
 homepage="http://www.gnu.org/software/guile"
@@ -40,7 +40,7 @@ libguile_package() {
 
 guile-devel_package() {
 	short_desc+=" - development files"
-	depends="gmp-devel gc-devel guile>=${version}_${revision}"
+	depends="gmp-devel gc-devel guile>=${version}_${revision} libatomic_ops-devel"
 	pkg_install() {
 		vmove usr/bin/guile-config
 		vmove usr/include

From 50e27665fd7d835401e8e03f7ee3170b3f2a3c29 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Wed, 10 Mar 2021 23:26:08 +1100
Subject: [PATCH 2/4] gdb: clean up

Also added build option for Guile.
---
 srcpkgs/gdb-common                           |  1 +
 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch | 11 ++++
 srcpkgs/gdb/template                         | 63 +++++++++-----------
 3 files changed, 41 insertions(+), 34 deletions(-)
 create mode 120000 srcpkgs/gdb-common
 create mode 100644 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/gdb-common b/srcpkgs/gdb-common
new file mode 120000
index 000000000000..f3e03e3f1a44
--- /dev/null
+++ b/srcpkgs/gdb-common
@@ -0,0 +1 @@
+gdb
\ No newline at end of file
diff --git a/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 9648e927efad..bd896d73066b 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,27 +1,36 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=10.2
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
  --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
  $(vopt_enable gdbserver) $(vopt_if multiarch --enable-targets=all)
  $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
- $(vopt_if python --with-python=/usr/bin/python3)
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)
  $(vopt_with debuginfod)"
-hostmakedepends="texinfo perl pkg-config $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
- $(vopt_if python 'python3-devel gettext-devel')
- $(vopt_if debuginfod elfutils-devel)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') $(vopt_if debuginfod elfutils-devel)"
+depends="gdb-common>=${version}_${revision}"
+checkdepends="dejagnu"
 short_desc="GNU Debugger"
 maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
-distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
 checksum=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
+make_check=extended  # Tests take too long, not all of them pass.
 python_version=3
 patch_args="-Np1"
+ignore_elf_files="
+ /usr/share/gdb/guile/gdb/support.go
+ /usr/share/gdb/guile/gdb/experimental.go
+ /usr/share/gdb/guile/gdb/iterator.go
+ /usr/share/gdb/guile/gdb/types.go
+ /usr/share/gdb/guile/gdb/printing.go
+ /usr/share/gdb/guile/gdb.go"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
@@ -29,36 +38,22 @@ if [ "${CROSS_BUILD}" ]; then
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 fi
 
-build_options="gdbserver multiarch static python debuginfod"
+build_options="debuginfod gdbserver guile multiarch python static"
+desc_option_gdbserver="Enable support for building GDB server"
 desc_option_debuginfod="Enable support for libdebuginfod"
 desc_option_multiarch="Enable support for all architectures"
-desc_option_gdbserver="Enable support for building GDB server"
-build_options_default="gdbserver python debuginfod"
+build_options_default="debuginfod gdbserver python"
 vopt_conflict gdbserver static
 vopt_conflict debuginfod static
 
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
+post_install() {
 	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/{include,lib,lib64}
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
+	rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*}
+}
+
+gdb-common_package() {
+	short_desc+=" - common files"
+	pkg_install() {
+		vmove usr/share
+	}
 }

From cb431e49dc109480e95db881267ae8ad937e8f87 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:12:29 +1100
Subject: [PATCH 3/4] avr-gdb: update to 10.2; clean up

Also added build option for Guile.
---
 .../avr-gdb/patches/gdb-mips-linux-nat.patch  | 11 +++
 srcpkgs/avr-gdb/template                      | 74 ++++---------------
 2 files changed, 27 insertions(+), 58 deletions(-)
 create mode 100644 srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/avr-gdb/template b/srcpkgs/avr-gdb/template
index 73d9f9ac7456..bf97ef0be3c9 100644
--- a/srcpkgs/avr-gdb/template
+++ b/srcpkgs/avr-gdb/template
@@ -1,79 +1,37 @@
 # Template file for 'avr-gdb'
 pkgname=avr-gdb
-version=10.1
+version=10.2
 revision=1
 wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/gdb/python"
-configure_args="\
-	--target=avr \
-	--program-prefix=avr- \
-	--disable-werror \
-	--disable-nls \
-	--with-system-readline \
-	--with-system-gdbinit=/etc/gdb/gdbinit \
-	--with-system-zlib $(vopt_enable gdbserver) \
-	$(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static') \
-	$(vopt_if python --with-python=/usr/bin/python3)"
-hostmakedepends="texinfo perl $(vopt_if python python3-devel)"
-makedepends="ncurses-devel zlib-devel readline-devel expat-devel
+configure_args="--target=avr --disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
  $(vopt_if python 'python3-devel gettext-devel')"
-depends=gdb
+depends="gdb-common"
 short_desc="GNU Debugger for AVR"
 maintainer="Artur Sinila <opensource@logarithmus.dev>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/gdb/"
+homepage="https://www.gnu.org/software/gdb"
 distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
-checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
-python_version=3
+checksum=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
+make_check=no  # See gdb/template.
 replaces="cross-avr-gdb>=0"
+patch_args="-Np1"
 
 if [ "${CROSS_BUILD}" ]; then
 	# Make python3.x detection work in cross builds
 	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
 fi
-CFLAGS+=" -fcommon"
-CXXFLAGS+=" -fcommon"
-# Package build options
-build_options="gdbserver static python"
-desc_option_gdbserver="Enable support for building GDB server"
-# By default, don't enable any of build options
-#build_options_default="gdbserver"
-# Both options cannot be enabled at the same time
-vopt_conflict gdbserver static
-
-post_extract() {
-	vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c
-	mkdir -p build
-}
-
-do_configure() {
-	cd build
-	../configure ${configure_args/with-sysroot/with-build-sysroot} \
-		CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon"
-	export gl_cv_func_gettimeofday_clobber=no
-	export gl_cv_func_working_strerror=yes
-	export gl_cv_func_strerror_0_works=yes
-}
 
-do_build() {
-	cd build
-	make ${makejobs} all
-}
-
-do_install() {
-	cd build
-	make DESTDIR=${DESTDIR} ${makejobs} install
-	# resolve conflicts with binutils
-	rm -rf ${DESTDIR}/usr/include ${DESTDIR}/usr/lib
-	rm -rf ${DESTDIR}/usr/lib64
-	for f in bfd configure standards; do
-		rm -f ${DESTDIR}/usr/share/info/${f}.info*
-	done
-}
+# Package build options
+build_options="guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -r ${DESTDIR}/usr/{share/{gdb,info},include}
 }

From 405eb820545f066de094cebb3f1e519ee9991717 Mon Sep 17 00:00:00 2001
From: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Date: Thu, 11 Mar 2021 01:14:22 +1100
Subject: [PATCH 4/4] cross-arm-none-eabi-gdb: update to 10.2, clean up

---
 .../patches/gdb-mips-linux-nat.patch          | 11 +++
 srcpkgs/cross-arm-none-eabi-gdb/template      | 68 ++++++++-----------
 2 files changed, 39 insertions(+), 40 deletions(-)
 create mode 100644 srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch

diff --git a/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
new file mode 100644
index 000000000000..ec4e9c2666f5
--- /dev/null
+++ b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch
@@ -0,0 +1,11 @@
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+ 
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/srcpkgs/cross-arm-none-eabi-gdb/template b/srcpkgs/cross-arm-none-eabi-gdb/template
index ac8e6837d72c..854b9f83b30d 100644
--- a/srcpkgs/cross-arm-none-eabi-gdb/template
+++ b/srcpkgs/cross-arm-none-eabi-gdb/template
@@ -1,48 +1,36 @@
-# Template file for 'cross-${_triplet}-${_pkgname}'
-_triplet=arm-none-eabi
-_pkgname=gdb
-pkgname=cross-${_triplet}-${_pkgname}
-version=8.3
+# Template file for 'cross-arm-none-eabi-gdb'
+pkgname=cross-arm-none-eabi-gdb
+version=10.2
 revision=1
-wrksrc="${_pkgname}-${version}"
+wrksrc=gdb-${version}
 build_style=gnu-configure
-pycompile_dirs="/usr/share/${_pkgname}"
-configure_args="
- --disable-gdbserver
- --disable-nls
- --disable-werror
- --host=${XBPS_CROSS_TRIPLE}
- --prefix=/usr
- --target=${_triplet}
- --with-babeltrace
- --with-expat
- --with-mpfr
- --with-system-readline
- --with-system-zlib
- --without-isl
- $(vopt_with guile)
- $(vopt_with python)
-"
-hostmakedepends="autoconf automake bison flex pkg-config texinfo"
-makedepends="babeltrace-devel expat-devel mpfr-devel ncurses-devel
- readline-devel zlib-devel $(vopt_if guile guile-devel)
- $(vopt_if python 'python3-devel gettext-devel')"
-short_desc="GNU Debugger"
+configure_args="--target=arm-none-eabi --disable-werror --disable-nls --with-system-readline
+ --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib --without-isl
+ $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3)"
+hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)"
+makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel)
+ $(vopt_if python 'python3-devel gettext-devel') babeltrace-devel mpfr-devel"
+depends="gdb-common"
+short_desc="GNU Debugger for ARM"
 maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
 license="GPL-3.0-or-later"
-homepage="https://www.gnu.org/software/${_pkgname}"
-distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}.tar.xz"
-checksum=802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e
-python_version=2 #unverified
-build_options="guile python"
-# don't enable guile and python interfaces until they are moved into
-# platform independent packages
-build_options_default=" "
-nocross=yes
+homepage="https://www.gnu.org/software/gdb"
+distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz"
+checksum=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
+make_check=no  # See gdb/template.
+patch_args="-Np1"
+
+if [ "${CROSS_BUILD}" ]; then
+	# Make python3.x detection work in cross builds
+	CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+	CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}"
+fi
 
-CFLAGS="-fcommon"
+# Package build options
+build_options="guile python"
+build_options_default="python"
 
 post_install() {
-	# resolve conflicts with binutils and native gdb
-	rm -fr ${DESTDIR}/usr/{share/{locale,gdb,info},include}
+	# resolve conflicts with gdb-common
+	rm -r ${DESTDIR}/usr/{share/{gdb,info},include}
 }

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (45 preceding siblings ...)
  2021-05-04 11:52 ` [PR PATCH] [Updated] " unspecd
@ 2021-05-04 20:07 ` ericonr
  2021-05-04 20:07 ` ericonr
                   ` (5 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-05-04 20:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 189 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r626069781

Comment:
Why does `avr-gdb` not have `without-isl`?

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (46 preceding siblings ...)
  2021-05-04 20:07 ` [PR REVIEW] " ericonr
@ 2021-05-04 20:07 ` ericonr
  2021-05-05  6:55 ` Piraty
                   ` (4 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-05-04 20:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 289 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r626070620

Comment:
In the commit message please mention that you could eliminate the gnulib env var overrides because they now guess correctly that musl behaves.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (47 preceding siblings ...)
  2021-05-04 20:07 ` ericonr
@ 2021-05-05  6:55 ` Piraty
  2021-05-06 12:47 ` unspecd
                   ` (3 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: Piraty @ 2021-05-05  6:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 226 bytes --]

New review comment by Piraty on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r626300508

Comment:
i see you sorted the deps, so please sort the build options as well while at it 

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (48 preceding siblings ...)
  2021-05-05  6:55 ` Piraty
@ 2021-05-06 12:47 ` unspecd
  2021-05-06 14:16 ` unspecd
                   ` (2 subsequent siblings)
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-05-06 12:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r627386697

Comment:
I honestly don't know. I am not sure why this library is needed here.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (49 preceding siblings ...)
  2021-05-06 12:47 ` unspecd
@ 2021-05-06 14:16 ` unspecd
  2021-05-06 14:19 ` unspecd
  2021-05-06 14:45 ` ericonr
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-05-06 14:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 538 bytes --]

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r627461382

Comment:
> The cross gdbs are missing gdbserver now

```console
$ ./xbps-src pkg avr-gdb
...
/builddir/gdb-10.2/gdbserver/remote-utils.cc:1235: undefined reference to `using_threads'
/usr/bin/ld: server.o: in function `main':
/builddir/gdb-10.2/gdbserver/server.cc:3826: undefined reference to `initialize_low()'
...
```

I don't think that gdbserver makes sense for avr and arm-none-eabi.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (50 preceding siblings ...)
  2021-05-06 14:16 ` unspecd
@ 2021-05-06 14:19 ` unspecd
  2021-05-06 14:45 ` ericonr
  52 siblings, 0 replies; 54+ messages in thread
From: unspecd @ 2021-05-06 14:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 566 bytes --]

New review comment by unspecd on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r627461382

Comment:
> The cross gdbs are missing gdbserver now

With `--enable-gdbserver`:
```console
$ ./xbps-src pkg avr-gdb
...
/builddir/gdb-10.2/gdbserver/remote-utils.cc:1235: undefined reference to `using_threads'
/usr/bin/ld: server.o: in function `main':
/builddir/gdb-10.2/gdbserver/server.cc:3826: undefined reference to `initialize_low()'
...
```

I don't think that gdbserver makes sense for avr and arm-none-eabi.

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PR REVIEW] gdb: clean up templates
  2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
                   ` (51 preceding siblings ...)
  2021-05-06 14:19 ` unspecd
@ 2021-05-06 14:45 ` ericonr
  52 siblings, 0 replies; 54+ messages in thread
From: ericonr @ 2021-05-06 14:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 268 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29382#discussion_r627486912

Comment:
Argh, sorry. My mind was in previous revisions of this PR.

Indeed, neither of those packages have gdbserver currently.

^ permalink raw reply	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2021-05-06 14:45 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 17:12 [PR PATCH] gdb: clean up templates unspecd
2021-03-11  0:38 ` [PR REVIEW] " sgn
2021-03-11  5:45 ` [PR PATCH] [Updated] " unspecd
2021-03-11  7:33 ` [PR REVIEW] " unspecd
2021-03-18  9:26 ` [PR PATCH] [Updated] " unspecd
2021-03-18  9:46 ` unspecd
2021-03-28  0:46 ` unspecd
2021-04-04 23:11 ` [PR REVIEW] " ericonr
2021-04-11  4:19 ` ericonr
2021-04-11  4:19 ` ericonr
2021-04-11  4:19 ` ericonr
2021-04-11  4:19 ` ericonr
2021-04-11  4:19 ` ericonr
2021-04-14  3:49 ` [PR PATCH] [Updated] " unspecd
2021-04-14  3:56 ` [PR REVIEW] " unspecd
2021-04-14  3:57 ` unspecd
2021-04-14  4:04 ` [PR PATCH] [Updated] " unspecd
2021-04-14  5:09 ` [PR REVIEW] " unspecd
2021-04-14  5:15 ` ericonr
2021-04-14  5:15 ` ericonr
2021-04-14  5:15 ` ericonr
2021-04-14  5:15 ` ericonr
2021-04-14  5:15 ` ericonr
2021-04-14  5:15 ` ericonr
2021-04-14  5:15 ` ericonr
2021-04-14  5:17 ` ericonr
2021-04-14  5:17 ` ericonr
2021-04-14 11:39 ` [PR PATCH] [Updated] " unspecd
2021-04-14 11:40 ` [PR REVIEW] " unspecd
2021-04-14 11:41 ` unspecd
2021-04-14 11:52 ` unspecd
2021-04-14 12:10 ` unspecd
2021-04-14 12:22 ` ericonr
2021-04-15  2:45 ` [PR PATCH] [Updated] " unspecd
2021-04-15  3:20 ` [PR REVIEW] " unspecd
2021-04-26 16:58 ` ericonr
2021-04-30 16:31 ` [PR PATCH] [Updated] " unspecd
2021-04-30 16:55 ` [PR REVIEW] " unspecd
2021-04-30 17:49 ` ericonr
2021-04-30 18:28 ` [PR PATCH] [Updated] " unspecd
2021-04-30 18:35 ` unspecd
2021-04-30 19:15 ` [PR REVIEW] " unspecd
2021-04-30 19:44 ` ericonr
2021-04-30 19:47 ` [PR PATCH] [Updated] " unspecd
2021-04-30 19:49 ` [PR REVIEW] " unspecd
2021-05-04 11:47 ` ericonr
2021-05-04 11:52 ` [PR PATCH] [Updated] " unspecd
2021-05-04 20:07 ` [PR REVIEW] " ericonr
2021-05-04 20:07 ` ericonr
2021-05-05  6:55 ` Piraty
2021-05-06 12:47 ` unspecd
2021-05-06 14:16 ` unspecd
2021-05-06 14:19 ` unspecd
2021-05-06 14:45 ` ericonr

Github messages for voidlinux

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/voidlinux-github

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 voidlinux-github voidlinux-github/ http://inbox.vuxu.org/voidlinux-github \
		voidlinux-github@inbox.vuxu.org
	public-inbox-index voidlinux-github

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.github.voidlinux


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git