summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Smith <matthew@gentoo.org>2022-02-20 09:29:18 +0000
committerMatthew Smith <matthew@gentoo.org>2022-02-20 09:33:15 +0000
commit9a639cbe2577e5981eba961e802f02a237745baa (patch)
treec88e9cbf8be92657e3a7f346c518e7e0c556c47a /media-gfx/renderdoc
parentapp-emacs/flycheck-inline: initial import at 0_pre20200808 (diff)
downloadgentoo-9a639cbe2577e5981eba961e802f02a237745baa.tar.gz
gentoo-9a639cbe2577e5981eba961e802f02a237745baa.tar.bz2
gentoo-9a639cbe2577e5981eba961e802f02a237745baa.zip
media-gfx/renderdoc: Conditionally set PYTHON_CONFIG_SUFFIX
The Shiboken2 CMake config needs PYTHON_CONFIG_SUFFIX setting so that it doesn't always default to using its most recent PYTHON_TARGET. Patch the Renderdoc CMakeLists so that it only tries to find the Shiboken2 library if required. The installed files don't change, this just fixes a QA warning. Closes: https://bugs.gentoo.org/833627 Signed-off-by: Matthew Smith <matthew@gentoo.org>
Diffstat (limited to 'media-gfx/renderdoc')
-rw-r--r--media-gfx/renderdoc/files/renderdoc-1.18-conditional-pyside.patch54
-rw-r--r--media-gfx/renderdoc/renderdoc-1.18.ebuild7
2 files changed, 60 insertions, 1 deletions
diff --git a/media-gfx/renderdoc/files/renderdoc-1.18-conditional-pyside.patch b/media-gfx/renderdoc/files/renderdoc-1.18-conditional-pyside.patch
new file mode 100644
index 000000000000..f09ff059528b
--- /dev/null
+++ b/media-gfx/renderdoc/files/renderdoc-1.18-conditional-pyside.patch
@@ -0,0 +1,54 @@
+From e6c0ee16967d3aa79f645a5a0aad0d50c20987f4 Mon Sep 17 00:00:00 2001
+From: Matthew Smith <matt@offtopica.uk>
+Date: Sun, 20 Feb 2022 09:19:03 +0000
+Subject: [PATCH] build: Only search for PySide2 if required
+
+---
+ qrenderdoc/CMakeLists.txt | 17 +++++++----------
+ 1 file changed, 7 insertions(+), 10 deletions(-)
+
+diff --git a/qrenderdoc/CMakeLists.txt b/qrenderdoc/CMakeLists.txt
+index 05ad8ba89..e4470715e 100644
+--- a/qrenderdoc/CMakeLists.txt
++++ b/qrenderdoc/CMakeLists.txt
+@@ -154,9 +154,6 @@ ExternalProject_Add(custom_swig
+ BUILD_COMMAND ${GENERATOR_MAKE} ${GENERATOR_MAKE_PARAMS} > /dev/null 2>&1
+ INSTALL_COMMAND ${GENERATOR_MAKE} install > /dev/null 2>&1)
+
+-find_package(Shiboken2 QUIET)
+-find_package(PySide2 QUIET)
+-
+ set(PYTHON_LINK "${PYTHON_LIBRARY}")
+
+ # ensure we link the whole python library so that modules have all the exports they need
+@@ -251,7 +248,13 @@ option(QRENDERDOC_ENABLE_PYSIDE2 "Enable PySide2 if found" ON)
+
+ if(NOT QRENDERDOC_ENABLE_PYSIDE2)
+ message(STATUS "PySide2 integration disabled")
+-elseif(PySide2_FOUND AND Shiboken2_FOUND AND TARGET Shiboken2::libshiboken AND TARGET PySide2::pyside2)
++ file(APPEND
++ ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
++ "DEFINES+=PYSIDE2_ENABLED=0\n")
++else()
++ find_package(Shiboken2 QUIET REQUIRED)
++ find_package(PySide2 QUIET REQUIRED)
++
+ message(STATUS "Building with PySide2 ${PySide2_VERSION} from ${PySide2_DIR}")
+
+ if(NOT PYTHONLIBS_VERSION_STRING MATCHES "${SHIBOKEN_PYTHON_VERSION_MAJOR}.${SHIBOKEN_PYTHON_VERSION_MINOR}")
+@@ -280,12 +283,6 @@ elseif(PySide2_FOUND AND Shiboken2_FOUND AND TARGET Shiboken2::libshiboken AND T
+ "DEFINES+=PYSIDE2_ENABLED=1\n"
+ "DEFINES+=PYSIDE2_SYS_PATH=${PYSIDE_PYTHONPATH}\n"
+ "LIBS+=-lshiboken2${SHIBOKEN_PYTHON_SHARED_LIBRARY_SUFFIX}\n")
+-else()
+- message(STATUS "PySide2 not found - Qt will not be accessible in python scripting. See https://github.com/baldurk/renderdoc/wiki/PySide2")
+-
+- file(APPEND
+- ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri
+- "DEFINES+=PYSIDE2_ENABLED=0\n")
+ endif()
+
+ # generate the SWIG interface files
+--
+2.35.1
+
diff --git a/media-gfx/renderdoc/renderdoc-1.18.ebuild b/media-gfx/renderdoc/renderdoc-1.18.ebuild
index fae8b079434c..38a71320c453 100644
--- a/media-gfx/renderdoc/renderdoc-1.18.ebuild
+++ b/media-gfx/renderdoc/renderdoc-1.18.ebuild
@@ -86,6 +86,10 @@ PATCHES=(
# selection to off, just in case.
"${FILESDIR}"/${PN}-1.18-analytics-off.patch
+ # Only search for PySide2 if pyside2 USE flag is set.
+ # Bug #833627
+ "${FILESDIR}"/${PN}-1.18-conditional-pyside.patch
+
# Pass CXXFLAGS and LDFLAGS through to qmake when qrenderdoc is
# built.
"${FILESDIR}"/${PN}-1.18-system-flags.patch
@@ -153,11 +157,12 @@ src_configure() {
use qt5 && mycmakeargs+=(
-DPython3_EXECUTABLE="${PYTHON}"
- -DPYTHON_CONFIG_SUFFIX=-${EPYTHON}
-DRENDERDOC_SWIG_PACKAGE="${DISTDIR}"/${MY_SWIG}.tar.gz
-DQRENDERDOC_ENABLE_PYSIDE2=$(usex pyside2)
)
+ use pyside2 && mycmakeargs+=( -DPYTHON_CONFIG_SUFFIX=-${EPYTHON} )
+
cmake_src_configure
}