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