aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild/0001-abuild-implement-dbg-subpackages.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-01-16 14:36:12 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2014-01-16 14:36:12 +0100
commit21e22c4be8f2e3a8be3d963ab61af1f558c40191 (patch)
tree0ca7cca2a9d9ba9062e63dafbdfa8bf6d418aef4 /main/abuild/0001-abuild-implement-dbg-subpackages.patch
parent18458d2ab329440c7d82766984b8af62b71d2102 (diff)
downloadaports-21e22c4be8f2e3a8be3d963ab61af1f558c40191.tar.bz2
aports-21e22c4be8f2e3a8be3d963ab61af1f558c40191.tar.xz
main/abuild: implement -dbg subpackages
Simply create a -dbg subpackage and abuild will automatically add symbols there. Patch from Andrew Manison fixes #626
Diffstat (limited to 'main/abuild/0001-abuild-implement-dbg-subpackages.patch')
-rw-r--r--main/abuild/0001-abuild-implement-dbg-subpackages.patch75
1 files changed, 75 insertions, 0 deletions
diff --git a/main/abuild/0001-abuild-implement-dbg-subpackages.patch b/main/abuild/0001-abuild-implement-dbg-subpackages.patch
new file mode 100644
index 0000000000..f2d4acdcad
--- /dev/null
+++ b/main/abuild/0001-abuild-implement-dbg-subpackages.patch
@@ -0,0 +1,75 @@
+From 9cb1ad3cffdb2664205645e2dad0600d6eaa2e1f Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 16 Jan 2014 14:33:45 +0100
+Subject: [PATCH] abuild: implement -dbg subpackages
+
+Patch from Andrew Manison.
+
+ref #626
+---
+ abuild.in | 35 ++++++++++++++++++++++++++++++++++-
+ 1 file changed, 34 insertions(+), 1 deletion(-)
+
+diff --git a/abuild.in b/abuild.in
+index c37af4d..0876380 100755
+--- a/abuild.in
++++ b/abuild.in
+@@ -1245,6 +1245,31 @@ doc() {
+ default_doc
+ }
+
++# predefined splitfunc doc
++default_dbg() {
++ local f
++ binfiles=$(scanelf -R "$pkgdir" | grep ET_DYN | sed "s:$pkgdir\/::g" | sed "s:ET_DYN ::g")
++ for f in $binfiles; do
++ srcdir=$(dirname $pkgdir/$f)
++ srcfile=$(basename $pkgdir/$f)
++ dstdir=$(dirname $subpkgdir/usr/lib/debug/$f.debug)
++ dstfile=$(basename $subpkgdir/usr/lib/debug/$f.debug)
++ if [ ! -d $dstdir ] ; then
++ mkdir -p $dstdir
++ fi
++ cd $srcdir
++ objcopy --only-keep-debug $srcfile $dstfile
++ objcopy --add-gnu-debuglink=$dstfile $srcdir/$srcfile
++ mv $dstfile $dstdir
++ strip $srcfile
++ done
++ return 0
++}
++
++dbg() {
++ default_dbg
++}
++
+ # predefined splitfunc dev
+ default_dev() {
+ local i= j=
+@@ -1675,6 +1700,14 @@ subpackages_has() {
+ return 1
+ }
+
++subpackage_types_has() {
++ local i
++ for i in $subpackages; do
++ [ "$1" = "${i##*-}" ] && return 0
++ done
++ return 1
++}
++
+ list_has() {
+ local needle="$1"
+ local i
+@@ -1946,7 +1979,7 @@ else
+ fi
+
+ # if we want build debug package
+-if [ -n "$DEBUG" ]; then
++if [ -n "$DEBUG" ] || subpackage_types_has "dbg"; then
+ CFLAGS="$CFLAGS -g"
+ options="$options !strip"
+ fi
+--
+1.8.5.2
+