Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/obs-studio/
Date: Thu, 01 Jul 2021 16:57:21
Message-Id: 1625158481.05cff7bd35eb8d49a14b16d36a27e67f90232093.ionen@gentoo
1 commit: 05cff7bd35eb8d49a14b16d36a27e67f90232093
2 Author: Gergely Nagy <ngg <AT> ngg <DOT> hu>
3 AuthorDate: Fri Nov 6 17:29:43 2020 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Thu Jul 1 16:54:41 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=05cff7bd
7
8 media-video/obs-studio: add 27.0.1 with browser source support
9
10 Closes: https://bugs.gentoo.org/717002
11 Closes: https://bugs.gentoo.org/795648
12 Signed-off-by: Gergely Nagy <ngg <AT> ngg.hu>
13 Closes: https://github.com/gentoo/gentoo/pull/18156
14 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
15
16 media-video/obs-studio/Manifest | 3 +
17 media-video/obs-studio/metadata.xml | 1 +
18 media-video/obs-studio/obs-studio-27.0.1.ebuild | 220 ++++++++++++++++++++++++
19 3 files changed, 224 insertions(+)
20
21 diff --git a/media-video/obs-studio/Manifest b/media-video/obs-studio/Manifest
22 index 2174c29f8d2..a79204b6be8 100644
23 --- a/media-video/obs-studio/Manifest
24 +++ b/media-video/obs-studio/Manifest
25 @@ -1 +1,4 @@
26 +DIST cef_binary_4280_linux64.tar.bz2 79740715 BLAKE2B c648a9a4205094450f9eae407e98cbc3da2b7cd81b3c19c4f52cfa3efcca01dce40528018996c65f026eb97520d78040165d1906b0d19236a86e76ec39c58c26 SHA512 060a5a8716a75b4b96dfb6ac28c132e22b93107915d680311c1b9d4fd12c7712a9e3497338eac6d2b9f4e74f2dc005a75d195c597bba049e4731fe3724f519ba
27 +DIST obs-browser-f1a61c5a2579e5673765c31a47c2053d4b502d4b.tar.gz 79259 BLAKE2B 28cfa46928de0b5e626b384673f7b92b3a48cb631066dda06288c51df78f06b913707a1295a5142d4521505b0678a6c639bfbb5b8a066d585fa12849578a382e SHA512 3ecab39bfb36774ac501de087ca70ecde12f408cfd54cdf12539a92e89d0cf531767a066ff77139389158c46beee423cf1848081ed187890b86241aa96f7b179
28 DIST obs-studio-26.1.2.tar.gz 16624899 BLAKE2B 655a6c71d3a0ae6ae1fc2d166a148002bb17d6eaec06d5633a10fdbfe7f42e073526ede83cd36ad21c440debe870b41b43724caa00633733f1e196d918304adc SHA512 cd95fbf587f7edfe415cae75299d65c1d771bb118649fb839ae43d77145d87725c23df3360aa7b8c35ab8b62e5ec7983a8b02f8b102caa78f768eb58b4263417
29 +DIST obs-studio-27.0.1.tar.gz 15787807 BLAKE2B c2ea571f06a81b2e87ce5d9fd010610ea6cc2753223e6373025f0389972d4638a5f3ff1802f9f0af2c631d71ebcf4603e064da804e8c89eb032b1ad5743d1bd4 SHA512 c15dda62c1f212f623914e61a90c6b1e035720fb84d64726c14f43d77ae7569777a23d04221db34347ce610e7c3407c29e726ae36412e98e34ea2ddb2072b7f3
30
31 diff --git a/media-video/obs-studio/metadata.xml b/media-video/obs-studio/metadata.xml
32 index 88ef04788a6..4d0c222ec60 100644
33 --- a/media-video/obs-studio/metadata.xml
34 +++ b/media-video/obs-studio/metadata.xml
35 @@ -16,6 +16,7 @@
36 internally.
37 </longdescription>
38 <use>
39 + <flag name="browser">Enable browser source support via (precompiled) CEF.</flag>
40 <flag name="decklink">Build the Decklink plugin.</flag>
41 <flag name="fdk">Build with LibFDK AAC support.</flag>
42 <flag name="imagemagick">Use ImageMagick for image loading instead of FFmpeg.</flag>
43
44 diff --git a/media-video/obs-studio/obs-studio-27.0.1.ebuild b/media-video/obs-studio/obs-studio-27.0.1.ebuild
45 new file mode 100644
46 index 00000000000..3ce88e1927c
47 --- /dev/null
48 +++ b/media-video/obs-studio/obs-studio-27.0.1.ebuild
49 @@ -0,0 +1,220 @@
50 +# Copyright 1999-2021 Gentoo Authors
51 +# Distributed under the terms of the GNU General Public License v2
52 +
53 +EAPI=7
54 +
55 +CMAKE_REMOVE_MODULES_LIST=( FindFreetype )
56 +LUA_COMPAT=( luajit )
57 +PYTHON_COMPAT=( python3_{7..9} )
58 +
59 +OBS_BROWSER_COMMIT="f1a61c5a2579e5673765c31a47c2053d4b502d4b"
60 +CEF_DIR="cef_binary_4280_linux64"
61 +
62 +inherit cmake lua-single python-single-r1 xdg-utils
63 +
64 +if [[ ${PV} == *9999 ]]; then
65 + inherit git-r3
66 + EGIT_REPO_URI="https://github.com/obsproject/obs-studio.git"
67 + EGIT_SUBMODULES=( "plugins/obs-browser" )
68 +else
69 + SRC_URI="https://github.com/obsproject/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
70 + SRC_URI+=" browser? ( https://github.com/obsproject/obs-browser/archive/${OBS_BROWSER_COMMIT}.tar.gz -> obs-browser-${OBS_BROWSER_COMMIT}.tar.gz )"
71 + KEYWORDS="~amd64 ~ppc64 ~x86"
72 +fi
73 +SRC_URI+=" browser? ( https://cdn-fastly.obsproject.com/downloads/${CEF_DIR}.tar.bz2 )"
74 +
75 +DESCRIPTION="Software for Recording and Streaming Live Video Content"
76 +HOMEPAGE="https://obsproject.com"
77 +
78 +LICENSE="GPL-2"
79 +SLOT="0"
80 +IUSE="+alsa browser decklink fdk imagemagick jack lua nvenc pipewire pulseaudio python speex +ssl truetype v4l vlc wayland"
81 +REQUIRED_USE="
82 + browser? ( || ( alsa pulseaudio ) )
83 + lua? ( ${LUA_REQUIRED_USE} )
84 + python? ( ${PYTHON_REQUIRED_USE} )
85 +"
86 +
87 +BDEPEND="
88 + lua? ( dev-lang/swig )
89 + python? ( dev-lang/swig )
90 +"
91 +DEPEND="
92 + >=dev-libs/jansson-2.5
93 + dev-qt/qtcore:5
94 + dev-qt/qtdeclarative:5
95 + dev-qt/qtgui:5[wayland?]
96 + dev-qt/qtmultimedia:5
97 + dev-qt/qtnetwork:5
98 + dev-qt/qtquickcontrols:5
99 + dev-qt/qtsql:5
100 + dev-qt/qtsvg:5
101 + dev-qt/qtwidgets:5
102 + dev-qt/qtx11extras:5
103 + dev-qt/qtxml:5
104 + media-libs/x264:=
105 + media-video/ffmpeg:=[x264]
106 + net-misc/curl
107 + sys-apps/dbus
108 + sys-libs/zlib
109 + virtual/udev
110 + x11-libs/libX11
111 + x11-libs/libXcomposite
112 + x11-libs/libXfixes
113 + x11-libs/libXinerama
114 + x11-libs/libXrandr
115 + x11-libs/libxcb
116 + alsa? ( media-libs/alsa-lib )
117 + browser? (
118 + app-accessibility/at-spi2-atk
119 + dev-libs/atk
120 + dev-libs/expat
121 + dev-libs/glib
122 + dev-libs/nspr
123 + dev-libs/nss
124 + media-libs/fontconfig
125 + x11-libs/libXcursor
126 + x11-libs/libXdamage
127 + x11-libs/libXext
128 + x11-libs/libXi
129 + x11-libs/libXrender
130 + x11-libs/libXScrnSaver
131 + x11-libs/libXtst
132 + )
133 + fdk? ( media-libs/fdk-aac:= )
134 + imagemagick? ( media-gfx/imagemagick:= )
135 + jack? ( virtual/jack )
136 + lua? ( ${LUA_DEPS} )
137 + nvenc? ( >=media-video/ffmpeg-4[video_cards_nvidia] )
138 + pipewire? ( media-video/pipewire )
139 + pulseaudio? ( media-sound/pulseaudio )
140 + python? ( ${PYTHON_DEPS} )
141 + speex? ( media-libs/speexdsp )
142 + ssl? ( net-libs/mbedtls:= )
143 + truetype? (
144 + media-libs/fontconfig
145 + media-libs/freetype
146 + )
147 + v4l? ( media-libs/libv4l )
148 + vlc? ( media-video/vlc:= )
149 + wayland? ( dev-libs/wayland )
150 +"
151 +RDEPEND="${DEPEND}"
152 +
153 +QA_PREBUILT="
154 + /usr/lib*/obs-plugins/chrome-sandbox
155 + /usr/lib*/obs-plugins/libcef.so
156 + /usr/lib*/obs-plugins/libEGL.so
157 + /usr/lib*/obs-plugins/libGLESv2.so
158 + /usr/lib*/obs-plugins/swiftshader/libEGL.so
159 + /usr/lib*/obs-plugins/swiftshader/libGLESv2.so
160 +"
161 +
162 +PATCHES=( "${FILESDIR}/${PN}-26.1.2-python-3.8.patch" ) # https://github.com/obsproject/obs-studio/pull/3335
163 +
164 +pkg_setup() {
165 + use lua && lua-single_pkg_setup
166 + use python && python-single-r1_pkg_setup
167 +}
168 +
169 +src_unpack() {
170 + default
171 + if [[ ${PV} != *9999 ]]; then
172 + if use browser; then
173 + rm -d "${P}/plugins/obs-browser" || die
174 + mv "obs-browser-${OBS_BROWSER_COMMIT}" "${P}/plugins/obs-browser" || die
175 + fi
176 + else
177 + git-r3_src_unpack
178 + fi
179 +}
180 +
181 +src_configure() {
182 + local libdir=$(get_libdir)
183 + local mycmakeargs=(
184 + -DBUILD_BROWSER=$(usex browser)
185 + -DBUILD_VST=no
186 + -DENABLE_WAYLAND=$(usex wayland)
187 + -DDISABLE_ALSA=$(usex !alsa)
188 + -DDISABLE_DECKLINK=$(usex !decklink)
189 + -DDISABLE_FREETYPE=$(usex !truetype)
190 + -DDISABLE_JACK=$(usex !jack)
191 + -DDISABLE_LIBFDK=$(usex !fdk)
192 + -DENABLE_PIPEWIRE=$(usex pipewire)
193 + -DDISABLE_PULSEAUDIO=$(usex !pulseaudio)
194 + -DDISABLE_SPEEXDSP=$(usex !speex)
195 + -DDISABLE_V4L2=$(usex !v4l)
196 + -DDISABLE_VLC=$(usex !vlc)
197 + -DLIBOBS_PREFER_IMAGEMAGICK=$(usex imagemagick)
198 + -DOBS_MULTIARCH_SUFFIX=${libdir#lib}
199 + -DUNIX_STRUCTURE=1
200 + -DWITH_RTMPS=$(usex ssl)
201 + )
202 +
203 + if [[ ${PV} != *9999 ]]; then
204 + mycmakeargs+=(
205 + -DOBS_VERSION_OVERRIDE=${PV}
206 + )
207 + fi
208 +
209 + if use browser; then
210 + mycmakeargs+=(
211 + -DCEF_ROOT_DIR="../${CEF_DIR}"
212 + )
213 + fi
214 +
215 + if use lua || use python; then
216 + mycmakeargs+=(
217 + -DDISABLE_LUA=$(usex !lua)
218 + -DDISABLE_PYTHON=$(usex !python)
219 + -DENABLE_SCRIPTING=yes
220 + )
221 + else
222 + mycmakeargs+=( -DENABLE_SCRIPTING=no )
223 + fi
224 +
225 + cmake_src_configure
226 +}
227 +
228 +src_install() {
229 + cmake_src_install
230 + #external plugins may need some things not installed by default, install them here
231 + insinto /usr/include/obs/UI/obs-frontend-api
232 + doins UI/obs-frontend-api/obs-frontend-api.h
233 +}
234 +
235 +pkg_postinst() {
236 + xdg_icon_cache_update
237 +
238 + if ! use alsa && ! use pulseaudio; then
239 + elog
240 + elog "For the audio capture features to be available,"
241 + elog "either the 'alsa' or the 'pulseaudio' USE-flag needs to"
242 + elog "be enabled."
243 + elog
244 + fi
245 +
246 + if ! has_version "sys-apps/dbus"; then
247 + elog
248 + elog "The 'sys-apps/dbus' package is not installed, but"
249 + elog "could be used for disabling hibernating, screensaving,"
250 + elog "and sleeping. Where it is not installed,"
251 + elog "'xdg-screensaver reset' is used instead"
252 + elog "(if 'x11-misc/xdg-utils' is installed)."
253 + elog
254 + fi
255 +}
256 +
257 +pkg_postinst() {
258 + if use python; then
259 + ewarn "This ebuild applies a patch that is not yet accepted upstream,"
260 + ewarn "and while it fixes Python support at least to some extent, it"
261 + ewarn "may cause other issues."
262 + ewarn ""
263 + ewarn "Please report any such issues to the Gentoo maintainer."
264 + fi
265 +}
266 +
267 +pkg_postrm() {
268 + xdg_icon_cache_update
269 +}