Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / games / titanion / default.nix
blob47db68aa483ed62424d80022f7ff1a9de08f3126
1 { lib
2 , stdenv
3 , fetchpatch
4 , fetchurl
5 , unzip
6 , gdc
7 , SDL
8 , SDL_mixer
9 , bulletml
12 let
13 debianPatch = patchname: hash: fetchpatch {
14   name = "${patchname}.patch";
15   url = "https://sources.debian.org/data/main/t/titanion/0.3.dfsg1-7/debian/patches/${patchname}";
16   sha256 = hash;
19 in stdenv.mkDerivation rec {
20   pname = "titanion";
21   version = "0.3";
23   src = fetchurl {
24     url = "http://abagames.sakura.ne.jp/windows/ttn${lib.replaceStrings ["."] ["_"] version}.zip";
25     sha256 = "sha256-fR0cufi6dU898wP8KGl/vxbfQJzMmMxlYZ3QNGLajfM=";
26   };
28   patches = [
29     (debianPatch
30       "imports.patch"
31       "sha256-kSXpaTpYq6w9e0yLES2QGNQ8+vFIiOpw2P9MA8gZr8s=")
32     (debianPatch
33       "fix.diff"
34       "sha256-0WkkfuhJaAMY46VVyc3ldMQwgOVoQJDw/8zbm6H2sHU=")
35     (debianPatch
36       "directories.patch"
37       "sha256-fhQJuy2+r0YOQNwMqG85Gr7fJehmf00Scran+NPYQrw=")
38     (debianPatch
39       "windowed.patch"
40       "sha256-xouXIuIKfKFGsoOEJqL9jdsdnkX4nqwPGcoB+32Wvgo=")
41     (debianPatch
42       "dotfile.patch"
43       "sha256-sAml53Hh0ltbqN8xZDZuUJcaPfjK56jf4ymFXYD38v0=")
44     (debianPatch
45       "window-resize.patch"
46       "sha256-WwAi1aU4CmaX+O8fw0TfLhNSXFaObExrn7nuhesVkKM=")
47     (debianPatch
48       "makefile.patch"
49       "sha256-g0jDPmc0SWXkTLhiczeTse/WGCtgMUsbyPNZzwK3U+o=")
50     (debianPatch
51       "dlang_v2.patch"
52       "sha256-tfTAAKlPFSjbfAK1EjeB3unj9tbMlNaajJ+VVSMMiYw=")
53     (debianPatch
54       "gdc-8.patch"
55       "sha256-BxkPfSEymq7TDA+yjJHaYsjtGr0Tuu1/sWLwRBAMga4=")
56   ];
58   postPatch = ''
59     rm *.dll ttn.exe
60     rm -r lib
61     for f in src/abagames/ttn/screen.d src/abagames/util/sdl/sound.d src/abagames/util/sdl/texture.d; do
62       substituteInPlace $f \
63         --replace "/usr/" "$out/"
64     done
65   '';
67   nativeBuildInputs = [
68     unzip
69     gdc
70   ];
72   buildInputs = [
73     SDL
74     SDL_mixer
75     bulletml
76   ];
78   installPhase = ''
79     install -Dm755 titanion $out/bin/titanion
80     mkdir -p $out/share/games/titanion
81     cp -r sounds images $out/share/games/titanion/
82   '';
84   meta = with lib; {
85     homepage = "http://www.asahi-net.or.jp/~cs8k-cyu/windows/ttn_e.html";
86     description = "Strike down super high-velocity swooping insects";
87     license = licenses.bsd2;
88     maintainers = with maintainers; [ fgaz ];
89     platforms = platforms.all;
90   };