bitwarden-desktop: 2024.12.1 -> 2025.1.1 (#374021)
[NixPkgs.git] / pkgs / by-name / ti / titanion / package.nix
blob2235d32c5148399a1048d4195bad4b8752f528f3
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/titanion/0.3.dfsg1-7/debian/patches/${patchname}";
19       sha256 = hash;
20     };
23 stdenv.mkDerivation (finalAttrs: {
24   pname = "titanion";
25   version = "0.3";
27   src = fetchurl {
28     url = "http://abagames.sakura.ne.jp/windows/ttn${
29       lib.replaceStrings [ "." ] [ "_" ] finalAttrs.version
30     }.zip";
31     sha256 = "sha256-fR0cufi6dU898wP8KGl/vxbfQJzMmMxlYZ3QNGLajfM=";
32   };
34   patches = [
35     (debianPatch "imports.patch" "sha256-kSXpaTpYq6w9e0yLES2QGNQ8+vFIiOpw2P9MA8gZr8s=")
36     (debianPatch "fix.diff" "sha256-0WkkfuhJaAMY46VVyc3ldMQwgOVoQJDw/8zbm6H2sHU=")
37     (debianPatch "directories.patch" "sha256-fhQJuy2+r0YOQNwMqG85Gr7fJehmf00Scran+NPYQrw=")
38     (debianPatch "windowed.patch" "sha256-xouXIuIKfKFGsoOEJqL9jdsdnkX4nqwPGcoB+32Wvgo=")
39     (debianPatch "dotfile.patch" "sha256-sAml53Hh0ltbqN8xZDZuUJcaPfjK56jf4ymFXYD38v0=")
40     (debianPatch "window-resize.patch" "sha256-WwAi1aU4CmaX+O8fw0TfLhNSXFaObExrn7nuhesVkKM=")
41     (debianPatch "makefile.patch" "sha256-g0jDPmc0SWXkTLhiczeTse/WGCtgMUsbyPNZzwK3U+o=")
42     (debianPatch "dlang_v2.patch" "sha256-tfTAAKlPFSjbfAK1EjeB3unj9tbMlNaajJ+VVSMMiYw=")
43     (debianPatch "gdc-8.patch" "sha256-BxkPfSEymq7TDA+yjJHaYsjtGr0Tuu1/sWLwRBAMga4=")
44   ];
46   postPatch = ''
47     rm *.dll ttn.exe
48     rm -r lib
49     for f in src/abagames/ttn/screen.d src/abagames/util/sdl/sound.d src/abagames/util/sdl/texture.d; do
50       substituteInPlace $f \
51         --replace "/usr/" "$out/"
52     done
53   '';
55   nativeBuildInputs = [
56     unzip
57     gdc
58   ];
60   buildInputs = [
61     SDL
62     SDL_mixer
63     bulletml
64   ];
66   installPhase = ''
67     install -Dm755 titanion $out/bin/titanion
68     mkdir -p $out/share/games/titanion
69     cp -r sounds images $out/share/games/titanion/
70   '';
72   meta = with lib; {
73     homepage = "http://www.asahi-net.or.jp/~cs8k-cyu/windows/ttn_e.html";
74     description = "Strike down super high-velocity swooping insects";
75     mainProgram = "titanion";
76     license = licenses.bsd2;
77     maintainers = with maintainers; [ fgaz ];
78     platforms = platforms.all;
79   };