1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{3_4,3_5,3_6,3_7} )
8 inherit cmake-utils python-single-r1 xdg-utils
10 if [[ ${PV} == *9999 ]]; then
12 EGIT_REPO_URI="https://github.com/obsproject/obs-studio.git"
15 SRC_URI="https://github.com/obsproject/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
16 KEYWORDS="~amd64 ~x86"
19 DESCRIPTION="Software for Recording and Streaming Live Video Content"
20 HOMEPAGE="https://obsproject.com"
24 IUSE="+alsa fdk imagemagick jack luajit nvenc pulseaudio python speex truetype v4l"
25 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
28 luajit? ( dev-lang/swig )
29 python? ( dev-lang/swig )
32 >=dev-libs/jansson-2.5
34 dev-qt/qtdeclarative:5
38 dev-qt/qtquickcontrols:5
43 media-video/ffmpeg:=[x264]
45 x11-libs/libXcomposite
48 alsa? ( media-libs/alsa-lib )
49 fdk? ( media-libs/fdk-aac:= )
50 imagemagick? ( media-gfx/imagemagick:= )
51 jack? ( virtual/jack )
52 luajit? ( dev-lang/luajit:2 )
55 <media-video/ffmpeg-4[nvenc]
56 >=media-video/ffmpeg-4[video_cards_nvidia]
59 pulseaudio? ( media-sound/pulseaudio )
60 python? ( ${PYTHON_DEPS} )
61 speex? ( media-libs/speexdsp )
66 v4l? ( media-libs/libv4l )
70 CMAKE_REMOVE_MODULES_LIST=( FindFreetype )
73 use python && python-single-r1_pkg_setup
77 local libdir=$(get_libdir)
79 -DDISABLE_ALSA=$(usex !alsa)
80 -DDISABLE_FREETYPE=$(usex !truetype)
81 -DDISABLE_JACK=$(usex !jack)
82 -DDISABLE_LIBFDK=$(usex !fdk)
83 -DDISABLE_PULSEAUDIO=$(usex !pulseaudio)
84 -DDISABLE_SPEEXDSP=$(usex !speex)
85 -DDISABLE_V4L2=$(usex !v4l)
86 -DLIBOBS_PREFER_IMAGEMAGICK=$(usex imagemagick)
87 -DOBS_MULTIARCH_SUFFIX=${libdir#lib}
91 if use luajit || use python; then
93 -DDISABLE_LUA=$(usex !luajit)
94 -DDISABLE_PYTHON=$(usex !python)
95 -DENABLE_SCRIPTING=yes
98 mycmakeargs+=( -DENABLE_SCRIPTING=no )
101 cmake-utils_src_configure
105 xdg_icon_cache_update
107 if ! use alsa && ! use pulseaudio; then
109 elog "For the audio capture features to be available,"
110 elog "either the 'alsa' or the 'pulseaudio' USE-flag needs to"
115 if ! has_version "sys-apps/dbus"; then
117 elog "The 'sys-apps/dbus' package is not installed, but"
118 elog "could be used for disabling hibernating, screensaving,"
119 elog "and sleeping. Where it is not installed,"
120 elog "'xdg-screensaver reset' is used instead"
121 elog "(if 'x11-misc/xdg-utils' is installed)."
127 xdg_icon_cache_update