sys-process/glances: 3.1.4.1-r1 amd64 stable, bug #720368
[gentoo.git] / media-video / obs-studio / obs-studio-9999.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 CMAKE_REMOVE_MODULES_LIST=( FindFreetype )
7 PYTHON_COMPAT=( python3_{6,7} )
8
9 inherit cmake-utils python-single-r1 xdg-utils
10
11 if [[ ${PV} == *9999 ]]; then
12         inherit git-r3
13         EGIT_REPO_URI="https://github.com/obsproject/obs-studio.git"
14         EGIT_SUBMODULES=()
15 else
16         SRC_URI="https://github.com/obsproject/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
17         KEYWORDS="~amd64 ~ppc64 ~x86"
18 fi
19
20 DESCRIPTION="Software for Recording and Streaming Live Video Content"
21 HOMEPAGE="https://obsproject.com"
22
23 LICENSE="GPL-2"
24 SLOT="0"
25 IUSE="+alsa fdk imagemagick jack luajit nvenc pulseaudio python speex +ssl truetype v4l vlc"
26 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
27
28 BDEPEND="
29         luajit? ( dev-lang/swig )
30         python? ( dev-lang/swig )
31 "
32 DEPEND="
33         >=dev-libs/jansson-2.5
34         dev-qt/qtcore:5
35         dev-qt/qtdeclarative:5
36         dev-qt/qtgui:5
37         dev-qt/qtmultimedia:5
38         dev-qt/qtnetwork:5
39         dev-qt/qtquickcontrols:5
40         dev-qt/qtsql:5
41         dev-qt/qtsvg:5
42         dev-qt/qtwidgets:5
43         dev-qt/qtx11extras:5
44         dev-qt/qtxml:5
45         media-libs/x264
46         media-video/ffmpeg:=[x264]
47         net-misc/curl
48         sys-apps/dbus
49         sys-libs/zlib
50         virtual/udev
51         x11-libs/libX11
52         x11-libs/libXcomposite
53         x11-libs/libXfixes
54         x11-libs/libXinerama
55         x11-libs/libXrandr
56         x11-libs/libxcb
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 )
62         nvenc? (
63                 || (
64                         <media-video/ffmpeg-4[nvenc]
65                         >=media-video/ffmpeg-4[video_cards_nvidia]
66                 )
67         )
68         pulseaudio? ( media-sound/pulseaudio )
69         python? ( ${PYTHON_DEPS} )
70         speex? ( media-libs/speexdsp )
71         ssl? ( net-libs/mbedtls:= )
72         truetype? (
73                 media-libs/fontconfig
74                 media-libs/freetype
75         )
76         v4l? ( media-libs/libv4l )
77         vlc? ( media-video/vlc:= )
78 "
79 RDEPEND="${DEPEND}"
80
81 pkg_setup() {
82         use python && python-single-r1_pkg_setup
83 }
84
85 src_configure() {
86         local libdir=$(get_libdir)
87         local mycmakeargs=(
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}
98                 -DUNIX_STRUCTURE=1
99                 -DWITH_RTMPS=$(usex ssl)
100         )
101
102         if [ "${PV}" != "9999" ]; then
103                 mycmakeargs+=(
104                         -DOBS_VERSION_OVERRIDE=${PV}
105                 )
106         fi
107
108         if use luajit || use python; then
109                 mycmakeargs+=(
110                         -DDISABLE_LUA=$(usex !luajit)
111                         -DDISABLE_PYTHON=$(usex !python)
112                         -DENABLE_SCRIPTING=yes
113                 )
114         else
115                 mycmakeargs+=( -DENABLE_SCRIPTING=no )
116         fi
117
118         cmake-utils_src_configure
119 }
120
121 src_install() {
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
126 }
127
128 pkg_postinst() {
129         xdg_icon_cache_update
130
131         if ! use alsa && ! use pulseaudio; then
132                 elog
133                 elog "For the audio capture features to be available,"
134                 elog "either the 'alsa' or the 'pulseaudio' USE-flag needs to"
135                 elog "be enabled."
136                 elog
137         fi
138
139         if ! has_version "sys-apps/dbus"; then
140                 elog
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)."
146                 elog
147         fi
148 }
149
150 pkg_postrm() {
151         xdg_icon_cache_update
152 }