summaryrefslogtreecommitdiffstats
path: root/main/abuild/0001-abuild-implement-dbg-subpackages.patch
diff options
context:
space:
mode:
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 000000000..f2d4acdca
--- /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
+