commit:     ae5dc52c91c6085a54a3454e218a088dcfe39c95
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 29 19:12:19 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Tue Sep 29 19:15:17 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae5dc52c

dev-util/strace: add USE=unwind to control libunwind usage

 dev-util/strace/metadata.xml       |  3 +++
 dev-util/strace/strace-4.10.ebuild | 13 ++++++++++---
 dev-util/strace/strace-4.9.ebuild  | 12 +++++++++---
 dev-util/strace/strace-9999.ebuild | 13 ++++++++++---
 4 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/dev-util/strace/metadata.xml b/dev-util/strace/metadata.xml
index 392a501..0ca954d 100644
--- a/dev-util/strace/metadata.xml
+++ b/dev-util/strace/metadata.xml
@@ -6,6 +6,9 @@
     <flag name="aio">
       Enable <pkg>dev-libs/libaio</pkg> support for tracing Asynchronous I/O 
operations
     </flag>
+    <flag name="unwind">
+      Enable stack backtraces (-k flag) via <pkg>sys-libs/libunwind</pkg>
+    </flag>
   </use>
   <upstream>
     <remote-id type="sourceforge">strace</remote-id>

diff --git a/dev-util/strace/strace-4.10.ebuild 
b/dev-util/strace/strace-4.10.ebuild
index dba2a1e..59e215b 100644
--- a/dev-util/strace/strace-4.10.ebuild
+++ b/dev-util/strace/strace-4.10.ebuild
@@ -19,12 +19,15 @@ HOMEPAGE="http://sourceforge.net/projects/strace/";
 
 LICENSE="BSD"
 SLOT="0"
-IUSE="aio perl static"
+IUSE="aio perl static unwind"
 
+LIB_DEPEND="unwind? ( sys-libs/libunwind[static-libs(+)] )"
 # strace only uses the header from libaio to decode structs
-DEPEND="aio? ( >=dev-libs/libaio-0.3.106 )
+DEPEND="static? ( ${LIB_DEPEND} )
+       aio? ( >=dev-libs/libaio-0.3.106 )
        sys-kernel/linux-headers"
-RDEPEND="perl? ( dev-lang/perl )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+       perl? ( dev-lang/perl )"
 
 src_prepare() {
        if epatch_user || [[ ! -e configure ]] ; then
@@ -43,6 +46,10 @@ src_prepare() {
        sed -i '1iexit 77' tests*/strace-k.test || die
 }
 
+src_configure() {
+       econf $(use_with unwind libunwind)
+}
+
 src_install() {
        default
        use perl || rm "${ED}"/usr/bin/strace-graph

diff --git a/dev-util/strace/strace-4.9.ebuild 
b/dev-util/strace/strace-4.9.ebuild
index 287aa8b..5fd2fd6 100644
--- a/dev-util/strace/strace-4.9.ebuild
+++ b/dev-util/strace/strace-4.9.ebuild
@@ -19,12 +19,14 @@ HOMEPAGE="http://sourceforge.net/projects/strace/";
 
 LICENSE="BSD"
 SLOT="0"
-IUSE="aio +perl static"
+IUSE="aio +perl static unwind"
 
+LIB_DEPEND="unwind? ( sys-libs/libunwind[static-libs(+)] )"
 # strace only uses the header from libaio to decode structs
-DEPEND="aio? ( >=dev-libs/libaio-0.3.106 )
+DEPEND="static? ( ${LIB_DEPEND} )
+       aio? ( >=dev-libs/libaio-0.3.106 )
        sys-kernel/linux-headers"
-RDEPEND=""
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
 
 src_prepare() {
        if epatch_user || [[ ! -e configure ]] ; then
@@ -40,6 +42,10 @@ src_prepare() {
        export ac_cv_header_libaio_h=$(usex aio)
 }
 
+src_configure() {
+       econf $(use_with unwind libunwind)
+}
+
 src_install() {
        default
        use perl || rm "${ED}"/usr/bin/strace-graph

diff --git a/dev-util/strace/strace-9999.ebuild 
b/dev-util/strace/strace-9999.ebuild
index 8a1e0d6..9a70150 100644
--- a/dev-util/strace/strace-9999.ebuild
+++ b/dev-util/strace/strace-9999.ebuild
@@ -19,12 +19,15 @@ HOMEPAGE="http://sourceforge.net/projects/strace/";
 
 LICENSE="BSD"
 SLOT="0"
-IUSE="aio perl static"
+IUSE="aio perl static unwind"
 
+LIB_DEPEND="unwind? ( sys-libs/libunwind[static-libs(+)] )"
 # strace only uses the header from libaio to decode structs
-DEPEND="aio? ( >=dev-libs/libaio-0.3.106 )
+DEPEND="static? ( ${LIB_DEPEND} )
+       aio? ( >=dev-libs/libaio-0.3.106 )
        sys-kernel/linux-headers"
-RDEPEND="perl? ( dev-lang/perl )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+       perl? ( dev-lang/perl )"
 
 src_prepare() {
        if epatch_user || [[ ! -e configure ]] ; then
@@ -44,6 +47,10 @@ src_prepare() {
        sed -i '1iexit 77' tests*/strace-k.test || die
 }
 
+src_configure() {
+       econf $(use_with unwind libunwind)
+}
+
 src_install() {
        default
        use perl || rm "${ED}"/usr/bin/strace-graph

Reply via email to