commit:     efb3a82e3496d3a52a1d04d4cbdb83b25655d96a
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 30 18:04:29 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 30 18:09:51 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=efb3a82e

dev-debug/systemtap: conditionally install /usr/bin/dtrace

systemtap provides a 'dtrace' script at /usr/bin/dtrace which obviously
clashes with dev-debug/dtrace. The reasons for this are complicated,
but this 'dtrace' is only used by some packages for userspace probes.

The plan, for now, is:
* to modify packages to look for stap-dtrace instead;
* users can set USE=dtrace-symlink to get systemtap to install /usr/bin/dtrace
  again to build applications locally or as a workaround for unported 
applications/scripts;
* contact systemtap upstream about renaming it and providing a symlink
  conditionally as we are, and providing a pkgconfig var for getting the
  name

Bug: https://bugs.gentoo.org/938302
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-debug/systemtap/metadata.xml                             |  4 ++++
 .../{systemtap-9999.ebuild => systemtap-5.1-r1.ebuild}       | 12 +++++++++---
 dev-debug/systemtap/systemtap-9999.ebuild                    |  9 ++++++++-
 3 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/dev-debug/systemtap/metadata.xml b/dev-debug/systemtap/metadata.xml
index ef6a9e2cd046..eb938ea4fd71 100644
--- a/dev-debug/systemtap/metadata.xml
+++ b/dev-debug/systemtap/metadata.xml
@@ -6,6 +6,10 @@
 </maintainer>
   <use>
     <flag name="debuginfod">Enable debuginfod support via 
<pkg>dev-libs/elfutils</pkg> libdebuginfod</flag>
+    <flag name="dtrace-symlink">
+        Provide /usr/bin/dtrace symlink pointing to /usr/bin/stap-dtrace.
+        This prevents coinstallation with <pkg>dev-debug/dtrace</pkg>.
+    </flag>
     <flag name="libvirt">Support probing of libvirt domains.</flag>
   </use>
 </pkgmetadata>

diff --git a/dev-debug/systemtap/systemtap-9999.ebuild 
b/dev-debug/systemtap/systemtap-5.1-r1.ebuild
similarity index 93%
copy from dev-debug/systemtap/systemtap-9999.ebuild
copy to dev-debug/systemtap/systemtap-5.1-r1.ebuild
index 94c53a3d0f1f..06b3b67bd81b 100644
--- a/dev-debug/systemtap/systemtap-9999.ebuild
+++ b/dev-debug/systemtap/systemtap-5.1-r1.ebuild
@@ -19,7 +19,7 @@ fi
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="debuginfod libvirt selinux sqlite +ssl test zeroconf"
+IUSE="debuginfod dtrace-symlink libvirt selinux sqlite +ssl test zeroconf"
 
 CDEPEND="
        ${PYTHON_DEPS}
@@ -129,8 +129,7 @@ src_configure() {
                $(use_with selinux)
        )
 
-       # Use bash because of bashisms with brace expansion in Makefile.am
-       # https://sourceware.org/PR32105
+       # Use bash because of bashisms with brace expansion in Makefile.am (bug 
#913947)
        CONFIG_SHELL="${BROOT}"/bin/bash PYTHON3="${PYTHON}" econf 
"${myeconfargs[@]}"
 }
 
@@ -151,4 +150,11 @@ src_test() {
 src_install() {
        default
        python_optimize
+
+       # Avoid file collision with dev-debug/dtrace
+       mv "${ED}"/usr/bin/dtrace "${ED}"/usr/bin/stap-dtrace || die
+
+       if use dtrace-symlink ; then
+               dosym stap-dtrace /usr/bin/dtrace
+       fi
 }

diff --git a/dev-debug/systemtap/systemtap-9999.ebuild 
b/dev-debug/systemtap/systemtap-9999.ebuild
index 94c53a3d0f1f..f26acd209aca 100644
--- a/dev-debug/systemtap/systemtap-9999.ebuild
+++ b/dev-debug/systemtap/systemtap-9999.ebuild
@@ -19,7 +19,7 @@ fi
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="debuginfod libvirt selinux sqlite +ssl test zeroconf"
+IUSE="debuginfod dtrace-symlink libvirt selinux sqlite +ssl test zeroconf"
 
 CDEPEND="
        ${PYTHON_DEPS}
@@ -151,4 +151,11 @@ src_test() {
 src_install() {
        default
        python_optimize
+
+       # Avoid file collision with dev-debug/dtrace
+       mv "${ED}"/usr/bin/dtrace "${ED}"/usr/bin/stap-dtrace || die
+
+       if use dtrace-symlink ; then
+               dosym stap-dtrace /usr/bin/dtrace
+       fi
 }

Reply via email to