1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 CMAKE_REMOVE_MODULES_LIST=( FindFreetype )
7 PYTHON_COMPAT=( python3_{6,7} )
9 inherit cmake-utils python-single-r1 xdg-utils
11 if [[ ${PV} == *9999 ]]; then
13 EGIT_REPO_URI="https://github.com/obsproject/obs-studio.git"
16 SRC_URI="https://github.com/obsproject/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
17 KEYWORDS="~amd64 ~ppc64 ~x86"
20 DESCRIPTION="Software for Recording and Streaming Live Video Content"
21 HOMEPAGE="https://obsproject.com"
25 IUSE="+alsa fdk imagemagick jack luajit nvenc pulseaudio python speex +ssl truetype v4l vlc"
26 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
29 luajit? ( dev-lang/swig )
30 python? ( dev-lang/swig )
33 >=dev-libs/jansson-2.5
35 dev-qt/qtdeclarative:5
39 dev-qt/qtquickcontrols:5
46 media-video/ffmpeg:=[x264]
52 x11-libs/libXcomposite
57 alsa? ( media-libs/alsa-lib )
58 fdk? ( media-libs/fdk-aac:= )
59 imagemagick? ( media-gfx/imagemagick:= )
60 jack? ( virtual/jack )
61 luajit? ( dev-lang/luajit:2 )
64 <media-video/ffmpeg-4[nvenc]
65 >=media-video/ffmpeg-4[video_cards_nvidia]
68 pulseaudio? ( media-sound/pulseaudio )
69 python? ( ${PYTHON_DEPS} )
70 speex? ( media-libs/speexdsp )
71 ssl? ( net-libs/mbedtls:= )
76 v4l? ( media-libs/libv4l )
77 vlc? ( media-video/vlc:= )
82 use python && python-single-r1_pkg_setup
86 local libdir=$(get_libdir)
88 -DDISABLE_ALSA=$(usex !alsa)
89 -DDISABLE_FREETYPE=$(usex !truetype)
90 -DDISABLE_JACK=$(usex !jack)
91 -DDISABLE_LIBFDK=$(usex !fdk)
92 -DDISABLE_PULSEAUDIO=$(usex !pulseaudio)
93 -DDISABLE_SPEEXDSP=$(usex !speex)
94 -DDISABLE_V4L2=$(usex !v4l)
95 -DDISABLE_VLC=$(usex !vlc)
96 -DLIBOBS_PREFER_IMAGEMAGICK=$(usex imagemagick)
97 -DOBS_MULTIARCH_SUFFIX=${libdir#lib}
99 -DWITH_RTMPS=$(usex ssl)
102 if [ "${PV}" != "9999" ]; then
104 -DOBS_VERSION_OVERRIDE=${PV}
108 if use luajit || use python; then
110 -DDISABLE_LUA=$(usex !luajit)
111 -DDISABLE_PYTHON=$(usex !python)
112 -DENABLE_SCRIPTING=yes
115 mycmakeargs+=( -DENABLE_SCRIPTING=no )
118 cmake-utils_src_configure
122 cmake-utils_src_install
123 #external plugins may need some things not installed by default, install them here
124 insinto /usr/include/obs/UI/obs-frontend-api
125 doins UI/obs-frontend-api/obs-frontend-api.h
129 xdg_icon_cache_update
131 if ! use alsa && ! use pulseaudio; then
133 elog "For the audio capture features to be available,"
134 elog "either the 'alsa' or the 'pulseaudio' USE-flag needs to"
139 if ! has_version "sys-apps/dbus"; then
141 elog "The 'sys-apps/dbus' package is not installed, but"
142 elog "could be used for disabling hibernating, screensaving,"
143 elog "and sleeping. Where it is not installed,"
144 elog "'xdg-screensaver reset' is used instead"
145 elog "(if 'x11-misc/xdg-utils' is installed)."
151 xdg_icon_cache_update