blob: 5af3dce489628b5a1df0cec8c5827f7fd021f7d1 (
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
|
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake-multilib
DESCRIPTION="Simple Direct Media Layer Mixer Library"
HOMEPAGE="https://github.com/libsdl-org/SDL_mixer"
# Upstream use release- and prerelease- prefixed tags.
GIT_TAG=release-${PV}
if [[ ${PV} == *_rc* ]]; then
GIT_TAG=prerelease-${PV%%_rc*}
fi
SRC_URI="https://github.com/libsdl-org/SDL_mixer/archive/refs/tags/${GIT_TAG}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/SDL_mixer-${GIT_TAG}"
LICENSE="ZLIB"
SLOT="0"
KEYWORDS="~amd64 ~arm64"
IUSE="drlibs flac fluidsynth gme midi mod modplug mp3 opus playtools"
IUSE+=" +libvorbis timidity tremor +vorbis +wav wavpack xmp"
REQUIRED_USE="
drlibs? ( || ( flac mp3 ) )
midi? ( || ( timidity fluidsynth ) )
fluidsynth? ( midi )
timidity? ( midi )
vorbis? ( ^^ ( libvorbis tremor ) )
libvorbis? ( vorbis )
tremor? ( vorbis )
"
RDEPEND="
media-libs/libsdl3[${MULTILIB_USEDEP}]
!drlibs? (
flac? ( media-libs/flac:=[${MULTILIB_USEDEP}] )
mp3? ( media-sound/mpg123-base[${MULTILIB_USEDEP}] )
)
gme? ( media-libs/game-music-emu[${MULTILIB_USEDEP}] )
midi? (
fluidsynth? ( media-sound/fluidsynth:=[${MULTILIB_USEDEP}] )
timidity? ( media-sound/timidity++ )
)
mod? ( media-libs/libxmp[${MULTILIB_USEDEP}] )
opus? ( media-libs/opusfile[${MULTILIB_USEDEP}] )
playtools? (
!media-libs/sdl-mixer[playtools]
!media-libs/sdl2-mixer[playtools]
)
libvorbis? ( media-libs/libvorbis[${MULTILIB_USEDEP}] )
tremor? ( media-libs/tremor[${MULTILIB_USEDEP}] )
gme? ( media-libs/game-music-emu[${MULTILIB_USEDEP}] )
wavpack? ( media-sound/wavpack[${MULTILIB_USEDEP}] )
"
DEPEND="${RDEPEND}"
multilib_src_configure() {
local mycmakeargs=(
-DSDLMIXER_DEPS_SHARED=no # aka, no dlopen() (bug #950965)
-DSDLMIXER_FLAC=$(usex flac)
-DSDLMIXER_FLAC_LIBFLAC=$(usex flac $(usex drlibs no yes) no)
-DSDLMIXER_FLAC_DRFLAC=$(usex drlibs)
-DSDLMIXER_GME=$(usex gme)
-DSDLMIXER_GME_SHARED=no
-DSDLMIXER_INSTALL_MAN=yes
-DSDLMIXER_MIDI=$(usex midi)
-DSDLMIXER_MIDI_FLUIDSYNTH=$(usex fluidsynth)
-DSDLMIXER_MIDI_FLUIDSYNTH_SHARED=no
-DSDLMIXER_MIDI_TIMIDITY=$(usex timidity)
-DSDLMIXER_MOD=$(usex mod)
-DSDLMIXER_MOD_XMP=$(usex mod)
-DSDLMIXER_MOD_XMP_LITE=no
-DSDLMIXER_MOD_XMP_SHARED=no
-DSDLMIXER_MP3=$(usex mp3)
-DSDLMIXER_MP3_DRMP3=$(usex drlibs)
-DSDLMIXER_MP3_MPG123=$(usex mp3 $(usex drlibs no yes) no)
-DSDLMIXER_OPUS=$(usex opus)
-DSDLMIXER_OPUS_SHARED=no
-DSDLMIXER_STRICT=yes # Fail when a dependency could not be found
-DSDLMIXER_VENDORED=no # Use vendored third-party libraries
-DSDLMIXER_VORBIS_STB=no # Only available vendored, as per SDL_mixer#434 distros should prefer an external lib
-DSDLMIXER_VORBIS_VORBISFILE=$(usex vorbis $(usex libvorbis) no)
-DSDLMIXER_VORBIS_TREMOR=$(usex vorbis $(usex tremor) no)
-DSDLMIXER_WAVE=$(usex wav)
-DSDLMIXER_WAVPACK=$(usex wavpack)
-DSDLMIXER_WAVPACK_DSD=$(usex wavpack) # seems to be default-enabled in wavpack
)
cmake_src_configure
}
multilib_src_install_all() {
rm -r "${ED}"/usr/share/licenses || die
}
# There are no automated tests included with SDL_mixer.
# Theoretically we could use `-DSLDMIXER_TESTS{,_INSTALL}=yes` to build and install test binaries
# However they're not particularly useful standalone - runtime testing will have to do.
src_test() {
:
}
pkg_postinst() {
# bug #412035
if use midi && use fluidsynth; then
ewarn "FluidSynth support requires you to set the SDL_SOUNDFONTS"
ewarn "environment variable to the location of a SoundFont file"
ewarn "unless the game or application happens to do this for you."
if use timidity; then
ewarn "Failing to do so will result in Timidity being used instead."
else
ewarn "Failing to do so will result in silence."
fi
fi
}
|