media-video/obs-studio: bump to EAPI="7".
[gentoo.git] / media-video / obs-studio / obs-studio-9999.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python{3_4,3_5,3_6,3_7} )
7
8 inherit cmake-utils gnome2-utils python-single-r1
9
10 if [[ ${PV} == *9999 ]]; then
11         inherit git-r3
12         EGIT_REPO_URI="https://github.com/obsproject/obs-studio.git"
13         EGIT_SUBMODULES=()
14 else
15         SRC_URI="https://github.com/obsproject/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
16         KEYWORDS="~amd64 ~x86"
17 fi
18
19 DESCRIPTION="Software for Recording and Streaming Live Video Content"
20 HOMEPAGE="https://obsproject.com"
21
22 LICENSE="GPL-2"
23 SLOT="0"
24 IUSE="+alsa fdk imagemagick jack luajit nvenc pulseaudio python speex truetype v4l"
25 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
26
27 BDEPEND="
28         luajit? ( dev-lang/swig )
29         python? ( dev-lang/swig )
30 "
31 DEPEND="
32         >=dev-libs/jansson-2.5
33         dev-qt/qtcore:5
34         dev-qt/qtdeclarative:5
35         dev-qt/qtgui:5
36         dev-qt/qtmultimedia:5
37         dev-qt/qtnetwork:5
38         dev-qt/qtquickcontrols:5
39         dev-qt/qtsql:5
40         dev-qt/qttest:5
41         dev-qt/qtwidgets:5
42         dev-qt/qtx11extras:5
43         media-video/ffmpeg:=[x264]
44         net-misc/curl
45         x11-libs/libXcomposite
46         x11-libs/libXinerama
47         x11-libs/libXrandr
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 )
53         nvenc? (
54                 || (
55                         <media-video/ffmpeg-4[nvenc]
56                         >=media-video/ffmpeg-4[video_cards_nvidia]
57                 )
58         )
59         pulseaudio? ( media-sound/pulseaudio )
60         python? ( ${PYTHON_DEPS} )
61         speex? ( media-libs/speexdsp )
62         truetype? (
63                 media-libs/fontconfig
64                 media-libs/freetype
65         )
66         v4l? ( media-libs/libv4l )
67 "
68 RDEPEND="${DEPEND}"
69
70 CMAKE_REMOVE_MODULES_LIST=( FindFreetype )
71
72 pkg_setup() {
73         use python && python-single-r1_pkg_setup
74 }
75
76 src_configure() {
77         local libdir=$(get_libdir)
78         local mycmakeargs=(
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}
88                 -DUNIX_STRUCTURE=1
89         )
90
91         if use luajit || use python; then
92                 mycmakeargs+=(
93                         -DDISABLE_LUA=$(usex !luajit)
94                         -DDISABLE_PYTHON=$(usex !python)
95                         -DENABLE_SCRIPTING=yes
96                 )
97         else
98                 mycmakeargs+=( -DENABLE_SCRIPTING=no )
99         fi
100
101         cmake-utils_src_configure
102 }
103
104 pkg_postinst() {
105         gnome2_icon_cache_update
106
107         if ! use alsa && ! use pulseaudio; then
108                 elog
109                 elog "For the audio capture features to be available,"
110                 elog "either the 'alsa' or the 'pulseaudio' USE-flag needs to"
111                 elog "be enabled."
112                 elog
113         fi
114
115         if ! has_version "sys-apps/dbus"; then
116                 elog
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)."
122                 elog
123         fi
124 }
125
126 pkg_postrm() {
127         gnome2_icon_cache_update
128 }