python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / games / ue4demos / default.nix
blobce3f3ad38f8dbda23c242b345d7569b955ff98ee
1 { lib, stdenv, fetchurl, unzip, patchelf, xorg, openal }:
3 let
4   urls = file:
5     [
6       # Untrusted mirrors - do not update hashes
7       "https://ludios.org/mirror/ue4demos/${file}"
8       "https://web.archive.org/web/20140824192039/http://ue4linux.raxxy.com/${file}"
9     ];
11   buildDemo = { name, src }:
12     stdenv.mkDerivation rec {
13       inherit name src;
15       nativeBuildInputs = [ unzip patchelf ];
17       rtdeps = lib.makeLibraryPath
18         [ xorg.libXxf86vm xorg.libXext openal ]
19         + ":" + lib.makeSearchPathOutput "lib" "lib64" [ stdenv.cc.cc ];
21       buildCommand =
22       ''
23         mkdir -p "$out"
24         cd $out
25         unzip $src
27         interpreter=$(echo ${stdenv.cc.libc}/lib/ld-linux*.so.2)
28         binary=$(find . -executable -type f)
29         patchelf \
30           --set-interpreter $interpreter \
31           --set-rpath ${rtdeps} \
32           "$binary"
34         # Workaround on
35         # LogLinuxPlatformFile:Warning: open('/nix/store/hash-ue4demos-demo/demo/demo/Saved/Config/CleanSourceConfigs/Engine.ini', Flags=0x00080241) failed: errno=2 (No such file or directory)
36         # for Vehicle, Shooter and Strategy games.
37         ls | grep ' ' && $(
38           haxname=$(ls | grep ' ' | sed 's/ //g'); \
39           haxpath=$(ls | grep ' ')/$haxname/Saved; \
40           mkdir -p "$haxpath"/Config/CleanSourceConfigs; \
41           ln -s /dev/null "$haxpath"/Config/CleanSourceConfigs/Engine.ini; \
42           mkdir -p "$haxpath"/Logs; \
43           ln -s /dev/null "$haxpath"/Logs/$haxname.log)
45         # Executables are buried under a varied paths across demos.
46         mkdir bin
47         cd bin
48         ln -s "$out/$binary" $(basename "$out/$binary")
49       '';
51       meta = {
52         description = "Unreal Engine 4 Linux demos";
53         homepage = "https://wiki.unrealengine.com/Linux_Demos";
54         platforms = [ "x86_64-linux" ];
55         license = lib.licenses.unfree;
56       };
57     };
59 in {
60   tappy_chicken = buildDemo {
61     name = "ue4demos-tappy_chicken";
62     src = fetchurl {
63       urls = urls "tappy_chicken.zip";
64       sha256 = "0lwhvk3lpb2r5ng2cnzk7fpjj5lwhy2sch1a8v154x1xfhfb3h4v";
65     };
66   };
68   swing_ninja = buildDemo {
69     name = "ue4demos-swing_ninja";
70     src = fetchurl {
71       urls = urls "swing_ninja.zip";
72       sha256 = "1bmgqqk3lda5h7nnqi59jgyrsn0clr3xs0k1jclnqf9fk0m8hjcv";
73     };
74   };
76   card_game = buildDemo {
77     name = "ue4demos-card_game";
78     src = fetchurl {
79       urls = urls "card_game.zip";
80       sha256 = "154baqias5q7kad0c89k35jbmnmlm865sll02mi7bk1yllcckz5z";
81     };
82   };
84   vehicle_game = buildDemo {
85     name = "ue4demos-vehicle_game";
86     src = fetchurl {
87       urls = urls "vehicle_game.zip";
88       sha256 = "03dlacf1iv7sgn7pl3sx9r6243wy8fsi2kd858syfm9slg0190bs";
89     };
90   };
92   shooter_game = buildDemo {
93     name = "ue4demos-shooter_game";
94     src = fetchurl {
95       urls = urls "shooter_game.zip";
96       sha256 = "1bk32k349iqbqk8x8jffnqq0pjiqmvrvv675xxmlvkkr8qrlhz98";
97     };
98   };
100   strategy_game = buildDemo {
101     name = "ue4demos-strategy_game";
102     src = fetchurl {
103       urls = urls "strategy_game.zip";
104       sha256 = "1p7i966v1ssm20y12g4wsccpgnky3szy19qyjlacynk7bgbk6lg7";
105     };
106   };
108   black_jack = buildDemo {
109     name = "ue4demos-black_jack";
110     src = fetchurl {
111       urls = urls "black_jack.zip";
112       sha256 = "0g52wkzn5isa3az32y25yx5b56wxks97pajqwkmm6gf4qpkfksxv";
113     };
114   };
116   landscape_mountains = buildDemo {
117     name = "ue4demos-landscape_mountains";
118     src = fetchurl {
119       urls = urls "landscape_mountains.zip";
120       sha256 = "14jzajhs3cpydvf3ag7lpj4hkpbjpwnn3xkdvdx92fi0pcl8cwym";
121     };
122   };
124   matinee_demo = buildDemo {
125     name = "ue4demos-matinee_demo";
126     src = fetchurl {
127       urls = urls "matinee_demo.zip";
128       sha256 = "0ib8k6fl15cxzdarar2sqq5v3g3c7p2jidkdjd00nym6cvkibb4d";
129     };
130   };
132   elemental_demo = buildDemo {
133     name = "ue4demos-elemental_demo";
134     src = fetchurl {
135       urls = urls "elemental_demo.zip";
136       sha256 = "1v4jdsy8jvv8wgc8dx17q17xigfrya5q0nfdzw4md7fzm3bg9z0v";
137     };
138   };
140   effects_cave_demo = buildDemo {
141     name = "ue4demos-effects_cave_demo";
142     src = fetchurl {
143       urls = urls "effects_cave_demo.zip";
144       sha256 = "0lvd3aaha2x9pnpkdmrzi6nf7hymr95834z3l8shygjf9kbbzsz4";
145     };
146   };
148   realistic_rendering = buildDemo {
149     name = "ue4demos-realistic_rendering";
150     src = fetchurl {
151       urls = urls "realistic_rendering_demo.zip";
152       sha256 = "0r16nznkv475hkw5rnngqsc69ch8vh86dppyyyr9nn43dkr2110a";
153     };
154   };
156   reflections_subway = buildDemo {
157     name = "ue4demos-reflections_subway";
158     src = fetchurl {
159       urls = urls "reflections_subway_demo.zip";
160       sha256 = "0dw5sm7405gxw9iqz0vpnhdprrb4wl5i14pvzl1381k973m8bd00";
161     };
162   };
164   scifi_hallway_demo = buildDemo {
165     name = "ue4demos-scifi_hallway_demo";
166     src = fetchurl {
167       urls = urls "sci-fi_hallway_demo.zip";
168       sha256 = "14qp9iwm47awn8d9j6ijh6cnds308x60xs4vi2fvz2666jlz1pq2";
169     };
170   };
172   mobile_temple_demo = buildDemo {
173     name = "ue4demos-mobile_temple_demo";
174     src = fetchurl {
175       urls = urls "mobile_temple_demo.zip";
176       sha256 = "12bz4h1b9lhmqglwsa6r8q48ijqbjdha9fql31540d01kigaka75";
177     };
178   };
180   stylized_demo = buildDemo {
181     name = "ue4demos-stylized_demo";
182     src = fetchurl {
183       urls = urls "stylized_demo.zip";
184       sha256 = "1676ridmj8rk4y4hbdscfnnka5l636av1xxl0qwvk236kq9j7v0l";
185     };
186   };
188   blueprint_examples_demo = buildDemo {
189     name = "ue4demos-blueprint_examples_demo";
190     src = fetchurl {
191       urls = urls "blueprint_examples_demo.zip";
192       sha256 = "076q33h2hy965fvr805hsprkpcmizf638lj2ik8k923v86b15nbv";
193     };
194   };