commit:     a06492de4ee694d13179fa0c975237d8e0520b97
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Sep  2 07:46:09 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Sep  2 07:46:09 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a06492de

dev-util/strace: add 6.5

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/strace/Manifest                      |   1 +
 dev-util/strace/files/strace-6.5-static.patch | 178 ++++++++++++++++++++++++++
 dev-util/strace/strace-6.5.ebuild             | 109 ++++++++++++++++
 3 files changed, 288 insertions(+)

diff --git a/dev-util/strace/Manifest b/dev-util/strace/Manifest
index 1b9e267be366..b5c41b43e0d4 100644
--- a/dev-util/strace/Manifest
+++ b/dev-util/strace/Manifest
@@ -1,3 +1,4 @@
 DIST strace-6.2.tar.xz 2364280 BLAKE2B 
8e51cb3e426e9b99d598b4fcece21ba7873e81468cddae04c2f0b1a48dc40643c626acadd226389c33dbef5350b502817d3459d445fc17cce149f7e501c15ae2
 SHA512 
56708faa3f73c0673c98a5b8b8fe35289ecf2870f4f775bcb7a6be59451ef84685564c0129aca15b576d851f8efa1ff760e27658b914d1f31adf4de3b1ad721f
 DIST strace-6.3.tar.xz 2382284 BLAKE2B 
7373ebddd6f23713b752ed91598e536d61e08865907c7825dd3492574c7feb0ad6d56bea0e144e1082ac1882d68bb5f160f25e70bfc6e2fd47571ef2c40403fb
 SHA512 
2b0a57e3ee8a23eb3882123149cd732c568322614bf8fde69fabcea64d0d4e3c46c71d63183e0e8d9f8744a7b1cebc823cc67023660c37547f5b854fcc1ca9df
 DIST strace-6.4.tar.xz 2391828 BLAKE2B 
a9d359679bc5cc61061eb9f19a6156637f12509cb1045462b1547cba8a1218a9b2a4d3b87cf4a33856500515cc0bd457c1374b0ed349293821d80e3cc0de0452
 SHA512 
29f47195b2766dc0d2907aba2d561e87ec87939251d07fd82d22ffdd3c864944ab0c47eabd7b13272345dfc5dfae7ca435c94fd5ccc297dd46e0747c6d463e01
+DIST strace-6.5.tar.xz 2412228 BLAKE2B 
f5ce212baf6513432ff55e9afaa41eba2dbda6acb1d3cad7f42d44519b37f5b239c949e2e7ea6504a4c26e811ef8c7f082c9cec0756318fab8403b389afaada7
 SHA512 
7edf7b00b5ad91be2df4e44b63df7f88376f3e6a8f078dfccf307a6a5003ad25d9cf233f2a32139e00fe399494ce6a8f67728bf9dfeb9bb5958ed08ce25e9e01

