aboutsummaryrefslogtreecommitdiff
blob: 5e5fc874741b411bdc0875e5b3453923dbbc35be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

PYTHON_COMPAT=( python3_{6,7} )
DISTUTILS_USE_SETUPTOOLS=rdepend

inherit distutils-r1 eutils xdg

MYPV="${PV/_p1/a}"

DESCRIPTION="Client/server to synchronize media playback"
HOMEPAGE="https://github.com/Syncplay/syncplay https://syncplay.pl"
SRC_URI="https://github.com/${PN^}/${PN}/archive/v${MYPV}.tar.gz -> ${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"

IUSE="+client +server vlc mpv"
REQUIRED_USE="vlc? ( client ) mpv? ( client )"

RDEPEND="
	dev-python/certifi[${PYTHON_USEDEP}]
	dev-python/twisted[${PYTHON_USEDEP}]
	vlc? ( media-video/vlc[lua] )
	mpv? ( media-video/mpv[lua] )
"

# RDEPEND on PySide2 for gui, but not packaged here at the moment
# It is a too big and complex package for me to maintain
# You can find PySide2 in the ::raiagent overlay

S="${WORKDIR}/${PN}-${MYPV}"

python_install() {
	local MY_MAKEOPTS=( DESTDIR="${D}" PREFIX=/usr )
	use client && \
		emake "${MY_MAKEOPTS[@]}" install-client
	use server && \
		emake "${MY_MAKEOPTS[@]}" install-server

	newinitd "${FILESDIR}/${PN}-server-init" "${PN}"
	newconfd "${FILESDIR}/${PN}-server-init-conf" "${PN}"
}

pkg_postinst() {
	xdg_pkg_postinst

	optfeature "using the GUI (you can find it in the raiagent overlay)\n" dev-python/pyside2

	if use client; then
		elog "Syncplay supports the following players:"
		elog "media-video/mpv, media-video/mplayer2, media-video/vlc"
	fi
}