1 |
commit: 9a639cbe2577e5981eba961e802f02a237745baa |
2 |
Author: Matthew Smith <matthew <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Feb 20 09:29:18 2022 +0000 |
4 |
Commit: Matthew Smith <matthew <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Feb 20 09:33:15 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a639cbe |
7 |
|
8 |
media-gfx/renderdoc: Conditionally set PYTHON_CONFIG_SUFFIX |
9 |
|
10 |
The Shiboken2 CMake config needs PYTHON_CONFIG_SUFFIX setting so that it |
11 |
doesn't always default to using its most recent PYTHON_TARGET. |
12 |
|
13 |
Patch the Renderdoc CMakeLists so that it only tries to find the |
14 |
Shiboken2 library if required. The installed files don't change, this |
15 |
just fixes a QA warning. |
16 |
|
17 |
Closes: https://bugs.gentoo.org/833627 |
18 |
Signed-off-by: Matthew Smith <matthew <AT> gentoo.org> |
19 |
|
20 |
.../files/renderdoc-1.18-conditional-pyside.patch | 54 ++++++++++++++++++++++ |
21 |
media-gfx/renderdoc/renderdoc-1.18.ebuild | 7 ++- |
22 |
2 files changed, 60 insertions(+), 1 deletion(-) |
23 |
|
24 |
diff --git a/media-gfx/renderdoc/files/renderdoc-1.18-conditional-pyside.patch b/media-gfx/renderdoc/files/renderdoc-1.18-conditional-pyside.patch |
25 |
new file mode 100644 |
26 |
index 000000000000..f09ff059528b |
27 |
--- /dev/null |
28 |
+++ b/media-gfx/renderdoc/files/renderdoc-1.18-conditional-pyside.patch |
29 |
@@ -0,0 +1,54 @@ |
30 |
+From e6c0ee16967d3aa79f645a5a0aad0d50c20987f4 Mon Sep 17 00:00:00 2001 |
31 |
+From: Matthew Smith <matt@×××××××××.uk> |
32 |
+Date: Sun, 20 Feb 2022 09:19:03 +0000 |
33 |
+Subject: [PATCH] build: Only search for PySide2 if required |
34 |
+ |
35 |
+--- |
36 |
+ qrenderdoc/CMakeLists.txt | 17 +++++++---------- |
37 |
+ 1 file changed, 7 insertions(+), 10 deletions(-) |
38 |
+ |
39 |
+diff --git a/qrenderdoc/CMakeLists.txt b/qrenderdoc/CMakeLists.txt |
40 |
+index 05ad8ba89..e4470715e 100644 |
41 |
+--- a/qrenderdoc/CMakeLists.txt |
42 |
++++ b/qrenderdoc/CMakeLists.txt |
43 |
+@@ -154,9 +154,6 @@ ExternalProject_Add(custom_swig |
44 |
+ BUILD_COMMAND ${GENERATOR_MAKE} ${GENERATOR_MAKE_PARAMS} > /dev/null 2>&1 |
45 |
+ INSTALL_COMMAND ${GENERATOR_MAKE} install > /dev/null 2>&1) |
46 |
+ |
47 |
+-find_package(Shiboken2 QUIET) |
48 |
+-find_package(PySide2 QUIET) |
49 |
+- |
50 |
+ set(PYTHON_LINK "${PYTHON_LIBRARY}") |
51 |
+ |
52 |
+ # ensure we link the whole python library so that modules have all the exports they need |
53 |
+@@ -251,7 +248,13 @@ option(QRENDERDOC_ENABLE_PYSIDE2 "Enable PySide2 if found" ON) |
54 |
+ |
55 |
+ if(NOT QRENDERDOC_ENABLE_PYSIDE2) |
56 |
+ message(STATUS "PySide2 integration disabled") |
57 |
+-elseif(PySide2_FOUND AND Shiboken2_FOUND AND TARGET Shiboken2::libshiboken AND TARGET PySide2::pyside2) |
58 |
++ file(APPEND |
59 |
++ ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri |
60 |
++ "DEFINES+=PYSIDE2_ENABLED=0\n") |
61 |
++else() |
62 |
++ find_package(Shiboken2 QUIET REQUIRED) |
63 |
++ find_package(PySide2 QUIET REQUIRED) |
64 |
++ |
65 |
+ message(STATUS "Building with PySide2 ${PySide2_VERSION} from ${PySide2_DIR}") |
66 |
+ |
67 |
+ if(NOT PYTHONLIBS_VERSION_STRING MATCHES "${SHIBOKEN_PYTHON_VERSION_MAJOR}.${SHIBOKEN_PYTHON_VERSION_MINOR}") |
68 |
+@@ -280,12 +283,6 @@ elseif(PySide2_FOUND AND Shiboken2_FOUND AND TARGET Shiboken2::libshiboken AND T |
69 |
+ "DEFINES+=PYSIDE2_ENABLED=1\n" |
70 |
+ "DEFINES+=PYSIDE2_SYS_PATH=${PYSIDE_PYTHONPATH}\n" |
71 |
+ "LIBS+=-lshiboken2${SHIBOKEN_PYTHON_SHARED_LIBRARY_SUFFIX}\n") |
72 |
+-else() |
73 |
+- message(STATUS "PySide2 not found - Qt will not be accessible in python scripting. See https://github.com/baldurk/renderdoc/wiki/PySide2") |
74 |
+- |
75 |
+- file(APPEND |
76 |
+- ${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_cmake.pri |
77 |
+- "DEFINES+=PYSIDE2_ENABLED=0\n") |
78 |
+ endif() |
79 |
+ |
80 |
+ # generate the SWIG interface files |
81 |
+-- |
82 |
+2.35.1 |
83 |
+ |
84 |
|
85 |
diff --git a/media-gfx/renderdoc/renderdoc-1.18.ebuild b/media-gfx/renderdoc/renderdoc-1.18.ebuild |
86 |
index fae8b079434c..38a71320c453 100644 |
87 |
--- a/media-gfx/renderdoc/renderdoc-1.18.ebuild |
88 |
+++ b/media-gfx/renderdoc/renderdoc-1.18.ebuild |
89 |
@@ -86,6 +86,10 @@ PATCHES=( |
90 |
# selection to off, just in case. |
91 |
"${FILESDIR}"/${PN}-1.18-analytics-off.patch |
92 |
|
93 |
+ # Only search for PySide2 if pyside2 USE flag is set. |
94 |
+ # Bug #833627 |
95 |
+ "${FILESDIR}"/${PN}-1.18-conditional-pyside.patch |
96 |
+ |
97 |
# Pass CXXFLAGS and LDFLAGS through to qmake when qrenderdoc is |
98 |
# built. |
99 |
"${FILESDIR}"/${PN}-1.18-system-flags.patch |
100 |
@@ -153,11 +157,12 @@ src_configure() { |
101 |
|
102 |
use qt5 && mycmakeargs+=( |
103 |
-DPython3_EXECUTABLE="${PYTHON}" |
104 |
- -DPYTHON_CONFIG_SUFFIX=-${EPYTHON} |
105 |
-DRENDERDOC_SWIG_PACKAGE="${DISTDIR}"/${MY_SWIG}.tar.gz |
106 |
-DQRENDERDOC_ENABLE_PYSIDE2=$(usex pyside2) |
107 |
) |
108 |
|
109 |
+ use pyside2 && mycmakeargs+=( -DPYTHON_CONFIG_SUFFIX=-${EPYTHON} ) |
110 |
+ |
111 |
cmake_src_configure |
112 |
} |