Diff deadbeef-1.10.0 with a deadbeef-9999

/var/lib/layman/calculate/media-sound/deadbeef/deadbeef-9999.ebuild 2019-05-14 00:57:04.000000000 +0300
1
# Copyright 2021-2025 Gentoo Authors
1
# Copyright 1999-2019 Gentoo Foundation
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI=8
4
EAPI="7"
5 5

  
6
inherit autotools xdg flag-o-matic toolchain-funcs plocale
6
PLOCALES="be bg bn ca cs da de el en_GB es et eu fa fi fr gl he hr hu id it ja kk km lg
7
	lt nl pl pt pt_BR ro ru si_LK sk sl sr sr@latin sv te tr ug uk vi zh_CN zh_TW"
7 8

  
8
DESCRIPTION="DeaDBeeF is a modular audio player similar to foobar2000"
9
HOMEPAGE="https://deadbeef.sourceforge.io/"
10
SRC_URI="https://sourceforge.net/projects/${PN}/files/travis/linux/${PV}/deadbeef-${PV}.tar.bz2/download
11
	-> ${P}.tar.bz2"
12

  
13
LICENSE="
14
	GPL-2
15
	LGPL-2.1
16
	MIT
9
PLOCALE_BACKUP="en_GB"
10

  
11
inherit autotools eutils git-r3 gnome2-utils l10n xdg-utils
12

  
13
EGIT_REPO_URI="https://github.com/Alexey-Yakovenko/${PN}.git"
14
EGIT_BRANCH="master"
15

  
16
KEYWORDS=""
17

  
18
DESCRIPTION="foobar2k-like music player"
19
HOMEPAGE="http://deadbeef.sourceforge.net"
20

  
21
LICENSE="BSD
22
	UNICODE
23
	ZLIB
24
	aac? ( GPL-1 GPL-2 )
25
	adplug? ( LGPL-2.1 ZLIB )
26
	alac? ( MIT GPL-2 )
27
	alsa? ( GPL-2 )
28
	cdda? ( GPL-2 LGPL-2 GPL-3 )
29
	cdparanoia? ( GPL-2 )
30
	cover? ( ZLIB )
31
	converter? ( GPL-2 )
32
	curl? ( curl ZLIB )
33
	dts? ( GPL-2 )
34
	dumb? ( DUMB-0.9.3 ZLIB )
35
	equalizer? ( GPL-2 )
36
	ffmpeg? ( GPL-2 )
37
	flac? ( BSD )
38
	gme? ( LGPL-2.1 )
39
	gtk2? ( GPL-2 )
40
	gtk3? ( GPL-2 )
41
	hotkeys? ( ZLIB )
42
	lastfm? ( GPL-2 )
43
	libav? ( GPL-2 )
44
	libnotify? ( GPL-2 )
45
	libsamplerate? ( GPL-2 )
46
	m3u? ( ZLIB )
47
	mac? ( GPL-2 )
48
	mad? ( GPL-2 ZLIB )
49
	midi? ( LGPL-2.1 ZLIB )
50
	mms? ( GPL-2 ZLIB )
51
	mono2stereo? ( ZLIB )
52
	mpg123? ( LGPL-2.1 ZLIB )
53
	musepack? ( BSD ZLIB )
54
	nullout? ( ZLIB )
55
	opus? ( ZLIB )
56
	oss? ( GPL-2 )
57
	playlist-browser? ( ZLIB )
58
	psf? ( BSD GPL-1 MAME ZLIB )
59
	pulseaudio? ( GPL-2 )
60
	shell-exec? ( GPL-2 )
61
	shn? ( shorten ZLIB )
62
	sid? ( GPL-2 )
63
	sndfile? ( GPL-2 LGPL-2 )
64
	tta? ( BSD ZLIB )
65
	vorbis? ( BSD ZLIB )
66
	vtx? ( GPL-2 ZLIB )
17 67
	wavpack? ( BSD )
18
"
68
	wma? ( GPL-2 LGPL-2 ZLIB )
69
	zip? ( ZLIB )"
70

  
19 71
SLOT="0"
20
if [[ ${PV} != *beta* && ${PV} != *rc* ]]; then
21
	KEYWORDS="amd64 ~riscv x86"
22
fi
23
IUSE="aac alsa cdda converter cover dts ffmpeg flac +hotkeys lastfm libretro libsamplerate mp3 musepack nls notify +nullout opus oss pulseaudio pipewire sc68 shellexec +supereq vorbis wavpack zip"
24

  
25
REQUIRED_USE="
26
	|| ( alsa oss pulseaudio pipewire nullout )
27
"
28

  
29
DEPEND="
30
	>=app-accessibility/at-spi2-core-2.46.0
