Merge remote-tracking branch 'github/pr/1633', bug 527306 by Ettore Di Giacinto
[gentoo.git] / media-video / obs-studio / obs-studio-9999.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="6"
6
7 inherit cmake-utils
8
9 if [[ ${PV} == *9999 ]]; then
10         inherit git-r3
11         EGIT_REPO_URI="https://github.com/jp9000/obs-studio.git"
12         EGIT_SUBMODULES=()
13 else
14         SRC_URI="https://github.com/jp9000/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
15         KEYWORDS="~amd64 ~x86"
16 fi
17
18 DESCRIPTION="Software for Recording and Streaming Live Video Content"
19 HOMEPAGE="https://obsproject.com"
20
21 LICENSE="GPL-2"
22 SLOT="0"
23 IUSE="+alsa fdk imagemagick jack pulseaudio truetype v4l"
24
25 DEPEND="
26         >=dev-libs/jansson-2.5
27         dev-qt/qtcore:5
28         dev-qt/qtdeclarative:5
29         dev-qt/qtgui:5
30         dev-qt/qtmultimedia:5
31         dev-qt/qtnetwork:5
32         dev-qt/qtquickcontrols:5
33         dev-qt/qtsql:5
34         dev-qt/qttest:5
35         dev-qt/qtwidgets:5
36         dev-qt/qtx11extras:5
37         media-libs/x264:=
38         media-video/ffmpeg:=
39         x11-libs/libXcomposite
40         x11-libs/libXinerama
41         x11-libs/libXrandr
42         alsa? ( media-libs/alsa-lib )
43         fdk? ( media-libs/fdk-aac:= )
44         imagemagick? ( media-gfx/imagemagick:= )
45         jack? ( virtual/jack )
46         pulseaudio? ( media-sound/pulseaudio )
47         truetype? (
48                 media-libs/fontconfig
49                 media-libs/freetype
50         )
51         v4l? ( media-libs/libv4l )
52 "
53 RDEPEND="${DEPEND}"
54
55 src_prepare() {
56         CMAKE_REMOVE_MODULES_LIST=(FindFreetype)
57
58         cmake-utils_src_prepare
59 }
60
61 src_configure() {
62         local libdir="$(get_libdir)"
63         local mycmakeargs=(
64                 -DDISABLE_ALSA="$(usex !alsa)"
65                 -DDISABLE_FREETYPE="$(usex !truetype)"
66                 -DDISABLE_JACK="$(usex !jack)"
67                 -DDISABLE_LIBFDK="$(usex !fdk)"
68                 -DDISABLE_PULSEAUDIO="$(usex !pulseaudio)"
69                 -DDISABLE_V4L2="$(usex !v4l)"
70                 -DLIBOBS_PREFER_IMAGEMAGICK="$(usex imagemagick)"
71                 -DOBS_MULTIARCH_SUFFIX="${libdir#lib}"
72                 -DUNIX_STRUCTURE=1
73         )
74
75         cmake-utils_src_configure
76 }
77
78 pkg_postinst() {
79         if ! use alsa && ! use pulseaudio; then
80                 elog "To be able to use the audio capture features, either the"
81                 elog "'alsa' or the 'pulseaudio' USE-flag needs to be enabled."
82         fi
83 }