1{
2 stdenv,
3 lib,
4 fetchurl,
5 makeDesktopItem,
6 unzip,
7 writeText,
8 scummvm,
9 runtimeShell,
10}:
11
12let
13 desktopItem =
14 name: short: long: description:
15 makeDesktopItem {
16 categories = [
17 "Game"
18 "AdventureGame"
19 ];
20 comment = description;
21 desktopName = long;
22 exec = "@out@/bin/${short}";
23 genericName = description;
24 icon = "scummvm";
25 name = name;
26 };
27
28 run =
29 name: short: code:
30 writeText "${short}.sh" ''
31 #!${runtimeShell} -eu
32
33 exec ${scummvm}/bin/scummvm \
34 --path=@out@/share/${name} \
35 --fullscreen \
36 ${code}
37 '';
38
39 generic =
40 {
41 plong,
42 pshort,
43 pcode,
44 description,
45 version,
46 files,
47 docs ? [ "readme.txt" ],
48 ...
49 }@attrs:
50 let
51 attrs' = builtins.removeAttrs attrs [
52 "plong"
53 "pshort"
54 "pcode"
55 "description"
56 "docs"
57 "files"
58 "version"
59 ];
60 pname = lib.replaceStrings [ " " ":" ] [ "-" "" ] (lib.toLower plong);
61 in
62 stdenv.mkDerivation (
63 {
64 name = "${pname}-${version}";
65
66 nativeBuildInputs = [ unzip ];
67
68 dontBuild = true;
69 dontFixup = true;
70
71 installPhase = ''
72 runHook preInstall
73
74 mkdir -p $out/bin $out/share/{applications,${pname},doc/${pname}}
75
76 ${lib.concatStringsSep "\n" (map (f: "mv ${f} $out/share/doc/${pname}") docs)}
77 ${lib.concatStringsSep "\n" (map (f: "mv ${f} $out/share/${pname}") files)}
78
79 substitute ${run pname pshort pcode} $out/bin/${pshort} \
80 --subst-var out
81 substitute ${
82 desktopItem pname pshort plong description
83 }/share/applications/${pname}.desktop $out/share/applications/${pname}.desktop \
84 --subst-var out
85
86 chmod 0755 $out/bin/${pshort}
87
88 runHook postInstall
89 '';
90
91 meta = with lib; {
92 homepage = "https://www.scummvm.org";
93 license = licenses.free; # refer to the readme for exact wording
94 maintainers = with maintainers; [ peterhoeg ];
95 inherit description;
96 inherit (scummvm.meta) platforms;
97 };
98 }
99 // attrs'
100 );
101
102in
103{
104 beneath-a-steel-sky = generic rec {
105 plong = "Beneath a Steel Sky";
106 pshort = "bass";
107 pcode = "sky";
108 description = "2D point-and-click science fiction thriller set in a bleak vision of the future";
109 version = "1.2";
110 src = fetchurl {
111 url = "mirror://sourceforge/scummvm/${pshort}-cd-${version}.zip";
112 sha256 = "14s5jz67kavm8l15gfm5xb7pbpn8azrv460mlxzzvdpa02a9n82k";
113 };
114 files = [ "sky.*" ];
115 };
116
117 broken-sword-25 = generic rec {
118 plong = "Broken Sword 2.5";
119 pshort = "sword25";
120 pcode = "sword25";
121 description = "A fan game of the Broken Sword series";
122 version = "1.0";
123 src = fetchurl {
124 url = "mirror://sourceforge/scummvm/${pshort}-v${version}.zip";
125 sha256 = "0ivj1vflfpih5bs5a902mab88s4d77fwm3ya3fk7pammzc8gjqzz";
126 };
127 sourceRoot = ".";
128 docs = [
129 "README"
130 "license-original.txt"
131 ];
132 files = [ "data.b25c" ];
133 };
134
135 drascula-the-vampire-strikes-back = generic rec {
136 plong = "Drascula: The Vampire Strikes Back";
137 pshort = "drascula";
138 pcode = "drascula";
139 description = "Spanish 2D classic point & click style adventure with tons of humor and an easy interface";
140 version = "1.0";
141 # srcs = {
142 src = fetchurl {
143 url = "mirror://sourceforge/scummvm/${pshort}-${version}.zip";
144 sha256 = "1pj29rpb754sn6a56f8brfv6f2m1p5qgaqik7d68pfi2bb5zccdp";
145 };
146 # audio = fetchurl {
147 # url = "mirror://sourceforge/scummvm/${pshort}-audio-flac-2.0.zip";
148 # sha256 = "1zmqhrby8f5sj1qy6xjdgkvk9wyhr3nw8ljrrl58fmxb83x1rryw";
149 # };
150 # };
151 sourceRoot = ".";
152 docs = [
153 "readme.txt"
154 "drascula.doc"
155 ];
156 files = [ "Packet.001" ];
157 };
158
159 dreamweb = generic rec {
160 plong = "Dreamweb";
161 pshort = "dreamweb";
162 pcode = "dreamweb";
163 description = "2D point-and-click cyberpunk top-down adventure game";
164 version = "1.1";
165 src = fetchurl {
166 url = "mirror://sourceforge/scummvm/${pshort}-cd-uk-${version}.zip";
167 sha256 = "0hh1p3rd7s0ckvri14lc6wdry9vv0vn4h4744v2n4zg63j8i6vsa";
168 };
169 sourceRoot = ".";
170 docs = [ "license.txt" ];
171 files = [
172 "DREAMWEB.*"
173 "SPEECH"
174 "track01.flac"
175 ];
176 };
177
178 flight-of-the-amazon-queen = generic rec {
179 plong = "Flight of the Amazon Queen";
180 pshort = "fotaq";
181 pcode = "queen";
182 description = "2D point-and-click adventure game set in the 1940s";
183 version = "1.1";
184 src = fetchurl {
185 url = "mirror://sourceforge/scummvm/FOTAQ_Talkie-${version}.zip";
186 sha256 = "1a6q71q1dl9vvw2qqsxk5h1sv0gaqy6236zr5905w2is01gdsp52";
187 };
188 sourceRoot = ".";
189 files = [ "*.1c" ];
190 };
191
192 lure-of-the-temptress = generic rec {
193 plong = "Lure of the Temptress";
194 pshort = "lott";
195 pcode = "lure";
196 description = "2D point-and-click adventure game with a fantasy theme";
197 version = "1.1";
198 src = fetchurl {
199 url = "mirror://sourceforge/scummvm/lure-${version}.zip";
200 sha256 = "0201i70qcs1m797kvxjx3ygkhg6kcl5yf49sihba2ga8l52q45zk";
201 };
202 docs = [
203 "README"
204 "*.txt"
205 "*.pdf"
206 "*.PDF"
207 ];
208 files = [ "*.vga" ];
209 };
210}