summaryrefslogtreecommitdiff
blob: 0cb9a5d01453ce2d75e3371acb71c205e686ba99 (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
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit bash-completion-r1 meson

DESCRIPTION="Commandline client for Music Player Daemon (media-sound/mpd)"
HOMEPAGE="https://www.musicpd.org https://github.com/MusicPlayerDaemon/mpc"
SRC_URI="https://www.musicpd.org/download/${PN}/${PV%.*}/${P}.tar.xz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 arm ppc ppc64 ~sparc x86"
IUSE="doc iconv test"

BDEPEND="
	virtual/pkgconfig
	doc? ( dev-python/sphinx )
	iconv? ( virtual/libiconv )
	test? ( dev-libs/check )
"
DEPEND="media-libs/libmpdclient"
RDEPEND="${DEPEND}"

RESTRICT="!test? ( test )"

PATCHES=( "${FILESDIR}/${PN}-0.31-nodoc.patch" )

src_prepare() {
	default

	# use correct docdir
	sed -e "/install_dir:.*contrib/s/meson.project_name()/'${PF}'/" \
		-i meson.build || die

	# use correct (html) docdir
	sed -e "/install_dir:.*doc/s/meson.project_name()/'${PF}'/" \
		-i doc/meson.build || die
}

src_configure() {
	local emesonargs=(
		-Ddocumentation=$(usex doc enabled disabled)
		-Diconv=$(usex iconv enabled disabled)
		-Dtest=$(usex test true false)
	)
	meson_src_configure
}

src_install() {
	meson_src_install
	newbashcomp contrib/mpc-completion.bash mpc
}