summary refs log tree commit diff
path: root/pkgs/applications/audio/sfxr/default.nix
blob: aed27ecdba5ed504faa838da198702342adf9d04 (plain) (blame)
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
{ lib, stdenv
, fetchurl
, pkg-config
, desktop-file-utils
, SDL
, gtk3
, gsettings-desktop-schemas
, wrapGAppsHook
}:

stdenv.mkDerivation rec {
  pname = "sfxr";
  version = "1.2.1";

  src = fetchurl {
    url = "http://www.drpetter.se/files/sfxr-sdl-${version}.tar.gz";
    sha256 = "0dfqgid6wzzyyhc0ha94prxax59wx79hqr25r6if6by9cj4vx4ya";
  };

  postPatch = ''
    substituteInPlace Makefile --replace "usr/" ""
    substituteInPlace sdlkit.h --replace \
      "/usr/share/sfxr/sfxr.bmp" \
      "$out/share/sfxr/sfxr.bmp"
    substituteInPlace main.cpp \
      --replace \
      "/usr/share/sfxr/font.tga" \
      "$out/share/sfxr/font.tga" \
      --replace \
      "/usr/share/sfxr/ld48.tga" \
      "$out/share/sfxr/ld48.tga"
  '';

  nativeBuildInputs = [
    pkg-config
    desktop-file-utils
  ];

  buildInputs = [
    SDL
    gtk3
    gsettings-desktop-schemas
    wrapGAppsHook
  ];

  makeFlags = [ "DESTDIR=$(out)" ];

  meta = with lib; {
    homepage = "http://www.drpetter.se/project_sfxr.html";
    description = "A videogame sound effect generator";
    license = licenses.mit;
    maintainers = with maintainers; [ fgaz ];
    platforms = platforms.unix;
  };
}