media-sound/alsa-utils: stable 1.2.2 for ppc64, bug #720810
[gentoo.git] / media-sound / wildmidi / wildmidi-0.3.13.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit cmake-utils readme.gentoo-r1
7
8 DESCRIPTION="Midi processing library and a midi player using the gus patch set"
9 HOMEPAGE="http://www.mindwerks.net/projects/wildmidi/"
10 SRC_URI="https://github.com/Mindwerks/${PN}/archive/${P}.tar.gz"
11
12 LICENSE="GPL-3 LGPL-3"
13 SLOT="0"
14 KEYWORDS="amd64 arm ~hppa ppc ppc64 x86"
15 IUSE="+alsa openal oss +player"
16
17 DEPEND="
18         player? (
19                 alsa? ( media-libs/alsa-lib )
20                 openal? ( media-libs/openal )
21         )
22 "
23 RDEPEND="${DEPEND}
24         media-sound/timidity-freepats
25 "
26
27 REQUIRED_USE="player? ( ^^ ( alsa oss openal ) )"
28
29 DOC_CONTENTS="${PN} is using timidity-freepats for midi playback.
30         A default configuration file was placed on /etc/${PN}/${PN}.cfg.
31         For more information please read the ${PN}.cfg manpage."
32
33 S="${WORKDIR}"/${PN}-${P}
34
35 src_prepare() {
36         # alsa openal oss only make sense if player is enabled. See CMakeLists.txt
37         if ! use player && (use alsa || use openal || use oss); then
38                 ewarn "The 'alsa', 'openal' and 'oss' use flags only make sense if"
39                 ewarn "the 'player' use flags is selected and as a result they will be"
40                 ewarn "ignored in this build"
41         fi
42         cmake-utils_src_prepare
43 }
44
45 src_configure() {
46         local mycmakeargs=(
47                 -DWANT_ALSA=$(usex alsa)
48                 -DWANT_OPENAL=$(usex openal)
49                 -DWANT_OSS=$(usex oss)
50                 -DWANT_PLAYER=$(usex player)
51         )
52         cmake-utils_src_configure
53 }
54
55 src_install() {
56         cmake-utils_src_install
57
58         find "${D}" -name '*.la' -delete || die
59
60         insinto /etc/${PN}/
61         doins cfg/${PN}.cfg
62
63         readme.gentoo_create_doc
64 }
65
66 pkg_postinst() {
67         if [[ -e "${ROOT}"/etc/${PN}.cfg ]]; then
68                 elog
69                 elog "Old /etc/${PN}.cfg detected!"
70                 elog "Please migrate your configuration file to"
71                 elog "/etc/${PN}/ directory which is now the default"
72                 elog "location for the ${PN} configuration file."
73                 elog
74         fi
75 }