commit: abb6607f7f952a9824f980521ccdf88549345059
Author: Nicolas PARLANT <nicolas.parlant <AT> parhuet <DOT> fr>
AuthorDate: Fri Mar 21 05:23:19 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Mar 24 05:23:25 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=abb6607f
dev-debug/apitrace: add 12.0, qt6
qt6 (network not required)
deps :
rm media-libs/libglvnd as it uses bundled headers to preserve compatibility
rm sys-process/procps as it requires a header provided only by procps-3
and from upstream "I was planning to deprecate procps use in apitrace"
add 3rd libbacktrace, not in tree
virtual/pkgconfig
add dev-python/pillow and dev-python/numpy in optfeatures
IUSE :
add test (dev-cpp/gtest)
qt6 -> gui
multilib :
add gltrim
add symlinks for libEGL wrapper
Closes: https://bugs.gentoo.org/951573
Signed-off-by: Nicolas PARLANT <nicolas.parlant <AT> parhuet.fr>
Closes: https://github.com/gentoo/gentoo/pull/41210
Signed-off-by: Sam James <sam <AT> gentoo.org>
dev-debug/apitrace/Manifest | 2 +
dev-debug/apitrace/apitrace-12.0.ebuild | 113 +++++++++++++++++++++
.../files/apitrace-12.0-include-stdint.patch | 25 +++++
.../files/apitrace-12.0-no_qtnetwork.patch | 25 +++++
dev-debug/apitrace/files/apitrace-12.0-tests.patch | 21 ++++
.../apitrace/files/apitrace-12.0-unbundle.patch | 30 ++++++
6 files changed, 216 insertions(+)
diff --git a/dev-debug/apitrace/Manifest b/dev-debug/apitrace/Manifest
index 8aee6fea902e..3e3b1496cfaf 100644
--- a/dev-debug/apitrace/Manifest
+++ b/dev-debug/apitrace/Manifest
@@ -1 +1,3 @@
+DIST
apitrace-12.0-libbacktrace-8602fda64e78f1f46563220f2ee9f7e70819c51d.tar.gz
666166 BLAKE2B
1b35e0dafe31bc5d4fcc826f87f2e8200c27a4194719ee22d278b25fe081ec604e579aee72ebd7ea6d401b1a5bbc4b496b1083e3d761117bc3ccf23aabe046eb
SHA512
8f303ff11250cbc644c91a07a55ffb1c6d52ca5eb76e3ea9405645bdd00715a25f57d1f39c7af16efbbe5b008ec76890f7fb3bca95eb89e7cd9a55c14a211643
+DIST apitrace-12.0.tar.gz 2273615 BLAKE2B
a58f4d7bc607858e3080d56c739da356c169b25c139ca253f0b15d248a850ede54179776a500321f15e5f389271ad69f5c8c8dec47e0d0b3d4ae9afcea8bda41
SHA512
2af33aec39f43556765455662c69ee22bf3ff5d5fe8b0ca58fe3d555ab1571eab5ddbd4f0011b0c1669043314c8d5166b886ac2825f85d74ebadd9f848598698
DIST apitrace-9.0.tar.gz 3623693 BLAKE2B
885cfd22d1cc82e36f7f0d65b816784986a8a693d04b483c059d3cffb0328c2cbbfd043793b964cea84d7b09a0dc8dda5f464099e91df26fd5eecef4bbeb28cc
SHA512
4234bc2d14378b1bd9554752d83f8ce0703b4e08c3edc85769dc988a2b3a44b8e55d2f5856954658155a11d69802849bae6350ed5031a5916c7ac7bc7287918c
diff --git a/dev-debug/apitrace/apitrace-12.0.ebuild
b/dev-debug/apitrace/apitrace-12.0.ebuild
new file mode 100644
index 000000000000..a42ec871ba6a
--- /dev/null
+++ b/dev-debug/apitrace/apitrace-12.0.ebuild
@@ -0,0 +1,113 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..13} )
+inherit cmake-multilib multilib optfeature python-single-r1
+
+DESCRIPTION="Tool for tracing, analyzing, and debugging graphics APIs"
+HOMEPAGE="https://github.com/apitrace/apitrace"
+BACKTRACE_COMMIT="8602fda64e78f1f46563220f2ee9f7e70819c51d"
+SRC_URI="
+ https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
+
https://github.com/ianlancetaylor/libbacktrace/archive/${BACKTRACE_COMMIT}.tar.gz
+ -> ${P}-libbacktrace-${BACKTRACE_COMMIT}.tar.gz
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="gui test X"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="!test? ( test )"
+
+DEPEND="${PYTHON_DEPS}
+ app-arch/brotli:=[${MULTILIB_USEDEP}]
+ app-arch/snappy:=[${MULTILIB_USEDEP}]
+ media-libs/libpng:0=
+ media-libs/waffle[${MULTILIB_USEDEP}]
+ sys-libs/zlib[${MULTILIB_USEDEP}]
+ gui? ( dev-qt/qtbase:6[-gles2-only,gui,widgets] )
+ X? ( x11-libs/libX11 )
+"
+RDEPEND="${DEPEND}"
+BDEPEND="
+ virtual/pkgconfig
+ test? ( dev-cpp/gtest )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-9.0-disable-multiarch.patch
+ "${FILESDIR}"/${PN}-9.0-pkgconfig-waffle.patch
+ "${FILESDIR}"/${PN}-12.0-no_qtnetwork.patch
+ "${FILESDIR}"/${PN}-12.0-tests.patch
+ "${FILESDIR}"/${PN}-12.0-unbundle.patch
+ # merged, to be removed for the next version
+ "${FILESDIR}"/${PN}-12.0-include-stdint.patch
+)
+
+src_prepare() {
+ sed -e "s:0.0-unknown:${PV}:" -i cmake/GenerateVersion.cmake || die
+
+ # still 3rd libs: khronos, crc32c and md5-compat
+ rm -r $(find thirdparty -mindepth 1 -maxdepth 1 \
+ ! -name crc32c \
+ ! -name khronos \
+ ! -name md5 \
+ ! -name support \
+ -type d -print) || die
+
+ mv "${WORKDIR}"/libbacktrace-${BACKTRACE_COMMIT}
thirdparty/libbacktrace || die
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ my_configure() {
+ local mycmakeargs=(
+ -DBUILD_TESTING=$(usex test)
+ -DDOC_INSTALL_DIR="${EPREFIX}"/usr/share/doc/${PF}
+ -DENABLE_X11=$(usex X)
+ -DENABLE_EGL=ON
+ -DENABLE_CLI=ON
+ -DENABLE_GUI=$(multilib_native_usex gui)
+ -DENABLE_QT6=$(multilib_native_usex gui)
+ -DENABLE_STATIC_SNAPPY=OFF
+ -DENABLE_WAFFLE=ON
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+ cmake_src_configure
+ }
+
+ multilib_foreach_abi my_configure
+}
+
+src_install() {
+ MULTILIB_CHOST_TOOLS=(
+ /usr/bin/apitrace$(get_exeext)
+ /usr/bin/eglretrace$(get_exeext)
+ /usr/bin/gltrim$(get_exeext)
+ )
+ use X && MULTILIB_CHOST_TOOLS+=( /usr/bin/glretrace$(get_exeext) )
+
+ cmake-multilib_src_install
+
+ make_libegl_symlinks() {
+ dosym egltrace.so /usr/$(get_libdir)/${PN}/wrappers/libEGL.so
+ dosym egltrace.so /usr/$(get_libdir)/${PN}/wrappers/libEGL.so.1
+ }
+ multilib_foreach_abi make_libegl_symlinks
+
+ make_libgl_symlinks() {
+ dosym glxtrace.so /usr/$(get_libdir)/${PN}/wrappers/libGL.so
+ dosym glxtrace.so /usr/$(get_libdir)/${PN}/wrappers/libGL.so.1
+ dosym glxtrace.so /usr/$(get_libdir)/${PN}/wrappers/libGL.so.1.2
+ }
+ use X && multilib_foreach_abi make_libgl_symlinks
+}
+
+pkg_postinst() {
+ optfeature "retracediff.py: side by side retracing" "dev-python/pillow"
"dev-python/numpy"
+ optfeature "snapdiff.py: image comparison scripts" "dev-python/pillow"
+}
diff --git a/dev-debug/apitrace/files/apitrace-12.0-include-stdint.patch
b/dev-debug/apitrace/files/apitrace-12.0-include-stdint.patch
new file mode 100644
index 000000000000..0a663e712d1b
--- /dev/null
+++ b/dev-debug/apitrace/files/apitrace-12.0-include-stdint.patch
@@ -0,0 +1,25 @@
+https://github.com/apitrace/apitrace/pull/941.patch
+diff --git a/frametrim/ft_dependecyobject.hpp
b/frametrim/ft_dependecyobject.hpp
+index 2cd0b76879..0f17b601a3 100644
+--- a/frametrim/ft_dependecyobject.hpp
++++ b/frametrim/ft_dependecyobject.hpp
+@@ -28,6 +28,7 @@
+ #pragma once
+
+ #include "ft_tracecall.hpp"
++#include <stdint.h>
+
+ namespace frametrim {
+
+diff --git a/retrace/metric_writer.cpp b/retrace/metric_writer.cpp
+index e923ed1d3b..4e4ce74833 100644
+--- a/retrace/metric_writer.cpp
++++ b/retrace/metric_writer.cpp
+@@ -24,6 +24,7 @@
+ **************************************************************************/
+
+ #include <iostream>
++#include <stdint.h>
+
+ #include "metric_writer.hpp"
+
diff --git a/dev-debug/apitrace/files/apitrace-12.0-no_qtnetwork.patch
b/dev-debug/apitrace/files/apitrace-12.0-no_qtnetwork.patch
new file mode 100644
index 000000000000..39a07eaf182c
--- /dev/null
+++ b/dev-debug/apitrace/files/apitrace-12.0-no_qtnetwork.patch
@@ -0,0 +1,25 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 34123b3..9d4aefb 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -182,7 +182,7 @@ if (ENABLE_GUI)
+ cmake_policy (SET CMP0020 NEW)
+ endif()
+ if (ENABLE_QT6)
+- find_package (Qt6 COMPONENTS Widgets Network ${REQUIRE_GUI})
++ find_package (Qt6 COMPONENTS Widgets ${REQUIRE_GUI})
+ else ()
+ find_package (Qt5 5.15 COMPONENTS Widgets Network ${REQUIRE_GUI})
+ endif ()
+diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt
+index 99ae918..afb740c 100644
+--- a/gui/CMakeLists.txt
++++ b/gui/CMakeLists.txt
+@@ -99,7 +99,6 @@ add_executable (qapitrace ${qapitrace_SRCS}
${qapitrace_UIS_H})
+
+ target_link_libraries (qapitrace
+ Qt::Widgets
+- Qt::Network
+ qubjson
+ image
+ common
diff --git a/dev-debug/apitrace/files/apitrace-12.0-tests.patch
b/dev-debug/apitrace/files/apitrace-12.0-tests.patch
new file mode 100644
index 000000000000..8d4a18533635
--- /dev/null
+++ b/dev-debug/apitrace/files/apitrace-12.0-tests.patch
@@ -0,0 +1,21 @@
+diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt
+index 34eb7f7..7ca30a1 100644
+--- a/thirdparty/CMakeLists.txt
++++ b/thirdparty/CMakeLists.txt
+@@ -59,10 +59,12 @@ if (CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
+ include_with_scope (libbacktrace.cmake)
+ endif ()
+
+-# We use non-standard C++ flags, so we can't just use GTest's CMakeLists.txt
+-if (NOT GTEST_FOUND)
+- message (STATUS "Using bundled GTest")
+- include_with_scope (gtest.cmake)
++if (BUILD_TESTING)
++ # We use non-standard C++ flags, so we can't just use GTest's CMakeLists.txt
++ if (NOT GTEST_FOUND)
++ message (STATUS "Using bundled GTest")
++ include_with_scope (gtest.cmake)
++ endif ()
+ endif ()
+
+ if (MSVC)
diff --git a/dev-debug/apitrace/files/apitrace-12.0-unbundle.patch
b/dev-debug/apitrace/files/apitrace-12.0-unbundle.patch
new file mode 100644
index 000000000000..03467714e2c8
--- /dev/null
+++ b/dev-debug/apitrace/files/apitrace-12.0-unbundle.patch
@@ -0,0 +1,30 @@
+diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt
+index 34eb7f7..5fbd073 100644
+--- a/thirdparty/CMakeLists.txt
++++ b/thirdparty/CMakeLists.txt
+@@ -16,25 +16,6 @@ function (include_with_scope)
+ include (${ARGV})
+ endfunction ()
+
+-set (SUBMODULES_MISSING FALSE)
+-foreach (path IN ITEMS
+- brotli/LICENSE
+- gtest/LICENSE
+- libbacktrace/LICENSE
+- libpng/LICENSE
+- snappy/COPYING
+- zlib/README
+- directxmath/LICENSE
+-)
+- if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${path}")
+- message (SEND_ERROR "error: ${CMAKE_CURRENT_SOURCE_DIR}/${path} does
not exist")
+- set (SUBMODULES_MISSING TRUE)
+- endif ()
+-endforeach ()
+-if (SUBMODULES_MISSING)
+- message (FATAL_ERROR "Update Git submodules by running\ngit submodule
update --init --depth 1 --recursive")
+-endif ()
+-
+ if (ENABLE_STATIC_SNAPPY OR NOT Snappy_FOUND)
+ message (STATUS "Using bundled Snappy")
+ include_with_scope (snappy.cmake)