portage-overlay

personal portage ebuild repository
git clone anongit@rnpnr.xyz:portage-overlay.git
Log | Files | Refs | Feed | README

renderdoc-1.36.ebuild (5075B)


      1 # Copyright 1999-2024 Gentoo Authors
      2 # Distributed under the terms of the GNU General Public License v2
      3 
      4 EAPI=8
      5 
      6 # The swig fork is required for compatibility with both provided and
      7 # 3rd-party Python scripts.  Required patch was sent to upstream in
      8 # 2014: https://github.com/swig/swig/pull/251
      9 MY_SWIG_VER=7
     10 MY_SWIG=swig-${PN}-${MY_SWIG_VER}
     11 
     12 AUTOTOOLS_AUTO_DEPEND="no"
     13 DOCS_BUILDER="sphinx"
     14 DOCS_DIR="docs"
     15 PYTHON_COMPAT=( python3_{9..12} )
     16 inherit autotools cmake flag-o-matic optfeature python-single-r1 docs qmake-utils verify-sig xdg
     17 
     18 DESCRIPTION="A stand-alone graphics debugging tool"
     19 HOMEPAGE="https://renderdoc.org https://github.com/baldurk/renderdoc"
     20 SRC_URI="
     21 	https://github.com/baldurk/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
     22 	qt5? ( https://github.com/baldurk/swig/archive/${PN}-modified-${MY_SWIG_VER}.tar.gz -> ${MY_SWIG}.tar.gz )
     23 	verify-sig? ( https://github.com/baldurk/renderdoc/releases/download/v${PV}/v${PV}.tar.gz.asc -> ${P}.tar.gz.asc )
     24 "
     25 
     26 # renderdoc: MIT
     27 #   + cmdline: BSD (not compatible with upstream lib)
     28 #   + farm fresh icons: CC-BY-3.0
     29 #   + half: MIT (not compatible with system dev-libs/half)
     30 #   + include-bin ZLIB (upstream doesn't exist anymore, maintained in tree)
     31 #   + md5: public-domain
     32 #   + plthook: BSD-2
     33 #   + pugixml: MIT
     34 #   + radeon gpu analyzer: MIT
     35 #   + source code pro: OFL-1.1
     36 #   + stb: public-domain
     37 #   + tinyfiledialogs: ZLIB
     38 #   + glslang: BSD
     39 #   + docs? ( sphinx.paramlinks: MIT )
     40 # swig: GPL-3+ BSD BSD-2
     41 LICENSE="BSD BSD-2 CC-BY-3.0 GPL-3+ MIT OFL-1.1 public-domain ZLIB"
     42 SLOT="0"
     43 KEYWORDS="amd64 arm64"
     44 IUSE="qt5"
     45 REQUIRED_USE="doc? ( qt5 ) qt5? ( ${PYTHON_REQUIRED_USE} )"
     46 
     47 RDEPEND="
     48 	app-arch/lz4:=
     49 	app-arch/zstd:=
     50 	dev-libs/miniz:=
     51 	x11-libs/libX11
     52 	x11-libs/libxcb:=
     53 	x11-libs/xcb-util-keysyms
     54 	virtual/opengl
     55 	qt5? (
     56 		${PYTHON_DEPS}
     57 		dev-qt/qtcore:5
     58 		dev-qt/qtgui:5
     59 		dev-qt/qtnetwork:5[ssl]
     60 		dev-qt/qtsvg:5
     61 		dev-qt/qtwidgets:5
     62 		dev-qt/qtx11extras:5
     63 	)
     64 "
     65 DEPEND="${RDEPEND}"
     66 # qtcore provides qmake, which is required to build the qrenderdoc gui.
     67 BDEPEND="
     68 	x11-base/xorg-proto
     69 	virtual/pkgconfig
     70 	qt5? (
     71 		${AUTOTOOLS_DEPEND}
     72 		${PYTHON_DEPS}
     73 		dev-libs/libpcre
     74 		dev-qt/qtcore:5
     75 		app-alternatives/yacc
     76 	)
     77 	verify-sig? ( sec-keys/openpgp-keys-baldurkarlsson )
     78 "
     79 
     80 PATCHES=(
     81 	# The analytics seem very reasonable, and even without this patch
     82 	# they are NOT sent before the user accepts.  But default the
     83 	# selection to off, just in case.
     84 	"${FILESDIR}"/${PN}-1.18-analytics-off.patch
     85 
     86 	# Only search for PySide2 if pyside2 USE flag is set.
     87 	# Bug #833627
     88 	"${FILESDIR}"/${PN}-1.18-conditional-pyside.patch
     89 
     90 	# Pass CXXFLAGS and LDFLAGS through to qmake when qrenderdoc is
     91 	# built.
     92 	"${FILESDIR}"/${PN}-1.18-system-flags.patch
     93 
     94 	# Needed to prevent sandbox violations during build.
     95 	"${FILESDIR}"/${PN}-1.27-env-home.patch
     96 
     97 	"${FILESDIR}"/${PN}-1.30-r1-system-compress.patch
     98 
     99 	# Bug #925578
    100 	"${FILESDIR}"/${PN}-1.31-lld.patch
    101 )
    102 
    103 DOCS=( util/LINUX_DIST_README )
    104 
    105 VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/baldurkarlsson.gpg
    106 
    107 pkg_setup() {
    108 	use qt5 && python-single-r1_pkg_setup
    109 }
    110 
    111 src_unpack() {
    112 	if use verify-sig; then
    113 	   verify-sig_verify_detached "${DISTDIR}"/${P}.tar.gz{,.asc}
    114 	fi
    115 
    116 	# Do not unpack the swig sources here.  CMake will do that if
    117 	# required.
    118 	unpack ${P}.tar.gz
    119 }
    120 
    121 src_prepare() {
    122 	cmake_src_prepare
    123 
    124 	# Remove the calls to install the documentation files.  Instead,
    125 	# install them with einstalldocs.
    126 	sed -i '/share\/doc\/renderdoc/d' \
    127 		"${S}"/CMakeLists.txt "${S}"/qrenderdoc/CMakeLists.txt \
    128 		|| die 'sed remove doc install failed'
    129 
    130 	# Assumes that the build directory is "${S}"/build, which it is not.
    131 	sed -i "s|../build/lib|${BUILD_DIR}/lib|" \
    132 		"${S}"/docs/conf.py \
    133 		|| die 'sed patch doc sys.path failed'
    134 
    135 	# Bug #836235
    136 	sed -i '/#include <stdarg/i #include <time.h>' \
    137 		"${S}"/renderdoc/os/os_specific.h \
    138 		|| die 'sed include time.h failed'
    139 }
    140 
    141 src_configure() {
    142 	local mycmakeargs=(
    143 		# Build system does not know that this is a tagged release, as
    144 		# we just have the tarball and not the git repository.
    145 		-DBUILD_VERSION_STABLE=ON
    146 
    147 		-DENABLE_EGL=ON
    148 		-DENABLE_GL=ON
    149 		-DENABLE_GLES=ON
    150 		-DENABLE_PYRENDERDOC=$(usex qt5)
    151 		-DENABLE_QRENDERDOC=$(usex qt5)
    152 		-DENABLE_VULKAN=ON
    153 
    154 		# Upstream says that this option is unsupported and should not
    155 		# be used yet.
    156 		-DENABLE_UNSUPPORTED_EXPERIMENTAL_POSSIBLY_BROKEN_WAYLAND=OFF
    157 
    158 		-DENABLE_XCB=ON
    159 		-DENABLE_XLIB=ON
    160 
    161 		# renderdoc_capture.json is installed here
    162 		-DVULKAN_LAYER_FOLDER="${EPREFIX}"/etc/vulkan/implicit_layer.d
    163 	)
    164 
    165 	use qt5 && mycmakeargs+=(
    166 		-DPython3_EXECUTABLE="${PYTHON}"
    167 		-DRENDERDOC_SWIG_PACKAGE="${DISTDIR}"/${MY_SWIG}.tar.gz
    168 
    169 		# Needed after qtchooser removal, bug #836474.
    170 		-DQMAKE_QT5_COMMAND="$(qt5_get_bindir)"/qmake
    171 
    172 		# Bug #926549
    173 		-DQRENDERDOC_ENABLE_PYSIDE2=OFF
    174 	)
    175 
    176 	# Lots of type mismatch issues.
    177 	filter-lto
    178 
    179 	cmake_src_configure
    180 }
    181 
    182 src_compile() {
    183 	cmake_src_compile
    184 	docs_compile
    185 }
    186 
    187 pkg_postinst() {
    188 	xdg_pkg_postinst
    189 	optfeature "android remote contexts" dev-util/android-tools
    190 	optfeature "vulkan contexts" media-libs/vulkan-loader
    191 }