31
	dev-libs/glib:2
32
	dev-libs/jansson:=
33
	dev-libs/libdispatch
34
	media-libs/harfbuzz:=
35
	net-misc/curl
36
	x11-libs/cairo
37
	x11-libs/gdk-pixbuf:2
38
	x11-libs/gtk+:3
39
	x11-libs/libX11
40
	x11-libs/pango
41
	aac? ( media-libs/faad2 )
42
	alsa? ( media-libs/alsa-lib )
43
	cdda? (
44
		dev-libs/libcdio:=
45
		media-libs/libcddb
46
		media-sound/cdparanoia
47
	)
48
	cover? ( media-libs/imlib2[jpeg,png] )
49
	dts? ( media-libs/libdca )
50
	ffmpeg? ( media-video/ffmpeg:= )
51
	flac? (
52
		media-libs/flac:=
53
		media-libs/libogg
54
	)
55
	libsamplerate? ( media-libs/libsamplerate )
56
	mp3? ( media-sound/mpg123-base )
57
	musepack? ( media-sound/musepack-tools )
58
	nls? ( virtual/libintl )
59
	notify? ( sys-apps/dbus )
60
	opus? ( media-libs/opusfile )
61
	pulseaudio? ( media-libs/libpulse )
62
	pipewire? ( media-video/pipewire:= )
63
	vorbis? ( media-libs/libvorbis )
64
	wavpack? ( media-sound/wavpack )
65
	zip? ( sys-libs/zlib )
66
"
67

  
68
RDEPEND="${DEPEND}"
69
BDEPEND="
70
	dev-util/intltool
71
	llvm-core/clang
72
	>=sys-devel/gettext-0.21
73
	llvm-core/llvm
74
	virtual/pkgconfig
75
"
76

  
77
PATCHES=(
78
	"${FILESDIR}"/${PN}-1.10.0_beta1-drop-Werror.patch
79
	"${FILESDIR}"/${PN}-1.9.6-update-gettext.patch
80
)
72

  
73
IUSE="+alsa +flac +gtk2 +hotkeys +m3u +mad +mp3 +sndfile +vorbis
74
	aac adplug alac cdda cdparanoia converter cover cover-imlib2 cover-network curl dts dumb equalizer
75
	ffmpeg gme gtk3 lastfm libav libnotify libsamplerate mac midi mms mono2stereo mpg123 musepack nls
76
	nullout opus oss playlist-browser psf pulseaudio replaygain-scanner sc68 shell-exec shn sid tta unity vtx wavpack wma zip"
77

  
78
REQUIRED_USE="cdparanoia? ( cdda )
79
	converter? ( || ( gtk2 gtk3 ) )
80
	cover-imlib2? ( cover )
81
	cover-network? ( cover curl )
82
	cover? ( || ( gtk2 gtk3 ) )
83
	ffmpeg? ( !libav )
84
	lastfm? ( curl )
85
	libav? ( !ffmpeg )
86
	mp3? ( || ( mad mpg123 ) )
87
	playlist-browser? ( || ( gtk2 gtk3 ) )
88
	shell-exec? ( || ( gtk2 gtk3 ) )
89
	|| ( alsa oss pulseaudio nullout )"
90

  
91
PDEPEND="media-plugins/deadbeef-plugins-meta:0"
92

  
93
RDEPEND="dev-libs/glib:2
94
	aac? ( media-libs/faad2:0 )
95
	adplug? ( media-libs/adplug:0 )
96
	alsa? ( media-libs/alsa-lib:0 )
97
	alac? ( media-libs/faad2:0 )
98
	cdda? ( dev-libs/libcdio:0=
99
		media-libs/libcddb:0 )
100
	cdparanoia? ( dev-libs/libcdio-paranoia:0 )
101
	cover? ( cover-imlib2? ( media-libs/imlib2:0 )
102
		media-libs/libpng:0=
103
		virtual/jpeg:0
104
		x11-libs/gdk-pixbuf:2[jpeg] )
105
	curl? ( net-misc/curl:0 )
106
	ffmpeg? ( media-video/ffmpeg:0= )
107
	libav? ( media-video/libav:0= )
108
	flac? ( media-libs/flac:0 )
109
	gme? ( sys-libs/zlib:0 )
110
	gtk2? ( dev-libs/atk:0
111
		dev-libs/jansson:0
112
		x11-libs/cairo:0
113
		x11-libs/gtk+:2
114
		x11-libs/pango:0 )
115
	gtk3? ( dev-libs/jansson:0
116
		x11-libs/gtk+:3 )
117
	hotkeys? ( x11-libs/libX11:0 )
118
	libnotify? ( sys-apps/dbus:0 )
