summaryrefslogtreecommitdiff
path: root/app-emulation/fuse/fuse-1.8.0.ebuild
blob: ed1ab37ea9e25e99091aa54cd143c23c7a19be94 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit autotools flag-o-matic xdg

DESCRIPTION="Free Unix Spectrum Emulator by Philip Kendall"
HOMEPAGE="https://fuse-emulator.sourceforge.net"
SRC_URI="https://downloads.sourceforge.net/fuse-emulator/${P}.tar.gz"

LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~riscv ~x86"
IUSE="alsa ao backend-X backend-fbcon +backend-gtk3 backend-sdl backend-sdl2 gpm joystick memlimit png pulseaudio +xml +zlib"

# TODO:
# - allow using sdl audio driver without using for the UI
# - allow using sdl joystick support with gtk3 or X UI in place of libjsw
# - when using sdl for one of the above but not the UI, allow using sdl2 instead

# At most one audio driver and at most one UI back-end can be enabled at a time
REQUIRED_USE="?? ( alsa ao backend-sdl backend-sdl2 pulseaudio )
	?? ( backend-X backend-fbcon backend-gtk3 backend-sdl backend-sdl2 )
	png? ( zlib )"

RDEPEND="
	>=app-emulation/libspectrum-1.6.0:=[zlib?]
	dev-libs/glib:2
	alsa? ( media-libs/alsa-lib )
	ao? ( media-libs/libao )
	backend-X? (
		x11-libs/libX11
		x11-libs/libXext
	)
	backend-gtk3? (
		x11-libs/cairo
		x11-libs/gdk-pixbuf:2
		x11-libs/gtk+:3
		x11-libs/libX11
		x11-libs/pango
	)
	backend-sdl? ( media-libs/libsdl[joystick,sound] )
	backend-sdl2? ( media-libs/libsdl2[joystick,sound] )
	gpm? ( backend-fbcon? ( sys-libs/gpm ) )
	joystick? (
		!backend-sdl? (
			!backend-sdl2? (
				media-libs/libjsw
			)
		)
	)
	png? ( media-libs/libpng:0= )
	pulseaudio? ( media-libs/libpulse )
	xml? ( dev-libs/libxml2:2= )
	zlib? ( virtual/zlib:= )"
DEPEND="${RDEPEND}
	backend-fbcon? ( virtual/linux-sources )"
BDEPEND="dev-lang/perl
	virtual/pkgconfig"

DOCS=( AUTHORS ChangeLog README THANKS )

PATCHES=(
	"${FILESDIR}"/remove-local-prefix.patch
)

_fuse_audio_driver() {
	if use alsa; then
		echo "alsa"
	elif use ao; then
		echo "libao"
	elif use backend-sdl; then
		echo "sdl"
	elif use backend-sdl2; then
		echo "sdl2"
	elif use pulseaudio; then
		echo "pulseaudio"
	else
		echo "null"
	fi
}

_fuse_joystick_driver() {
	if use joystick; then
		if use backend-sdl || use backend-sdl2; then
			echo "--enable-ui-joystick"
			return
		fi
	fi
	echo "--disable-ui-joystick"
}

src_prepare() {
	default
	xdg_environment_reset
	eautoreconf

	# Bug #854522
	filter-lto
}

src_configure() {
	local myconf=(
		--enable-desktop-integration
		--without-win32
		--with-audio-driver="$(_fuse_audio_driver)"
		$(_fuse_joystick_driver)
		$(use_with gpm)
		$(use_with joystick)
		$(use_enable memlimit smallmem)
		$(use_with png)
		$(use_with xml libxml2)
		$(use_with zlib)
	)

	# The pure-X UI hasn't got its own configure argument, instead it is
	# what is used under Linux if all other back-ends have been disabled
	# - and all except the Gtk+ one are off by default.
	if use backend-X; then
		myconf+=("--without-gtk")
	elif use backend-fbcon; then
		myconf+=("--with-fb")
	elif use backend-gtk3; then
		myconf+=("--with-gtk")
	elif use backend-sdl; then
		myconf+=("--with-sdl" "--disable-sdl2")
	elif use backend-sdl2; then
		myconf+=("--with-sdl2")
	else
		myconf+=("--with-null-ui")
	fi

	econf "${myconf[@]}"
}

src_test() {
	emake test
}

pkg_postinst() {
	xdg_pkg_postinst
	if use pulseaudio; then
		ewarn "The PulseAudio driver in ${PN} is experimental"
	fi
}