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

EAPI=6

inherit cmake-utils

DESCRIPTION="Streaming audio processing library."
HOMEPAGE="https://github.com/andrewrk/libgroove"
SRC_URI="https://github.com/andrewrk/libgroove/archive/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="MIT"
SLOT="0/4"
KEYWORDS="~amd64"
IUSE="+chromaprint libav +loudness +sound static-libs"

DEPEND="
	libav? ( media-video/libav:= )
	!libav? ( media-video/ffmpeg:= )
	chromaprint? ( media-libs/chromaprint:= )
	loudness? ( media-libs/libebur128:=[speex(+)] )
	sound? ( media-libs/libsdl2[sound] )"
RDEPEND="${DEPEND}"

PATCHES=(
	"${FILESDIR}/${P}_cflags.patch"
	"${FILESDIR}/${P}_sdl2_include_dir.patch"
	"${FILESDIR}/${P}_ffmpeg4.patch"
	"${FILESDIR}/${P}_GNUInstallDirs.patch"
)

src_configure() {
	local mycmakeargs=(
		-DDISABLE_FINGERPRINTER=$(usex !chromaprint)
		-DDISABLE_LOUDNESS=$(usex !loudness)
		-DDISABLE_PLAYER=$(usex !sound)
	)
	cmake-utils_src_configure
}

src_install() {
	cmake-utils_src_install

	if ! use static-libs ; then
		rm "${ED%/}"/usr/$(get_libdir)/*.a || die "failed to remove static libs"
	fi
}