1{
2 lib,
3 stdenv,
4 fetchurl,
5 SDL,
6 SDL_image,
7 SDL_mixer,
8}:
9
10stdenv.mkDerivation rec {
11 pname = "teeter-torture";
12 version = "2005-10-18";
13 src = fetchurl {
14 url = "ftp://ftp.tuxpaint.org/unix/x/teetertorture/source/teetertorture-${version}.tar.gz";
15 sha256 = "175gdbkx3m82icyzvwpyzs4v2fd69c695k5n8ca0lnjv81wnw2hr";
16 };
17
18 buildInputs = [
19 SDL
20 SDL_image
21 SDL_mixer
22 ];
23
24 configurePhase = ''
25 runHook preConfigure
26
27 sed -i s,data/,$out/share/teetertorture/, src/teetertorture.c
28
29 runHook postConfigure
30 '';
31
32 patchPhase = ''
33 sed -i '/free(home)/d' src/teetertorture.c
34 '';
35
36 installPhase = ''
37 mkdir -p $out/bin $out/share/teetertorture
38 cp teetertorture $out/bin
39 cp -R data/* $out/share/teetertorture
40 '';
41
42 meta = {
43 homepage = "http://www.newbreedsoftware.com/teetertorture/";
44 description = "Simple shooting game with your cannon is sitting atop a teeter totter";
45 license = lib.licenses.gpl2Plus;
46 inherit (SDL.meta) platforms;
47 mainProgram = "teetertorture";
48 };
49}