media-sound/coquillo: EAPI-7 bump
[gentoo.git] / media-sound / fluidsynth / fluidsynth-2.0.7.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit cmake-multilib systemd
7
8 DESCRIPTION="Software real-time synthesizer based on the Soundfont 2 specifications"
9 HOMEPAGE="http://www.fluidsynth.org/"
10 SRC_URI="https://github.com/FluidSynth/fluidsynth/archive/v${PV}.tar.gz -> ${P}.tar.gz"
11
12 LICENSE="LGPL-2.1+"
13 SLOT="0/2"
14 KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ppc ppc64 sparc x86"
15 IUSE="alsa dbus debug examples ipv6 jack ladspa lash oss portaudio pulseaudio +readline +sndfile systemd"
16
17 BDEPEND="
18         virtual/pkgconfig[${MULTILIB_USEDEP}]
19 "
20 DEPEND="
21         dev-libs/glib:2[${MULTILIB_USEDEP}]
22         alsa? (
23                 media-libs/alsa-lib[${MULTILIB_USEDEP}]
24                 lash? ( media-sound/lash[${MULTILIB_USEDEP}] )
25         )
26         dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
27         jack? ( virtual/jack[${MULTILIB_USEDEP}] )
28         ladspa? (
29                 media-libs/ladspa-cmt[${MULTILIB_USEDEP}]
30                 media-libs/ladspa-sdk[${MULTILIB_USEDEP}]
31         )
32         portaudio? ( media-libs/portaudio[${MULTILIB_USEDEP}] )
33         pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
34         readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
35         sndfile? ( media-libs/libsndfile[${MULTILIB_USEDEP}] )
36 "
37 RDEPEND="${DEPEND}"
38
39 DOCS=( AUTHORS NEWS README.md THANKS TODO doc/{fluidsynth-v20-devdoc,xtrafluid}.txt )
40
41 src_configure() {
42         local mycmakeargs=(
43                 -Denable-alsa=$(usex alsa)
44                 -Denable-dbus=$(usex dbus)
45                 -Denable-debug=$(usex debug)
46                 -Denable-ipv6=$(usex ipv6)
47                 -Denable-jack=$(usex jack)
48                 -Denable-ladspa=$(usex ladspa)
49                 -Denable-oss=$(usex oss)
50                 -Denable-libsndfile=$(usex sndfile)
51                 -Denable-portaudio=$(usex portaudio)
52                 -Denable-pulseaudio=$(usex pulseaudio)
53                 -Denable-readline=$(usex readline)
54                 -Denable-systemd=$(usex systemd)
55         )
56
57         if use alsa; then
58                 mycmakeargs+=( -Denable-lash=$(usex lash) )
59         else
60                 mycmakeargs+=( -Denable-lash=OFF )
61         fi
62
63         if use systemd; then
64                 mycmakeargs+=( -DFLUID_DAEMON_ENV_FILE="/etc/fluidsynth.conf" )
65         fi
66
67         cmake-multilib_src_configure
68 }
69
70 install_systemd_files() {
71         if multilib_is_native_abi; then
72                 systemd_dounit "${BUILD_DIR}/fluidsynth.service"
73                 insinto /etc
74                 doins "${BUILD_DIR}/fluidsynth.conf"
75         fi
76 }
77
78 src_install() {
79         cmake-multilib_src_install
80
81         docinto pdf
82         dodoc doc/*.pdf
83
84         if use examples; then
85                 docinto examples
86                 dodoc doc/*.c
87         fi
88
89         if use systemd; then
90                 multilib_foreach_abi install_systemd_files
91
92                 elog "When using fluidsynth as a systemd service, make sure"
93                 elog "to configure your fluidsynth settings globally in "
94                 elog "/etc/fluidsynth.conf or per-user in ~/.config/fluidsynth"
95         fi
96 }