119
	libsamplerate? ( media-libs/libsamplerate:0 )
120
	mad? ( media-libs/libmad:0 )
121
	midi? ( media-sound/timidity-freepats:0 )
122
	mpg123? ( media-sound/mpg123:0 )
123
	opus? ( media-libs/opusfile:0 )
124
	psf? ( sys-libs/zlib:0 )
125
	pulseaudio? ( media-sound/pulseaudio:0 )
126
	sndfile? ( media-libs/libsndfile:0 )
127
	vorbis? ( media-libs/libogg:0
128
		media-libs/libvorbis:0 )
129
	wavpack? ( media-sound/wavpack:0 )
130
	zip? ( dev-libs/libzip:0 )"
131

  
132
DEPEND="${RDEPEND}
133
	virtual/pkgconfig:0
134
	nls? ( dev-util/intltool:0
135
		virtual/libintl:0 )
136
	mac? ( x86? ( dev-lang/yasm:0 )
137
		amd64? ( dev-lang/yasm:0 ) )"
81 138

  
82 139
src_prepare() {
83
	default
140
	if ! use_if_iuse linguas_ru ; then
141
		eapply "${FILESDIR}/${P}-remove-ru-help-translation.patch"
142
		rm -v "${S}/translation/help.ru.txt" || die
143
	fi
144

  
145
	if use midi ; then
146
		# set default gentoo path
147
		sed -e 's;/etc/timidity++/timidity-freepats.cfg;/usr/share/timidity/freepats/timidity.cfg;g' \
148
			-i "${S}/plugins/wildmidi/wildmidiplug.c" || die
149
	fi
84 150

  
85
	drop_from_linguas() {
86
		sed "/${1}/d" -i "${S}/po/LINGUAS" || die
87
	}
88

  
89
	drop_and_stub() {
90
		einfo drop_and_stub "${1}"
91
		rm -r "${1}" || die
92
		mkdir "${1}" || die
93
		cat > "${1}/Makefile.in" <<-EOF || die
94
			all: nothing
95
			install: nothing
96
			nothing:
97
		EOF
98
	}
151
	if ! use unity ; then
152
		# remove unity trash
153
		eapply "${FILESDIR}/${P}-remove-unity-trash.patch"
154
	fi
99 155

  
100
	plocale_for_each_disabled_locale drop_from_linguas || die
156
	eapply_user
101 157

  
102
	eautopoint --force
158
	config_rpath_update "${S}/config.rpath"
103 159
	eautoreconf
160
}
104 161

  
105
	# Get rid of bundled gettext. (Avoid build failures with musl)
106
	drop_and_stub "${S}/intl"
