Gentoo Archives: gentoo-commits

From: Matthew Smith <matthew@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/renderdoc/
Date: Sun, 27 Mar 2022 09:25:06
Message-Id: 1648373067.2f692745b9d249bb21f04fc5aacf1045930b34e4.matthew@gentoo
1 commit: 2f692745b9d249bb21f04fc5aacf1045930b34e4
2 Author: Matthew Smith <matthew <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 27 08:53:49 2022 +0000
4 Commit: Matthew Smith <matthew <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 27 09:24:27 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f692745
7
8 media-gfx/renderdoc: add missing include on musl
9
10 Also add missing subslot operator on miniz as a subslot was added.
11
12 Closes: https://bugs.gentoo.org/836235
13 Signed-off-by: Matthew Smith <matthew <AT> gentoo.org>
14
15 media-gfx/renderdoc/renderdoc-1.18-r2.ebuild | 187 +++++++++++++++++++++++++++
16 1 file changed, 187 insertions(+)
17
18 diff --git a/media-gfx/renderdoc/renderdoc-1.18-r2.ebuild b/media-gfx/renderdoc/renderdoc-1.18-r2.ebuild
19 new file mode 100644
20 index 000000000000..dde163f217a9
21 --- /dev/null
22 +++ b/media-gfx/renderdoc/renderdoc-1.18-r2.ebuild
23 @@ -0,0 +1,187 @@
24 +# Copyright 1999-2022 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=8
28 +
29 +# The swig fork is required for compatibility with both provided and
30 +# 3rd-party Python scripts. Required patch was sent to upstream in
31 +# 2014: https://github.com/swig/swig/pull/251
32 +MY_SWIG_VER=7
33 +MY_SWIG=swig-${PN}-${MY_SWIG_VER}
34 +
35 +AUTOTOOLS_AUTO_DEPEND="no"
36 +DOCS_BUILDER="sphinx"
37 +DOCS_DIR="docs"
38 +PYTHON_COMPAT=( python3_{9,10} )
39 +inherit autotools cmake optfeature python-single-r1 docs xdg
40 +
41 +DESCRIPTION="A stand-alone graphics debugging tool"
42 +HOMEPAGE="https://renderdoc.org https://github.com/baldurk/renderdoc"
43 +SRC_URI="
44 + https://github.com/baldurk/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
45 + qt5? ( https://github.com/baldurk/swig/archive/${PN}-modified-${MY_SWIG_VER}.tar.gz -> ${MY_SWIG}.tar.gz )
46 +"
47 +
48 +# renderdoc: MIT
49 +# + cmdline: BSD (not compatible with upstream lib)
50 +# + farm fresh icons: CC-BY-3.0
51 +# + half: MIT (not compatible with system dev-libs/half)
52 +# + include-bin ZLIB (upstream doesn't exist anymore, maintained in tree)
53 +# + md5: public-domain
54 +# + plthook: BSD-2
55 +# + pugixml: MIT
56 +# + radeon gpu analyzer: MIT
57 +# + source code pro: OFL-1.1
58 +# + stb: public-domain
59 +# + tinyfiledialogs: ZLIB
60 +# + docs? ( sphinx.paramlinks: MIT )
61 +# swig: GPL-3+ BSD BSD-2
62 +LICENSE="BSD BSD-2 CC-BY-3.0 GPL-3+ MIT OFL-1.1 public-domain ZLIB"
63 +SLOT="0"
64 +KEYWORDS="~amd64"
65 +IUSE="pyside2 qt5"
66 +REQUIRED_USE="doc? ( qt5 ) pyside2? ( qt5 ) qt5? ( ${PYTHON_REQUIRED_USE} )"
67 +
68 +RDEPEND="
69 + app-arch/lz4:=
70 + app-arch/zstd:=
71 + dev-libs/miniz:=
72 + dev-util/glslang
73 + x11-libs/libX11
74 + x11-libs/libxcb:=
75 + x11-libs/xcb-util-keysyms
76 + virtual/opengl
77 + pyside2? (
78 + $(python_gen_cond_dep '
79 + dev-python/pyside2[${PYTHON_USEDEP}]
80 + ')
81 + )
82 + qt5? (
83 + ${PYTHON_DEPS}
84 + dev-qt/qtcore:5
85 + dev-qt/qtgui:5
86 + dev-qt/qtnetwork:5[ssl]
87 + dev-qt/qtsvg:5
88 + dev-qt/qtwidgets:5
89 + dev-qt/qtx11extras:5
90 + )
91 +"
92 +DEPEND="${RDEPEND}"
93 +# qtcore provides qmake, which is required to build the qrenderdoc gui.
94 +BDEPEND="
95 + x11-base/xorg-proto
96 + virtual/pkgconfig
97 + qt5? (
98 + ${AUTOTOOLS_DEPEND}
99 + ${PYTHON_DEPS}
100 + dev-libs/libpcre
101 + dev-qt/qtcore:5
102 + sys-devel/bison
103 + )
104 +"
105 +
106 +PATCHES=(
107 + # The analytics seem very reasonable, and even without this patch
108 + # they are NOT sent before the user accepts. But default the
109 + # selection to off, just in case.
110 + "${FILESDIR}"/${PN}-1.18-analytics-off.patch
111 +
112 + # Only search for PySide2 if pyside2 USE flag is set.
113 + # Bug #833627
114 + "${FILESDIR}"/${PN}-1.18-conditional-pyside.patch
115 +
116 + # Pass CXXFLAGS and LDFLAGS through to qmake when qrenderdoc is
117 + # built.
118 + "${FILESDIR}"/${PN}-1.18-system-flags.patch
119 +
120 + # Needed to prevent sandbox violations during build.
121 + "${FILESDIR}"/${PN}-1.18-env-home.patch
122 +
123 + "${FILESDIR}"/${PN}-1.18-system-glslang.patch
124 + "${FILESDIR}"/${PN}-1.18-system-compress.patch
125 +
126 + # Check physical device API version and supported extensions. Fixes
127 + # segfault on some GPU/driver combinations. Will be in release 1.19
128 + "${FILESDIR}"/${PN}-1.18-check-api-ver.patch
129 +)
130 +
131 +DOCS=( util/LINUX_DIST_README )
132 +
133 +pkg_setup() {
134 + use qt5 && python-single-r1_pkg_setup
135 +}
136 +
137 +src_unpack() {
138 + # Do not unpack the swig sources here. CMake will do that if
139 + # required.
140 + unpack ${P}.tar.gz
141 +}
142 +
143 +src_prepare() {
144 + cmake_src_prepare
145 +
146 + # Remove the calls to install the documentation files. Instead,
147 + # install them with einstalldocs.
148 + sed -i '/share\/doc\/renderdoc/d' \
149 + "${S}"/CMakeLists.txt "${S}"/qrenderdoc/CMakeLists.txt \
150 + || die 'sed remove doc install failed'
151 +
152 + # Assumes that the build directory is "${S}"/build, which it is not.
153 + sed -i "s|../build/lib|${BUILD_DIR}/lib|" \
154 + "${S}"/docs/conf.py \
155 + || die 'sed patch doc sys.path failed'
156 +
157 + # Bug #836235
158 + sed -i '/#include <stdarg/i #include <time.h>' \
159 + "${S}"/renderdoc/os/os_specific.h \
160 + || die 'sed include time.h failed'
161 +}
162 +
163 +src_configure() {
164 + local mycmakeargs=(
165 + # Build system does not know that this is a tagged release, as
166 + # we just have the tarball and not the git repository.
167 + -DBUILD_VERSION_STABLE=ON
168 +
169 + -DENABLE_EGL=ON
170 + -DENABLE_GL=ON
171 + -DENABLE_GLES=ON
172 + -DENABLE_PYRENDERDOC=$(usex qt5)
173 + -DENABLE_QRENDERDOC=$(usex qt5)
174 + -DENABLE_VULKAN=ON
175 +
176 + # Upstream says that this option is unsupported and should not
177 + # be used yet.
178 + -DENABLE_WAYLAND=OFF
179 +
180 + -DENABLE_XCB=ON
181 + -DENABLE_XLIB=ON
182 +
183 + # Path to glslang*.cmake.
184 + -DGLSLANG_TARGET_DIR="${ESYSROOT}"/usr/$(get_libdir)/cmake
185 +
186 + # renderdoc_capture.json is installed here
187 + -DVULKAN_LAYER_FOLDER="${EPREFIX}"/etc/vulkan/implicit_layer.d
188 + )
189 +
190 + use qt5 && mycmakeargs+=(
191 + -DPython3_EXECUTABLE="${PYTHON}"
192 + -DRENDERDOC_SWIG_PACKAGE="${DISTDIR}"/${MY_SWIG}.tar.gz
193 + -DQRENDERDOC_ENABLE_PYSIDE2=$(usex pyside2)
194 + )
195 +
196 + use pyside2 && mycmakeargs+=( -DPYTHON_CONFIG_SUFFIX=-${EPYTHON} )
197 +
198 + cmake_src_configure
199 +}
200 +
201 +src_compile() {
202 + cmake_src_compile
203 + docs_compile
204 +}
205 +
206 +pkg_postinst() {
207 + xdg_pkg_postinst
208 + optfeature "android remote contexts" dev-util/android-tools
209 + optfeature "vulkan contexts" media-libs/vulkan-loader
210 +}