pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / games / tumiki-fighters / default.nix
blob0049412b0e6cdfc206f0cefd59080733833e5d46
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/tumiki-fighters/0.2.dfsg1-9/debian/patches/${patchname}.patch";
16   sha256 = hash;
19 in stdenv.mkDerivation (finalAttrs: {
20   pname = "tumiki-fighters";
21   version = "0.21";
23   src = fetchurl {
24     url = "http://abagames.sakura.ne.jp/windows/tf${lib.replaceStrings ["."] ["_"] finalAttrs.version}.zip";
25     sha256 = "0djykfc1r8ysapklm621h89ana1c4qzc1m5nr9bqw4iccnmvwk3p";
26   };
28   patches = [
29     (debianPatch
30       "imports"
31       "1l3kc67b43gdi139cpz5cka1nkn0pjp9mrgrrxlmr0liwx2aryhn")
32     (debianPatch
33       "fixes"
34       "1iy1a5vii6yz9zdlk2bcj6gkj4y25hn9y2fczz15jpqd9r2zm603")
35     (debianPatch
36       "directories"
37       "0kmv0s7jgr693fzrkjsmz4dnicc4w7njanxm2la3cf4vmgdyipmm")
38     (debianPatch
39       "windowed"
40       "1wp74l0bi8wq85pcxnmkwrlfmlf09im95n27pxgz082lhwf2ksy1")
41     (debianPatch
42       "dotfile"
43       "0d8x519bclh41j992qn6ijzfcrgacb79px6zjd1awypkwyc0j2p6")
44     (debianPatch
45       "makefile"
46       "11xf2b31kjyps53jfryv82dv0g6q0smc9xgp8imrbr93mzi51vf0")
47     (debianPatch
48       "window-resizing"
49       "1dm79d0yisa8zs5fr89y3wq2kzd3khcaxs0la8lhncvkqbd4smx8")
50     (debianPatch
51       "dlang_v2"
52       "1isnvbl3bjnpyphji8k3fl0yd1z4869h0lai143vpwgj6518lpg4")
53     (debianPatch
54       "gdc-8"
55       "1md0zwmv50jnak5g9d93bglv9v4z41blinjii6kv3vmgjnajapzj")
56   ];
58   postPatch = ''
59     for f in \
60       src/abagames/tf/barragemanager.d \
61       src/abagames/util/sdl/sound.d \
62       src/abagames/util/sdl/texture.d \
63       src/abagames/tf/enemyspec.d \
64       src/abagames/tf/field.d \
65       src/abagames/tf/stagemanager.d \
66       src/abagames/tf/tumikiset.d
67     do
68       substituteInPlace $f \
69         --replace "/usr/" "$out/"
70     done
71   '';
73   nativeBuildInputs = [
74     unzip
75     gdc
76   ];
78   buildInputs = [
79     SDL
80     SDL_mixer
81     bulletml
82   ];
84   installPhase = ''
85     install -Dm755 tumiki-fighters $out/bin/tumiki-fighters
86     mkdir -p $out/share/games/tumiki-fighters
87     cp -r barrage sounds enemy field stage tumiki $out/share/games/tumiki-fighters/
88   '';
90   meta = with lib; {
91     homepage = "http://www.asahi-net.or.jp/~cs8k-cyu/windows/tf_e.html";
92     description = "Sticky 2D shooter";
93     mainProgram = "tumiki-fighters";
94     license = licenses.bsd2;
95     maintainers = with maintainers; [ fgaz ];
96     platforms = platforms.all;
97   };