162
src_configure() {
163
	if use ffmpeg && ! use libav ; then
164
		ffmpeg_configure="$(use_enable ffmpeg)"
165
	elif use libav && ! use ffmpeg ; then
166
		ffmpeg_configure="$(use_enable libav ffmpeg)"
167
	fi
107 168

  
108
	# Plugins that are undesired for whatever reason, candidates for unbundling and such.
109
	for i in adplug alac dumb ffap mms gme mono2stereo psf shn sid soundtouch wma; do
110
		drop_and_stub "${S}/plugins/${i}"
111
	done
169
	econf --disable-coreaudio \
170
		--disable-portable \
171
		--disable-static \
172
		--docdir=/usr/share/${PN} \
173
		"${ffmpeg_configure}" \
174
		$(use_enable aac) \
175
		$(use_enable adplug) \
176
		$(use_enable alac) \
177
		$(use_enable alsa) \
178
		$(use_enable cdda) \
179
		$(use_enable cdparanoia cdda-paranoia) \
180
		$(use_enable converter) \
181
		$(use_enable cover artwork) \
182
		$(use_enable cover-imlib2 artwork-imlib2) \
183
		$(use_enable cover-network artwork-network) \
184
		$(use_enable curl vfs-curl) \
185
		$(use_enable dts dca) \
186
		$(use_enable dumb) \
187
		$(use_enable equalizer supereq) \
188
		$(use_enable flac) \
189
		$(use_enable gme) \
190
		$(use_enable gtk2) \
191
		$(use_enable gtk3) \
192
		$(use_enable hotkeys) \
193
		$(use_enable lastfm lfm) \
194
		$(use_enable libnotify notify) \
195
		$(use_enable libsamplerate src) \
196
		$(use_enable m3u) \
197
		$(use_enable mac ffap) \
198
		$(use_enable mad libmad) \
199
		$(use_enable midi wildmidi) \
200
		$(use_enable mms) \
201
		$(use_enable mono2stereo) \
202
		$(use_enable mpg123 libmpg123) \
203
		$(use_enable musepack) \
204
		$(use_enable nls) \
205
		$(use_enable nullout) \
206
		$(use_enable opus) \
207
		$(use_enable oss) \
208
		$(use_enable playlist-browser pltbrowser) \
209
		$(use_enable psf) \
210
		$(use_enable pulseaudio pulse) \
211
		$(use_enable replaygain-scanner rgscanner) \
212
		$(use_enable sc68) \
213
		$(use_enable shell-exec shellexecui) \
214
		$(use_enable shn) \
215
		$(use_enable sid) \
216
		$(use_enable sndfile) \
217
		$(use_enable tta) \
218
		$(use_enable vorbis) \
219
		$(use_enable vtx) \
220
		$(use_enable wavpack) \
221
		$(use_enable wma) \
222
		$(use_enable zip vfs-zip)
112 223
}
113 224

  
114
src_configure () {
115
	if ! tc-is-clang; then
116
		AR=llvm-ar
117
		CC=${CHOST}-clang
118
		CXX=${CHOST}-clang++
119
		NM=llvm-nm
120
		RANLIB=llvm-ranlib
121

  
122
		strip-unsupported-flags
123
	fi
124

  
125
	export HOST_CC="$(tc-getBUILD_CC)"
126
	export HOST_CXX="$(tc-getBUILD_CXX)"
127
	tc-export CC CXX LD AR NM OBJDUMP RANLIB PKG_CONFIG
128

  
129
	local myconf=(
130
		"--disable-staticlink"
131
		"--disable-portable"
132
		"--disable-rpath"
133

  
134
		"--disable-adplug"
135
		"--disable-alac"
136
		"--disable-coreaudio"
137
		"--disable-dumb"
138
		"--disable-ffap"
139
		"--disable-gme"
140
		"--disable-gtk2"
141
		"--disable-libmad"
142
		"--disable-mms"
143
		"--disable-mono2stereo"
144
		"--disable-psf"
145
		"--disable-shn"
146
		"--disable-sid"
147
		"--disable-sndfile"
148
		"--disable-soundtouch"
149
		"--disable-tta"
150
		"--disable-vtx"
151
		"--disable-wildmidi"
152
		"--disable-wma"
153

  
154
		"$(use_enable alsa)"
155
		"$(use_enable oss)"
156
		"$(use_enable pulseaudio pulse)"
157
		"$(use_enable mp3)"
158
		"$(use_enable mp3 libmpg123)"
159
		"$(use_enable nls)"
160
		"$(use_enable vorbis)"
161
		"$(use_enable flac)"
162
		"$(use_enable supereq)"
163
		"$(use_enable cdda)"
164
		"$(use_enable cdda cdda-paranoia)"
165
		"$(use_enable aac)"
166
		"$(use_enable cover artwork)"
167
		"$(use_enable cover artwork-network)"
168
		"$(use_enable dts dca)"
169
		"$(use_enable ffmpeg)"
170
		"$(use_enable converter)"
171
		"$(use_enable musepack)"
172
		"$(use_enable notify)"
173
		"$(use_enable nullout)"
174
		"$(use_enable opus)"
175
		"$(use_enable pulseaudio pulse)"
176
		"$(use_enable pipewire)"
177
		"$(use_enable sc68)"
178
		"$(use_enable shellexec)"
179
		"$(use_enable shellexec shellexecui)"
180
		"$(use_enable lastfm lfm)"
181
		"$(use_enable libretro)"
182
		"$(use_enable libsamplerate src)"
183
		"$(use_enable wavpack)"
184
		"$(use_enable zip vfs-zip)"
185

  
186
		"--enable-gtk3"
187
		"--enable-m3u"
188
		"--enable-medialib"
189
		"--enable-pltbrowser"
190
		"--enable-rgscanner"
191
		"--enable-shared"
192
		"--enable-vfs-curl"
193
	)
194

  
195
	econf "${myconf[@]}"
225
pkg_preinst() {
226
	if use gtk2 || use gtk3 ; then
227
		gnome2_icon_savelist
228
	fi
196 229
}
197 230

  
198
src_install() {
199
	default
231
pkg_postinst() {
232
	xdg_desktop_database_update
233
	xdg_mimeinfo_database_update
200 234

  
201
	find "${ED}" -name '*.la' -delete || die
235
	if use gtk2 || use gtk3 ; then
236
		gnome2_icon_cache_update
237
	fi
238
}
202 239

  
203
	# if compressed, help doesn't work
204
	docompress -x /usr/share/doc/${PF}
240
pkg_postrm() {
241
	xdg_desktop_database_update
242
	xdg_mimeinfo_database_update
243

  
244
	if use gtk2 || use gtk3 ; then
245
		gnome2_icon_cache_update
246
	fi
205 247
}
Thank you!