dev-util/strace: add USE=unwind to control libunwind usage
authorMike Frysinger <vapier@gentoo.org>
Tue, 29 Sep 2015 19:12:19 +0000 (15:12 -0400)
committerMike Frysinger <vapier@gentoo.org>
Tue, 29 Sep 2015 19:15:17 +0000 (15:15 -0400)
dev-util/strace/metadata.xml
dev-util/strace/strace-4.10.ebuild
dev-util/strace/strace-4.9.ebuild
dev-util/strace/strace-9999.ebuild

index 392a501dd31ac04764396bbf4417efc5ff08dd95..0ca954da6d5f09f25138c56c3dd6ee0659315ef0 100644 (file)
@@ -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>
index dba2a1e537962943a559f81f9116015f34803e82..59e215bfb15f154bfa746f62b08a90ad0d751b6a 100644 (file)
@@ -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
index 287aa8b3dfb3a60923fff9e7119700291d649137..5fd2fd6c1a92754af6c2153e044bb45939262fd2 100644 (file)
@@ -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
index 8a1e0d6ef4c63ceb75cac88eeb0544b510e9eb81..9a701506480bebc1eed2244942df9a35a2df3f6f 100644 (file)
@@ -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