afd6bb7009c64076643c2789b438d472349d0f9a
[gentoo.git] / media-sound / qsynth / qsynth-0.6.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit desktop flag-o-matic qmake-utils xdg-utils
7
8 DESCRIPTION="A Qt application to control FluidSynth"
9 HOMEPAGE="https://qsynth.sourceforge.io/"
10 SRC_URI="mirror://sourceforge/qsynth/${P}.tar.gz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 IUSE="+alsa debug jack pulseaudio"
15 KEYWORDS="amd64 ppc x86"
16
17 BDEPEND="
18         dev-qt/linguist-tools:5
19 "
20 DEPEND="
21         dev-qt/qtcore:5
22         dev-qt/qtgui:5
23         dev-qt/qtnetwork:5
24         dev-qt/qtwidgets:5
25         media-sound/fluidsynth:=[jack?,alsa?,pulseaudio?]
26 "
27 RDEPEND="${DEPEND}"
28
29 REQUIRED_USE="|| ( alsa jack pulseaudio )"
30
31 PATCHES=( "${FILESDIR}/${PN}-0.4.0-qt5-tagging.patch" )
32
33 src_configure() {
34         append-cxxflags -std=c++11
35         sed -e "/@gzip.*mandir)\/man1/d" -i Makefile.in || die
36         econf \
37                 $(use_enable debug)
38
39         eqmake5 ${PN}.pro -o ${PN}.mak
40 }
41
42 src_install() {
43         emake DESTDIR="${D}" INSTALL_ROOT="${D}" install
44         einstalldocs
45
46         # The desktop file is invalid, and we also change the command
47         # depending on useflags
48         rm "${ED}/usr/share/applications/qsynth.desktop" || die
49
50         local cmd
51         if use jack; then
52                 cmd="qsynth"
53         elif use pulseaudio; then
54                 cmd="qsynth -a pulseaudio"
55         elif use alsa; then
56                 cmd="qsynth -a alsa"
57         else
58                 cmd="qsynth -a oss"
59         fi
60
61         make_desktop_entry "${cmd}" Qsynth qsynth
62 }
63
64 pkg_postinst() {
65         xdg_icon_cache_update
66 }
67
68 pkg_postrm() {
69         xdg_icon_cache_update
70 }