portage-overlay

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

renderdoc-1.44.ebuild (5315B)


      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..13} )
     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 	# Pass CXXFLAGS and LDFLAGS through to qmake when qrenderdoc is built.
     82 	"${FILESDIR}"/0003-build-qrenderdoc-Respect-CXX-and-LDFLAGS.patch
     83 
     84 	# Needed to prevent sandbox violations during build.
     85 	"${FILESDIR}"/0004-always-use-HOME-env-variable-for-home-directory.patch
     86 
     87 	# Only search for PySide2 if pyside2 USE flag is set.
     88 	# Bug #833627
     89 	"${FILESDIR}"/0005-build-Only-search-for-PySide2-if-required.patch
     90 
     91 	# Bug #925578
     92 	"${FILESDIR}"/0006-Remove-undefined-symbols-from-version-script.patch
     93 
     94 	# The analytics seem very reasonable, and even without this patch
     95 	# they are NOT sent before the user accepts.  But default the
     96 	# selection to off, just in case.
     97 	"${FILESDIR}"/0007-analytics-Default-selection-to-off.patch
     98 )
     99 
    100 DOCS=( util/LINUX_DIST_README )
    101 
    102 VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/baldurkarlsson.gpg
    103 
    104 pkg_setup() {
    105 	use qt5 && python-single-r1_pkg_setup
    106 }
    107 
    108 src_unpack() {
    109 	if use verify-sig; then
    110 	   verify-sig_verify_detached "${DISTDIR}"/${P}.tar.gz{,.asc}
    111 	fi
    112 
    113 	# Do not unpack the swig sources here.  CMake will do that if
    114 	# required.
    115 	unpack ${P}.tar.gz
    116 }
    117 
    118 src_prepare() {
    119 	if use elibc_musl ; then
    120 		eapply "${FILESDIR}"/0001-linux-fix-build-against-musl.patch
    121 		eapply "${FILESDIR}"/0002-Rework-injection-and-synchronisaion-on-linux.patch
    122 	fi
    123 
    124 	cmake_src_prepare
    125 
    126 	# Remove the calls to install the documentation files.  Instead,
    127 	# install them with einstalldocs.
    128 	sed -i '/share\/doc\/renderdoc/d' \
    129 		"${S}"/CMakeLists.txt "${S}"/qrenderdoc/CMakeLists.txt \
    130 		|| die 'sed remove doc install failed'
    131 
    132 	# Assumes that the build directory is "${S}"/build, which it is not.
    133 	sed -i "s|../build/lib|${BUILD_DIR}/lib|" \
    134 		"${S}"/docs/conf.py \
    135 		|| die 'sed patch doc sys.path failed'
    136 
    137 	# Bug #836235
    138 	sed -i '/#include <stdarg/i #include <time.h>' \
    139 		"${S}"/renderdoc/os/os_specific.h \
    140 		|| die 'sed include time.h failed'
    141 }
    142 
    143 src_configure() {
    144 	local mycmakeargs=(
    145 		# Build system does not know that this is a tagged release, as
    146 		# we just have the tarball and not the git repository.
    147 		-DBUILD_VERSION_STABLE=ON
    148 
    149 		-DENABLE_EGL=ON
    150 		-DENABLE_GL=ON
    151 		-DENABLE_GLES=ON
    152 		-DENABLE_PYRENDERDOC=$(usex qt5)
    153 		-DENABLE_QRENDERDOC=$(usex qt5)
    154 		-DENABLE_VULKAN=ON
    155 
    156 		# Upstream says that this option is unsupported and should not
    157 		# be used yet.
    158 		-DENABLE_UNSUPPORTED_EXPERIMENTAL_POSSIBLY_BROKEN_WAYLAND=OFF
    159 
    160 		-DENABLE_XCB=ON
    161 		-DENABLE_XLIB=ON
    162 
    163 		# renderdoc_capture.json is installed here
    164 		-DVULKAN_LAYER_FOLDER="${EPREFIX}"/etc/vulkan/implicit_layer.d
    165 	)
    166 
    167 	use qt5 && mycmakeargs+=(
    168 		-DPython3_EXECUTABLE="${PYTHON}"
    169 		-DRENDERDOC_SWIG_PACKAGE="${DISTDIR}"/${MY_SWIG}.tar.gz
    170 
    171 		# Needed after qtchooser removal, bug #836474.
    172 		-DQMAKE_QT5_COMMAND="$(qt5_get_bindir)"/qmake
    173 
    174 		# Bug #926549
    175 		-DQRENDERDOC_ENABLE_PYSIDE2=OFF
    176 	)
    177 
    178 	# Lots of type mismatch issues.
    179 	filter-lto
    180 
    181 	cmake_src_configure
    182 }
    183 
    184 src_compile() {
    185 	cmake_src_compile
    186 	docs_compile
    187 }
    188 
    189 pkg_postinst() {
    190 	xdg_pkg_postinst
    191 	optfeature "android remote contexts" dev-util/android-tools
    192 	optfeature "vulkan contexts" media-libs/vulkan-loader
    193 }