media-video/obs-studio: rename USE="speexdsp" to "speex"
[gentoo.git] / media-video / obs-studio / obs-studio-9999.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python{3_4,3_5,3_6} )
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 COMMON_DEPEND="
28         >=dev-libs/jansson-2.5
29         dev-qt/qtcore:5
30         dev-qt/qtdeclarative:5
31         dev-qt/qtgui:5
32         dev-qt/qtmultimedia:5
33         dev-qt/qtnetwork:5
34         dev-qt/qtquickcontrols:5
35         dev-qt/qtsql:5
36         dev-qt/qttest:5
37         dev-qt/qtwidgets:5
38         dev-qt/qtx11extras:5
39         media-video/ffmpeg:=[x264]
40         net-misc/curl
41         x11-libs/libXcomposite
42         x11-libs/libXinerama
43         x11-libs/libXrandr
44         alsa? ( media-libs/alsa-lib )
45         fdk? ( media-libs/fdk-aac:= )
46         imagemagick? ( media-gfx/imagemagick:= )
47         jack? ( virtual/jack )
48         luajit? ( dev-lang/luajit:2 )
49         nvenc? ( media-video/ffmpeg:=[nvenc(+),video_cards_nvidia(+)] )
50         pulseaudio? ( media-sound/pulseaudio )
51         python? ( ${PYTHON_DEPS} )
52         speex? ( media-libs/speexdsp )
53         truetype? (
54                 media-libs/fontconfig
55                 media-libs/freetype
56         )
57         v4l? ( media-libs/libv4l )
58 "
59 DEPEND="${COMMON_DEPEND}
60         luajit? ( dev-lang/swig )
61         python? ( dev-lang/swig )
62 "
63 RDEPEND="${COMMON_DEPEND}"
64
65 PATCHES="${FILESDIR}/${PN}-21.1.2-use-less-automagic.patch"
66
67 CMAKE_REMOVE_MODULES_LIST=( FindFreetype )
68
69 src_configure() {
70         local libdir=$(get_libdir)
71         local mycmakeargs=(
72                 -DDISABLE_ALSA=$(usex !alsa)
73                 -DDISABLE_FREETYPE=$(usex !truetype)
74                 -DDISABLE_JACK=$(usex !jack)
75                 -DDISABLE_LIBFDK=$(usex !fdk)
76                 -DDISABLE_PULSEAUDIO=$(usex !pulseaudio)
77                 -DDISABLE_SPEEXDSP=$(usex !speex)
78                 -DDISABLE_V4L2=$(usex !v4l)
79                 -DLIBOBS_PREFER_IMAGEMAGICK=$(usex imagemagick)
80                 -DOBS_MULTIARCH_SUFFIX=${libdir#lib}
81                 -DUNIX_STRUCTURE=1
82         )
83
84         if use luajit || use python; then
85                 mycmakeargs+=(
86                         -DDISABLE_LUA=$(usex !luajit)
87                         -DDISABLE_PYTHON=$(usex !python)
88                         -DENABLE_SCRIPTING=yes
89                 )
90         else
91                 mycmakeargs+=( -DENABLE_SCRIPTING=no )
92         fi
93
94         cmake-utils_src_configure
95 }
96
97 pkg_postinst() {
98         gnome2_icon_cache_update
99
100         if ! use alsa && ! use pulseaudio; then
101                 elog
102                 elog "For the audio capture features to be available,"
103                 elog "either the 'alsa' or the 'pulseaudio' USE-flag needs to"
104                 elog "be enabled."
105                 elog
106         fi
107
108         if ! has_version "sys-apps/dbus"; then
109                 elog
110                 elog "The 'sys-apps/dbus' package is not installed, but"
111                 elog "could be used for disabling hibernating, screensaving,"
112                 elog "and sleeping.  Where it is not installed,"
113                 elog "'xdg-screensaver reset' is used instead"
114                 elog "(if 'x11-misc/xdg-utils' is installed)."
115                 elog
116         fi
117 }
118
119 pkg_postrm() {
120         gnome2_icon_cache_update
121 }