summaryrefslogtreecommitdiff
blob: 4b371d0f6e8d304a62c2797073fbe156f8121593 (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
55
56
57
58
59
60
61
62
63
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit autotools edos2unix flag-o-matic xdg

DESCRIPTION="a software musical instrument and audio synthesizer"
HOMEPAGE="https://dinisnoise.org/"
SRC_URI="https://archive.org/download/dinisnoise_source_code/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="+alsa jack"

RDEPEND="
	dev-lang/tcl:0=
	media-libs/libsdl:=
	virtual/glu
	virtual/opengl
	alsa? ( media-libs/alsa-lib )
	jack? ( virtual/jack )
"
DEPEND="
	${RDEPEND}
	dev-libs/boost
"
BDEPEND="
	virtual/pkgconfig
"

REQUIRED_USE="|| ( alsa jack )"

PATCHES=(
	"${FILESDIR}/${PN}-58.1-makefile.patch"
	"${FILESDIR}/${PN}-48-fix-random-constants.patch"
)

src_prepare() {
	default

	edos2unix pixmaps/${PN}.desktop

	use jack && (sed -i "s/-lasound/-ljack/g" src/Makefile.am || die "Failed to fix jack linking")

	eautoreconf
}

src_configure() {
	# -Werror=odr
	# https://bugs.gentoo.org/860513
	# No upstream bugtracker. I believe upstream prefers emails,
	# so I have emailed the author directly.
	filter-lto

	# Jack takes over alsa.
	local sound_engine

	use jack && sound_engine="UNIX_JACK" || sound_engine="LINUX_ALSA"

	econf CXXFLAGS="${CXXFLAGS} -D__${sound_engine}__"
}