2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv
|
2020-11-28 09:13:19 +00:00
|
|
|
, fetchurl
|
|
|
|
, pkg-config
|
|
|
|
, AudioToolbox
|
|
|
|
, AudioUnit
|
|
|
|
, CoreServices
|
|
|
|
, SDL2
|
|
|
|
, flac
|
|
|
|
, fluidsynth
|
|
|
|
, libmodplug
|
|
|
|
, libogg
|
|
|
|
, libvorbis
|
|
|
|
, mpg123
|
|
|
|
, opusfile
|
|
|
|
, smpeg2
|
2021-09-05 13:50:20 +00:00
|
|
|
, timidity
|
2020-11-28 09:13:19 +00:00
|
|
|
}:
|
2013-07-04 17:59:43 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "SDL2_mixer";
|
2018-11-08 21:39:47 +00:00
|
|
|
version = "2.0.4";
|
2013-07-04 17:59:43 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "https://www.libsdl.org/projects/SDL_mixer/release/${pname}-${version}.tar.gz";
|
2018-11-08 21:39:47 +00:00
|
|
|
sha256 = "0694vsz5bjkcdgfdra6x9fq8vpzrl8m6q96gh58df7065hw5mkxl";
|
2013-07-04 17:59:43 +00:00
|
|
|
};
|
|
|
|
|
2020-11-28 09:13:19 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-10-26 01:20:29 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
2020-11-28 09:13:19 +00:00
|
|
|
AudioToolbox
|
|
|
|
AudioUnit
|
|
|
|
CoreServices
|
|
|
|
];
|
2017-08-26 21:54:37 +00:00
|
|
|
|
2020-11-28 09:13:19 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
SDL2
|
|
|
|
flac
|
|
|
|
fluidsynth
|
|
|
|
libmodplug
|
|
|
|
libogg
|
|
|
|
libvorbis
|
|
|
|
mpg123
|
|
|
|
opusfile
|
|
|
|
smpeg2
|
2021-09-05 13:50:20 +00:00
|
|
|
# MIDI patterns
|
|
|
|
timidity
|
2020-11-28 09:13:19 +00:00
|
|
|
];
|
2018-01-20 15:26:21 +00:00
|
|
|
|
2021-09-05 13:50:20 +00:00
|
|
|
# fix default path to timidity.cfg so MIDI files could be played
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace timidity/options.h \
|
|
|
|
--replace "/usr/share/timidity" "${timidity}/share/timidity"
|
|
|
|
'';
|
|
|
|
|
2020-11-28 09:13:19 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--disable-music-ogg-shared"
|
|
|
|
"--disable-music-flac-shared"
|
|
|
|
"--disable-music-mod-modplug-shared"
|
|
|
|
"--disable-music-mp3-mpg123-shared"
|
|
|
|
"--disable-music-opus-shared"
|
|
|
|
"--disable-music-midi-fluidsynth-shared"
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2020-11-28 09:13:19 +00:00
|
|
|
"--disable-sdltest"
|
|
|
|
"--disable-smpegtest"
|
|
|
|
];
|
2013-07-04 17:59:43 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2013-07-04 17:59:43 +00:00
|
|
|
description = "SDL multi-channel audio mixer library";
|
2018-01-20 15:26:21 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.libsdl.org/projects/SDL_mixer/";
|
2017-03-08 12:45:22 +00:00
|
|
|
maintainers = with maintainers; [ MP2E ];
|
2016-08-22 03:24:32 +00:00
|
|
|
license = licenses.zlib;
|
2013-07-04 17:59:43 +00:00
|
|
|
};
|
|
|
|
}
|