diff --git a/dev-util/strace/files/strace-6.5-static.patch 
b/dev-util/strace/files/strace-6.5-static.patch
new file mode 100644
index 000000000000..67e4b05ca856
--- /dev/null
+++ b/dev-util/strace/files/strace-6.5-static.patch
@@ -0,0 +1,178 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -54,6 +54,15 @@ AC_SUBST([STRACE_MANPAGE_DATE], [strace_manpage_date])
+ AC_DEFINE([SLM_MANPAGE_DATE], "[slm_manpage_date]", [Date])
+ AC_SUBST([SLM_MANPAGE_DATE], [slm_manpage_date])
+ 
++AC_ARG_ENABLE([static],
++            [AS_HELP_STRING([--enable-static],
++                            [link strace statically])],
++            [], [enable_static=no])
++if test "$enable_static" = "yes"; then
++      # Add -pthread since strace wants -lrt for timer_create, and -lrt uses 
-lpthread.
++      LDFLAGS="$LDFLAGS -pthread -static"
++fi
++
+ AC_C_BIGENDIAN
+ 
+ dnl arch-specific default for --enable-gcc-Werror
+--- a/m4/st_libdw.m4
++++ b/m4/st_libdw.m4
+@@ -8,7 +8,6 @@
+ AC_DEFUN([st_ARG_LIBDW], [dnl
+ 
+ : ${libdw_CPPFLAGS=}
+-: ${libdw_CFLAGS=}
+ : ${libdw_LDFLAGS=}
+ : ${libdw_LIBS=}
+ 
+@@ -34,48 +33,14 @@ AC_DEFUN([st_LIBDW], [dnl
+ have_libdw=
+ 
+ AS_IF([test "x$with_libdw" != xno && test "x$use_unwinder" = x],
+-      [saved_CPPFLAGS="$CPPFLAGS"
+-       saved_CFLAGS="$CFLAGS"
+-       CPPFLAGS="$CPPFLAGS $libdw_CPPFLAGS"
+-       CFLAGS="$CFLAGS $libdw_CFLAGS"
+-
+-       AC_CHECK_HEADERS([elfutils/libdwfl.h],
+-                      [AC_CHECK_LIB([dw], [dwfl_linux_proc_attach],
+-                                    [libdw_LIBS="-ldw $libdw_LIBS"
+-                                     AC_CACHE_CHECK([for elfutils version],
+-                                                    [st_cv_ELFUTILS_VERSION],
+-                                                    
[[st_cv_ELFUTILS_VERSION="$(echo _ELFUTILS_VERSION |
+-                                                                              
  $CPP $CPPFLAGS -P -imacros elfutils/version.h - |
+-                                                                              
  grep '^[0-9]')"
+-                                                      test -n 
"$st_cv_ELFUTILS_VERSION" ||
+-                                                              
st_cv_ELFUTILS_VERSION=0
+-                                                    ]]
+-                                                   )
+-                                     AS_IF([test "$st_cv_ELFUTILS_VERSION" 
-ge 164],
+-                                           [have_libdw=yes],
+-                                           [AS_IF([test "x$with_libdw" = 
xyes],
+-                                                  [AC_MSG_ERROR([elfutils 
version >= 164 is required for stack tracing support])],
+-                                                  [AC_MSG_WARN([elfutils 
version >= 164 is required for stack tracing support])]
+-                                                 )
+-                                           ]
+-                                          )
+-                                    ],
+-                                    [AS_IF([test "x$with_libdw" = xyes],
+-                                           [AC_MSG_FAILURE([failed to find 
dwfl_linux_proc_attach in libdw])],
+-                                          )
+-                                    ],
+-                                    [$libdw_LDFLAGS $libdw_LIBS]
+-                                   )
+-                      ],
+-                      [AS_IF([test "x$with_libdw" = xyes],
+-                             [AC_MSG_FAILURE([failed to find 
elfutils/libdwfl.h])]
+-                            )
+-                      ]
+-                     )
+-
+-       CFLAGS="$saved_CFLAGS"
+-       CPPFLAGS="$saved_CPPFLAGS"
+-      ]
++      [if test "$enable_static" = "yes"; then
++           PKG_CHECK_MODULES_STATIC([LIBDW], [libdw >= 0.164])
++       else
++           PKG_CHECK_MODULES([LIBDW], [libdw >= 0.164])
++       fi
++       have_libdw=yes
++       libdw_CPPFLAGS="$LIBDW_CFLAGS"
++       libdw_LIBS="$LIBDW_LIBS"]
+ )
+ 
+ AS_IF([test "x$have_libdw" = xyes],
+@@ -84,7 +49,6 @@ AS_IF([test "x$have_libdw" = xyes],
+                [Whether to use libdw for stack tracing]
+               )
+        AC_SUBST(libdw_CPPFLAGS)
+-       AC_SUBST(libdw_CFLAGS)
+        AC_SUBST(libdw_LDFLAGS)
+        AC_SUBST(libdw_LIBS)
+       ]
+--- a/m4/st_libunwind.m4
++++ b/m4/st_libunwind.m4
+@@ -28,64 +28,14 @@ AC_ARG_WITH([libunwind],
+ AC_DEFUN([st_LIBUNWIND], [dnl
+ 
+ AS_IF([test "x$with_libunwind" != xno && test "x$use_unwinder" = x],
+-      [saved_CPPFLAGS="$CPPFLAGS"
+-       CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS"
+-
+-       AC_CHECK_HEADERS([libunwind-ptrace.h],
+-       [saved_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS $libunwind_LDFLAGS"
+-
+-        AC_CHECK_LIB([unwind], [backtrace],
+-          [libunwind_LIBS="-lunwind $libunwind_LIBS"
+-
+-           AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic])
+-           saved_LIBS="$LIBS"
+-           LIBS="-lunwind-generic $libunwind_LIBS $LIBS"
+-
+-           AC_LINK_IFELSE(
+-             [AC_LANG_PROGRAM([[#include <libunwind-ptrace.h>]],
+-                              [[return !unw_create_addr_space(0, 0)]])
+-             ],
+-             [AC_MSG_RESULT([yes])
+-              libunwind_LIBS="-lunwind-generic $libunwind_LIBS"
+-
+-              AC_CHECK_LIB([unwind-ptrace], [_UPT_create],
+-                [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS"
+-                 use_unwinder=libunwind
+-                ],
+-                [if test "x$with_libunwind" != xcheck; then
+-                   AC_MSG_FAILURE([failed to find _UPT_create in 
libunwind-ptrace])
+-                 fi
+-                ],
+-                [$libunwind_LIBS]
+-              )
+-             ],
+-             [AC_MSG_RESULT([no])
+-              if test "x$with_libunwind" != xcheck; then
+-                AC_MSG_FAILURE([failed to find unw_create_addr_space in 
libunwind-generic])
+-              fi
+-             ]
+-           )
+-
+-           LIBS="$saved_LIBS"
+-          ],
+-          [if test "x$with_libunwind" != xcheck; then
+-             AC_MSG_FAILURE([failed to find libunwind])
+-           fi
+-          ],
+-          [$libunwind_LIBS]
+-        )
+-
+-        LDFLAGS="$saved_LDFLAGS"
+-       ],
+-       [if test "x$with_libunwind" != xcheck; then
+-          AC_MSG_FAILURE([failed to find libunwind-ptrace.h])
+-        fi
+-       ]
+-       )
+-
+-       CPPFLAGS="$saved_CPPFLAGS"
+-      ]
++      [if test "$enable_static" = "yes"; then
++           PKG_CHECK_MODULES_STATIC([LIBUNWIND], [libunwind libunwind-generic 
libunwind-ptrace])
++       else
++           PKG_CHECK_MODULES([LIBUNWIND], [libunwind libunwind-generic 
libunwind-ptrace])
++       fi
++       use_unwinder="libunwind"
++       libunwind_CPPFLAGS="$LIBUNWIND_CFLAGS"
++       libunwind_LIBS="$LIBUNWIND_LIBS"]
+ )
+ 
+ if test "x$use_unwinder" = xlibunwind; then
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -417,7 +417,6 @@ libstrace_a_SOURCES += unwind.c unwind.h
+ if USE_LIBDW
+ libstrace_a_SOURCES += unwind-libdw.c
+ strace_CPPFLAGS += $(libdw_CPPFLAGS)
+-strace_CFLAGS += $(libdw_CFLAGS)
+ strace_LDFLAGS += $(libdw_LDFLAGS)
+ strace_LDADD += $(libdw_LIBS)
+ endif

diff --git a/dev-util/strace/strace-6.5.ebuild 
b/dev-util/strace/strace-6.5.ebuild
new file mode 100644
index 000000000000..1907bffd5d1e
--- /dev/null
+++ b/dev-util/strace/strace-6.5.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools edo flag-o-matic toolchain-funcs
+
+DESCRIPTION="Useful diagnostic, instructional, and debugging tool"
+HOMEPAGE="https://strace.io/";
+
+if [[ ${PV} == 9999 ]] ; then
+       EGIT_REPO_URI="https://github.com/strace/strace.git";
+       inherit git-r3
+else
+       
SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.xz";
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc 
~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+LICENSE="LGPL-2.1+ test? ( GPL-2+ )"
+SLOT="0"
+IUSE="aio perl selinux static test unwind elfutils"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="?? ( unwind elfutils )"
+
+BDEPEND="virtual/pkgconfig"
+LIB_DEPEND="
+       unwind? ( sys-libs/libunwind[static-libs(+)] )
+       elfutils? ( dev-libs/elfutils[static-libs(+)] )
+       selinux? ( sys-libs/libselinux[static-libs(+)] )
+"
+# strace only uses the header from libaio to decode structs
+DEPEND="
+       static? ( ${LIB_DEPEND} )
+       aio? ( >=dev-libs/libaio-0.3.106 )
+       sys-kernel/linux-headers
+"
+RDEPEND="
+       !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+       perl? ( dev-lang/perl )
+"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-6.5-static.patch"
+)
+
+src_prepare() {
+       default
+
+       if [[ ! -e configure ]] ; then
+               # git generation
+               sed /autoreconf/d -i bootstrap || die
+               edo ./bootstrap
+               [[ ! -e CREDITS ]] && cp CREDITS{.in,}
+       fi
+
+       eautoreconf
+
+       # Stub out the -k test since it's known to be flaky. bug #545812
+       sed -i '1iexit 77' tests*/strace-k.test || die
+}
+
+src_configure() {
+       # Set up the default build settings, and then use the names strace 
expects.
+       tc-export_build_env BUILD_{CC,CPP}
+       local v bv
+       for v in CC CPP {C,CPP,LD}FLAGS ; do
+               bv="BUILD_${v}"
+               export "${v}_FOR_BUILD=${!bv}"
+       done
+
+       filter-lfs-flags # configure handles this sanely
+
+       export ac_cv_header_libaio_h=$(usex aio)
+       use elibc_musl && export ac_cv_header_stdc=no
+
+       local myeconfargs=(
+               --disable-gcc-Werror
+
+               # Don't require mpers support on non-multilib systems. #649560
+               --enable-mpers=check
+
+               $(use_enable static)
+               $(use_with unwind libunwind)
+               $(use_with elfutils libdw)
+               $(use_with selinux libselinux)
+       )
+       econf "${myeconfargs[@]}"
+}
+
+src_test() {
+       if has usersandbox ${FEATURES} ; then
+               # bug #643044
+               ewarn "Test suite is known to fail with FEATURES=usersandbox -- 
skipping ..."
+               return 0
+       fi
+
+       default
+}
+
+src_install() {
+       default
+
+       if use perl ; then
+               exeinto /usr/bin
+               doexe src/strace-graph
+       fi
+
+       dodoc CREDITS
+}

Reply via email to