python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / games / rrootage / default.nix
blob6cd5919c4e8f4c18942f788bd8fd9feba7a5f277
1 { lib, stdenv, fetchpatch, fetchurl, SDL, SDL_mixer, bulletml }:
3 let
4   version = "0.23a";
5   debianRevision = "12";
6   debianPatch = patchname: hash: fetchpatch {
7     name = "${patchname}.patch";
8     url = "https://sources.debian.org/data/main/r/rrootage/${version}-${debianRevision}/debian/patches/${patchname}.patch";
9     sha256 = hash;
10   };
12 in stdenv.mkDerivation {
13   pname = "rrootage";
14   inherit version;
15   src = fetchurl {
16     url = "http://downloads.sourceforge.net/rrootage/rRootage-${version}.tar.gz";
17     sha256 = "01zzg4ih3kmbhsn1p9zr7g8srv1d2dhrp8cdd86y9qq233idnkln";
18   };
20   patches = [
21     (debianPatch
22       "01_makefile"
23       "0wgplznx9kgb82skwqplpydbpallgrby3w662h52wky5zl0pyijj")
24     (debianPatch
25       "02_data_dir"
26       "12vw60s94by3f6k8pk45k555h4y7gzlqfds0a96nrrryammpgnq3")
27     (debianPatch
28       "03_texture_filename"
29       "1qxkxy6821xvanacf25mi43wj8nf40c1qiyavhc8av798xprpkjh")
30     (debianPatch
31       "04_home"
32       "0s15b0liv40jzjd9l4zsq688ky1yp9b1gmb1xhi3bih4y7q9awdz")
33     (debianPatch
34       "05_gcc"
35       "06ihgbfrklabs7cb6216w1jjb9sglv86iagzhhmyydwyph4fb782")
36     (debianPatch
37       "06_rrootage_highres"
38       "0ifjmh236yiv3g896nfwwydgcnq3njdb8ldah7s3jxp3xkpvwcga")
39     (debianPatch
40       "07_use_system_bulletml"
41       "1sxsl1yzx3msvz8mf0jk1vnahqb1ahq9drm391idgh0afy77l6j7")
42     (debianPatch
43       "08_windowed_mode"
44       "0knx4g445ngilsz4dvdkq69f5f8i2xv2fnmdmq037xd5rhfg0b23")
45     (debianPatch
46       "09_rootage_make_highres_default"
47       "1zqz8s54rl8jmqmvdi9c3ayfcma6qkbfkx5vw0fzyn268wcs022p")
48     (debianPatch
49       "10_deg_out_of_range"
50       "1wr76az4rlv1gaj9xdknzqcjazw6h8myqw6y3753q259hxbq4cah")
51   ];
52   postPatch = ''
53     substituteInPlace "src/screen.c" --replace "/usr/share/games/rrootage" "$out/share/games/rrootage"
54     substituteInPlace "src/soundmanager.c" --replace "/usr/share/games/rrootage" "$out/share/games/rrootage"
55     substituteInPlace "src/barragemanager.cc" --replace "/usr/share/games/rrootage" "$out/share/games/rrootage"
56   '';
58   buildInputs = [ SDL SDL_mixer bulletml ];
59   makeFlags = [ "-C src" "-f makefile.lin" ];
60   hardeningDisable = [ "stackprotector" "fortify" ]; # buffer overflow without this
62   installPhase = ''
63     install -d "$out"/share/games
64     cp -r rr_share "$out"/share/games/rrootage
65     install -D src/rrootage "$out"/bin/rrootage
67     install -D -m 644 readme.txt "$out"/share/licenses/rrootage/README.jp
68     install -m 644 readme_e.txt "$out"/share/licenses/rrootage/README.en
70     install -D -m 644 readme.txt "$out"/share/doc/rrootage/README.jp
71     install -m 644 readme_e.txt "$out"/share/doc/rrootage/README.en
72     install -m 644 readme_linux "$out"/share/doc/rrootage/README
73   '';
75   meta = with lib; {
76     description = "Abstract shooter created by Kenta Cho";
77     homepage = "http://rrootage.sourceforge.net/";
78     license = licenses.bsd2;
79     maintainers = with maintainers; [ fgaz ];
80   };