aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2019-04-29 20:53:39 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2019-04-29 20:53:39 +0000
commit32345c1db2d5994dc6c8a78998d24e740b2b9ad3 (patch)
tree8019084fe085b4c3958b95e53a7645e08eac0ba8 /main/abuild
parente962598dec75a0bd386cfa410d4db1bf359c4309 (diff)
downloadaports-32345c1db2d5994dc6c8a78998d24e740b2b9ad3.tar.bz2
aports-32345c1db2d5994dc6c8a78998d24e740b2b9ad3.tar.xz
main/abuild: backport upstream fix
Diffstat (limited to 'main/abuild')
-rw-r--r--main/abuild/0001-abuild-default_dbg-eliminate-side-effects.patch68
-rw-r--r--main/abuild/APKBUILD6
2 files changed, 72 insertions, 2 deletions
diff --git a/main/abuild/0001-abuild-default_dbg-eliminate-side-effects.patch b/main/abuild/0001-abuild-default_dbg-eliminate-side-effects.patch
new file mode 100644
index 0000000000..4c311664c1
--- /dev/null
+++ b/main/abuild/0001-abuild-default_dbg-eliminate-side-effects.patch
@@ -0,0 +1,68 @@
+From 5b163c2d58c7a135fd6ff6dc31995252f1c139d2 Mon Sep 17 00:00:00 2001
+From: tcely <tcely@users.noreply.github.com>
+Date: Mon, 29 Apr 2019 16:45:23 -0400
+Subject: [PATCH] abuild: default_dbg: eliminate side effects
+
+- do not overwrite variables
+
+srcdir is very important for abuild operation
+
+- quoted various paths
+- use a sub-shell to contain directory changing
+
+Resolves alpinelinux/abuild#58
+---
+ abuild.in | 35 ++++++++++++++++++-----------------
+ 1 file changed, 18 insertions(+), 17 deletions(-)
+
+diff --git a/abuild.in b/abuild.in
+index d0ae691..7acc422 100644
+--- a/abuild.in
++++ b/abuild.in
+@@ -1676,25 +1676,26 @@ doc() {
+
+ # predefined splitfunc dbg
+ default_dbg() {
+- local f
++ local ddbg_binfiles f ddbg_srcdir ddbg_srcfile ddbg_dstdir ddbg_dstfile
+ pkgdesc="$pkgdesc (debug symbols)"
+
+- 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
+- local XATTR=$(getfattr --match="" --dump "${srcfile}")
+- ${CROSS_COMPILE}objcopy --only-keep-debug $srcfile $dstfile
+- ${CROSS_COMPILE}objcopy --add-gnu-debuglink=$dstfile $srcdir/$srcfile
+- mv $dstfile $dstdir
+- ${CROSS_COMPILE}strip $srcfile
+- [ -n "$XATTR" ] && { echo "$XATTR" | setfattr --restore=-; }
++ ddbg_binfiles=$(scanelf -R "$pkgdir" | grep ET_DYN | sed "s:$pkgdir\/::g" | sed "s:ET_DYN ::g")
++ for f in $ddbg_binfiles; do
++ ddbg_srcdir=$(dirname "$pkgdir/$f")
++ ddbg_srcfile=$(basename "$pkgdir/$f")
++ ddbg_dstdir=$(dirname "$subpkgdir/usr/lib/debug/$f.debug")
++ ddbg_dstfile=$(basename "$subpkgdir/usr/lib/debug/$f.debug")
++ [ -d "$ddbg_dstdir" ] || mkdir -p "$ddbg_dstdir"
++
++ (
++ cd "$ddbg_srcdir"
++ XATTR=$(getfattr --match="" --dump "${ddbg_srcfile}")
++ ${CROSS_COMPILE}objcopy --only-keep-debug "$ddbg_srcfile" "$ddbg_dstfile"
++ ${CROSS_COMPILE}objcopy --add-gnu-debuglink="$ddbg_dstfile" "$ddbg_srcdir/$ddbg_srcfile"
++ mv "$ddbg_dstfile" "$ddbg_dstdir"
++ ${CROSS_COMPILE}strip "$ddbg_srcfile"
++ [ -n "$XATTR" ] && { echo "$XATTR" | setfattr --restore=-; }
++ )
+ done
+ return 0
+ }
+--
+2.21.0
+
diff --git a/main/abuild/APKBUILD b/main/abuild/APKBUILD
index a018bb6360..0e33512b51 100644
--- a/main/abuild/APKBUILD
+++ b/main/abuild/APKBUILD
@@ -2,7 +2,7 @@
pkgname=abuild
pkgver=3.4.0_rc2
_ver=${pkgver%_git*}
-pkgrel=0
+pkgrel=1
pkgdesc="Script to build Alpine Packages"
url="https://git.alpinelinux.org/cgit/abuild/"
arch="all"
@@ -21,6 +21,7 @@ subpackages="apkbuild-cpan:cpan:noarch apkbuild-gem-resolver:gems:noarch
options="suid !check"
pkggroups="abuild"
source="https://dev.alpinelinux.org/archive/abuild/abuild-$_ver.tar.xz
+ 0001-abuild-default_dbg-eliminate-side-effects.patch
"
builddir="$srcdir/$pkgname-$_ver"
@@ -68,4 +69,5 @@ _rootbld() {
mkdir -p "$subpkgdir"
}
-sha512sums="b63b4e8cdb16d29f012830f7fb6eb4450d813b434166bf911ac257348d36d3d08326aebe076e64358557eebc962a4241237e82e2be3be3e6ee595751498f3af8 abuild-3.4.0_rc2.tar.xz"
+sha512sums="b63b4e8cdb16d29f012830f7fb6eb4450d813b434166bf911ac257348d36d3d08326aebe076e64358557eebc962a4241237e82e2be3be3e6ee595751498f3af8 abuild-3.4.0_rc2.tar.xz
+fb81e4d0ed800cd962377f2269c4cffc48b440bd0f6ae09e369f55da24e2b68134c5c35e2f8c3309d42d674b18ff57216349112c2d4d408b3cc2b57db2d30d62 0001-abuild-default_dbg-eliminate-side-effects.patch"