@@ -0,0 +1,55 @@
1+{ stdenv, requireFile, gogUnpackHook }:
2+
3+let
4+ generic = ver: source: let
5+ pname = "descent${toString ver}";
6+ in stdenv.mkDerivation rec {
7+ name = "${pname}-assets-${version}";
8+ version = "2.0.0.7";
9+
10+ src = requireFile rec {
11+ name = "setup_descent12_${version}.exe";
12+ sha256 = "1r1drbfda6czg21f9qqiiwgnkpszxgmcn5bafp5ljddh34swkn3f";
13+ message = ''
14+ While the Descent ${toString ver} game engine is free, the game assets are not.
15+
16+ Please purchase the game on gog.com and download the Windows installer.
17+
18+ Once you have downloaded the file, please use the following command and re-run the
19+ installation:
20+
21+ nix-prefetch-url file://\$PWD/${name}
22+ '';
23+ };
24+
25+ nativeBuildInputs = [ gogUnpackHook ];
26+
27+ dontBuild = true;
28+ dontFixup = true;
29+
30+ installPhase = ''
31+ runHook preInstall
32+
33+ mkdir -p $out/share/{games/${pname},doc/${pname}/examples}
34+ pushd "app/${source}"
35+ mv dosbox*.conf $out/share/doc/${pname}/examples
36+ mv *.txt *.pdf $out/share/doc/${pname}
37+ cp -r * $out/share/games/descent${toString ver}
38+ popd
39+
40+ runHook postInstall
41+ '';
42+
43+ meta = with stdenv.lib; {
44+ description = "Descent ${toString ver} assets from GOG";
45+ homepage = http://www.dxx-rebirth.com/;
46+ license = licenses.unfree;
47+ maintainers = with maintainers; [ peterhoeg ];
48+ hydraPlatforms = [];
49+ };
50+ };
51+
52+in {
53+ descent1-assets = generic 1 "descent";
54+ descent2-assets = generic 2 "descent 2";
55+}