git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #48148 from peterhoeg/p/scummvm_games

scummvm: add several ScummVM supported games

commitd88d0127f715b632e2d868f39e4f8018bac0a56a authorRenaud <c0bw3b@users.noreply.github.com> dateSun 21 Oct 2018, 09:50 (8 years ago) parent51a3a3ea75b320
2 files changed+131
pkgs/games/scummvm/games.nix+125 pkgs/top-level/all-packages.nix+6
pkgs/games/scummvm/games.nixnew file+125
@@ -0,0 +1,125 @@
1+{ stdenv, lib, fetchurl, makeDesktopItem, unzip, writeText
2+, scummvm }:
3+
4+let
5+ desktopItem = name: short: long: description: makeDesktopItem {
6+ categories = "Game;AdventureGame;";
7+ comment = description;
8+ desktopName = long;
9+ exec = "@out@/bin/${short}";
10+ genericName = description;
11+ icon = "scummvm";
12+ name = name;
13+ };
14+
15+ run = name: short: code: writeText "${short}.sh" ''
16+ #!${stdenv.shell} -eu
17+
18+ exec ${scummvm}/bin/scummvm \
19+ --path=@out@/share/${name} \
20+ --fullscreen \
21+ ${code}
22+ '';
23+
24+ generic = { plong, pshort, pcode, description, version, files, docs ? [ "readme.txt" ], ... } @attrs:
25+ let
26+ attrs' = builtins.removeAttrs attrs [ "plong" "pshort" "pcode" "description" "docs" "files" "version" ];
27+ pname = lib.replaceStrings [ " " ":" ] [ "-" "" ] (lib.toLower plong);
28+ in stdenv.mkDerivation ({
29+ name = "${pname}-${version}";
30+
31+ nativeBuildInputs = [ unzip ];
32+
33+ dontBuild = true;
34+ dontFixup = true;
35+
36+ installPhase = ''
37+ runHook preInstall
38+
39+ mkdir -p $out/bin $out/share/{applications,${pname},doc/${pname}}
40+
41+ ${lib.concatStringsSep "\n" (map (f: "mv ${f} $out/share/doc/${pname}") docs)}
42+ ${lib.concatStringsSep "\n" (map (f: "mv ${f} $out/share/${pname}") files)}
43+
44+ substitute ${run pname pshort pcode} $out/bin/${pshort} \
45+ --subst-var out
46+ substitute ${desktopItem pname pshort plong description}/share/applications/${pname}.desktop $out/share/applications/${pname}.desktop \
47+ --subst-var out
48+
49+ chmod 0755 $out/bin/${pshort}
50+
51+ runHook postInstall
52+ '';
53+
54+ meta = with stdenv.lib; {
55+ homepage = https://www.scummvm.org;
56+ license = licenses.free; # refer to the readme for exact wording
57+ maintainers = with maintainers; [ peterhoeg ];
58+ inherit description;
59+ inherit (scummvm.meta) platforms;
60+ };
61+ } // attrs');
62+
63+in {
64+ beneath-a-steel-sky = generic rec {
65+ plong = "Beneath a Steel Sky";
66+ pshort = "bass";
67+ pcode = "sky";
68+ description = "2D point-and-click science fiction thriller set in a bleak vision of the future";
69+ version = "1.2";
70+ src = fetchurl {
71+ url = "mirror://sourceforge/scummvm/${pshort}-cd-${version}.zip";
72+ sha256 = "14s5jz67kavm8l15gfm5xb7pbpn8azrv460mlxzzvdpa02a9n82k";
73+ };
74+ files = [ "sky.*" ];
75+ };
76+
77+ drascula-the-vampire-strikes-back = generic rec {
78+ plong = "Drascula: The Vampire Strikes Back";
79+ pshort = "drascula";
80+ pcode = "drascula";
81+ description = "Spanish 2D classic point & click style adventure with tons of humor and an easy interface";
82+ version = "1.0";
83+ # srcs = {
84+ src = fetchurl {
85+ url = "mirror://sourceforge/scummvm/${pshort}-${version}.zip";
86+ sha256 = "1pj29rpb754sn6a56f8brfv6f2m1p5qgaqik7d68pfi2bb5zccdp";
87+ };
88+ # audio = fetchurl {
89+ # url = "mirror://sourceforge/scummvm/${pshort}-audio-flac-2.0.zip";
90+ # sha256 = "1zmqhrby8f5sj1qy6xjdgkvk9wyhr3nw8ljrrl58fmxb83x1rryw";
91+ # };
92+ # };
93+ sourceRoot = ".";
94+ docs = [ "readme.txt" "drascula.doc" ];
95+ files = [ "Packet.001" ];
96+ };
97+
98+ flight-of-the-amazon-queen = generic rec {
99+ plong = "Flight of the Amazon Queen";
100+ pshort = "fotaq";
101+ pcode = "queen";
102+ description = "2D point-and-click adventure game set in the 1940s";
103+ version = "1.1";
104+ src = fetchurl {
105+ url = "mirror://sourceforge/scummvm/FOTAQ_Talkie-${version}.zip";
106+ sha256 = "1a6q71q1dl9vvw2qqsxk5h1sv0gaqy6236zr5905w2is01gdsp52";
107+ };
108+ sourceRoot = ".";
109+ files = [ "*.1c" ];
110+ };
111+
112+ lure-of-the-temptress = generic rec {
113+ plong = "Lure of the Temptress";
114+ pshort = "lott";
115+ pcode = "lure";
116+ description = "2D point-and-click adventure game with a fantasy theme";
117+ version = "1.1";
118+ src = fetchurl {
119+ url = "mirror://sourceforge/scummvm/lure-${version}.zip";
120+ sha256 = "0201i70qcs1m797kvxjx3ygkhg6kcl5yf49sihba2ga8l52q45zk";
121+ };
122+ docs = [ "README" "*.txt" "*.pdf" "*.PDF" ];
123+ files = [ "*.vga" ];
124+ };
125+}
pkgs/top-level/all-packages.nix+6
@@ -20438,6 +20438,12 @@ with pkgs;
2043820438
2043920439 scummvm = callPackage ../games/scummvm { };
2044020440
20441+ inherit (callPackage ../games/scummvm/games.nix { })
20442+ beneath-a-steel-sky
20443+ drascula-the-vampire-strikes-back
20444+ flight-of-the-amazon-queen
20445+ lure-of-the-temptress;
20446+
2044120447 scorched3d = callPackage ../games/scorched3d { };
2044220448
2044320449 scrolls = callPackage ../games/scrolls { };