evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / sd / SDL2_sound / package.nix
blob46517c42cb32bb3d92d383ce7b50b96bedf77754
1 { stdenv
2 , lib
3 , fetchFromGitHub
4 , fetchpatch
5 , cmake
6 , SDL2
7 , flac
8 , libmikmod
9 , libvorbis
10 , timidity
11 , darwin
14 let
15   inherit (darwin.apple_sdk.frameworks)
16     AudioToolbox
17     CoreAudio
18   ;
20 stdenv.mkDerivation rec {
21   pname = "SDL2_sound";
22   version = "2.0.1";
24   src = fetchFromGitHub {
25     owner = "icculus";
26     repo = "SDL_sound";
27     rev = "v${version}";
28     hash = "sha256-N2znqy58tMHgYa07vEsSedWLRhoJzDoINcsUu0UYLnA=";
29   };
31   patches = [
32     (fetchpatch {
33       # https://github.com/icculus/SDL_sound/pull/32 - fix build on darwin
34       # can be dropped on the next update
35       url = "https://github.com/icculus/SDL_sound/commit/c15d75b7720113b28639baad284f45f943846294.patch";
36       hash = "sha256-4GL8unsZ7eNkzjLXq9QdaxFQMzX2tdP0cBR1jTaRLc0=";
37     })
38   ];
40   nativeBuildInputs = [ cmake ];
42   cmakeFlags = [ "-DSDLSOUND_DECODER_MIDI=1" ];
44   buildInputs = [ SDL2 flac libmikmod libvorbis timidity ]
45     ++ lib.optionals stdenv.hostPlatform.isDarwin [ AudioToolbox CoreAudio ];
47   meta = with lib; {
48     description = "SDL2 sound library";
49     mainProgram = "playsound";
50     platforms = platforms.unix;
51     license = licenses.zlib;
52     homepage = "https://www.icculus.org/SDL_sound/";
53   };