fluffychat: 1.22.1 -> 1.23.0 (#364091)
[NixPkgs.git] / pkgs / by-name / to / torus-trooper / package.nix
blobf3a98d48e04fcc5b1b1a72099cd0e57977a214b7
2   lib,
3   stdenv,
4   fetchpatch,
5   fetchurl,
6   unzip,
7   gdc,
8   SDL,
9   SDL_mixer,
10   bulletml,
13 let
14   debianPatch =
15     patchname: hash:
16     fetchpatch {
17       name = "${patchname}.patch";
18       url = "https://sources.debian.org/data/main/t/torus-trooper/0.22.dfsg1-12/debian/patches/${patchname}.patch";
19       sha256 = hash;
20     };
23 stdenv.mkDerivation (finalAttrs: {
24   pname = "torus-trooper";
25   version = "0.22";
27   src = fetchurl {
28     url = "http://abagames.sakura.ne.jp/windows/tt${
29       lib.replaceStrings [ "." ] [ "_" ] finalAttrs.version
30     }.zip";
31     sha256 = "1yhki1fdp3fi4y2iq12vca69f6k38dqjaw9z4lwcxky5kbgb7jvg";
32   };
34   patches = [
35     (debianPatch "imports" "0mifw0mj66zljpq6iqnh0rhkgs2sky8rz0p32k98vxfnsb39ibsf")
36     (debianPatch "fixes" "05f93zq2v14lymq748c9g646ckbh9mqpr5rrahb63s90x8hlcqil")
37     (debianPatch "directories" "0y5xvf26v9fk0rx6ncrxx4czckhjbi891hp3pixlmv568pg9cihd")
38     (debianPatch "windowed" "1d8ghj4shvpb0s8l16kscz4l7rz1fxmfdpddy1ikz3678pw1sc8p")
39     (debianPatch "dotfile" "17yirmnjhbd1clzhmdd2mfdhbxkyinaahd6v3yz5kzbcylvjz2r2")
40     (debianPatch "window-resizing" "1n64gbhabl6vis7s294wxlj2k8s3ypxljpdg71icwz1m9jjx59df")
41     (debianPatch "save-score-444372" "1skny6s3hjxkh8w4fq86vp51j7z40fvn80b8myl4i1zzlwag3x17")
42     (debianPatch "level-select-444948" "008248s55188plggg2kg01nimjgc7w0sqd3c22sl6lzd1fjsflv8")
43     (debianPatch "avoid-segfault-when-sdl-fails" "1yp758gi4i15gqk6wiqp815rqcmlyqx62ir1sw20hn6zb3j97bmc")
44     (debianPatch "dlang_v2" "1lxsbckhvl8a8j43pw2dyl5nlavvdbgxb5zlb2450a0vml55nswd")
45     (debianPatch "lowest-level-position-602808" "19r48wirc9zssjmv57drn2fd0f56dcgyqqaz3j49cvv6yd74qf20")
46     (debianPatch "libbulletml0v5-segfault" "0pad2daz60hswkhkdpssxaqc9p9ca0sw1nraqzr453x0zdwwq0hn")
47     (debianPatch "std.math.fabs" "18xnnqlj20bxv2h9fa8dn4rmxwi3k6y3g50kwvh8i8p3b4hgag3r")
48     (debianPatch "gdc-8" "10z702y75c48hjcnvv8m7f3ka52cj3r3jqafdbby85nb0p2lbssx")
49   ];
51   postPatch = ''
52     for f in src/abagames/tt/barrage.d src/abagames/util/sdl/sound.d src/abagames/util/sdl/texture.d; do
53       substituteInPlace $f \
54         --replace "/usr/" "$out/"
55     done
56   '';
58   nativeBuildInputs = [
59     unzip
60     gdc
61   ];
63   buildInputs = [
64     SDL
65     SDL_mixer
66     bulletml
67   ];
69   installPhase = ''
70     install -Dm755 torus-trooper $out/bin/torus-trooper
71     mkdir -p $out/share/games/torus-trooper
72     cp -r barrage sounds images $out/share/games/torus-trooper/
73   '';
75   meta = with lib; {
76     homepage = "http://www.asahi-net.or.jp/~cs8k-cyu/windows/tt_e.html";
77     description = "Fast-paced abstract scrolling shooter game";
78     mainProgram = "torus-trooper";
79     license = licenses.bsd2;
80     maintainers = with maintainers; [ fgaz ];
81     platforms = platforms.all;
82   };