2022-03-30 09:31:56 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
|
|
|
, SDL2
|
|
|
|
, flac
|
|
|
|
, libmikmod
|
|
|
|
, libvorbis
|
|
|
|
, timidity
|
2024-06-20 14:57:18 +00:00
|
|
|
, darwin
|
2022-03-30 09:31:56 +00:00
|
|
|
}:
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
let
|
|
|
|
inherit (darwin.apple_sdk.frameworks)
|
|
|
|
AudioToolbox
|
|
|
|
CoreAudio
|
|
|
|
;
|
|
|
|
in
|
2022-03-30 09:31:56 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "SDL2_sound";
|
|
|
|
version = "2.0.1";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "icculus";
|
|
|
|
repo = "SDL_sound";
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-N2znqy58tMHgYa07vEsSedWLRhoJzDoINcsUu0UYLnA=";
|
2022-03-30 09:31:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# https://github.com/icculus/SDL_sound/pull/32 - fix build on darwin
|
|
|
|
# can be dropped on the next update
|
|
|
|
url = "https://github.com/icculus/SDL_sound/commit/c15d75b7720113b28639baad284f45f943846294.patch";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-4GL8unsZ7eNkzjLXq9QdaxFQMzX2tdP0cBR1jTaRLc0=";
|
2022-03-30 09:31:56 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
cmakeFlags = [ "-DSDLSOUND_DECODER_MIDI=1" ];
|
|
|
|
|
|
|
|
buildInputs = [ SDL2 flac libmikmod libvorbis timidity ]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ AudioToolbox CoreAudio ];
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "SDL2 sound library";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "playsound";
|
2022-03-30 09:31:56 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.zlib;
|
|
|
|
homepage = "https://www.icculus.org/SDL_sound/";
|
|
|
|
};
|
|
|
|
}
|