nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 SDL2,
6 SDL2_ttf,
7 SDL2_image,
8 SDL2_mixer,
9 pkg-config,
10 lua,
11 zlib,
12 unzip,
13}:
14
15let
16 # I took several games at random from https://instead.syscall.ru/games/
17 games = [
18 (fetchurl {
19 url = "http://instead-games.googlecode.com/files/instead-apple-day-1.2.zip";
20 sha256 = "0d4m554hiqmgl4xl0jp0b3bqjl35879768hqznh9y57y04sygd2a";
21 })
22 (fetchurl {
23 url = "http://instead-games.googlecode.com/files/instead-cat_en-1.2.zip";
24 sha256 = "0jlm3ssqlka16dm0rg6qfjh6xdh3pv7lj2s4ib4mqwj2vfy0v6sg";
25 })
26 (fetchurl {
27 url = "http://instead-games.googlecode.com/files/instead-vinny-0.1.zip";
28 sha256 = "15qdbg82zp3a8vz4qxminr0xbzbdpnsciliy2wm3raz4hnadawg1";
29 })
30 (fetchurl {
31 url = "http://instead-games.googlecode.com/files/instead-toilet3in1-1.2.zip";
32 sha256 = "0wz4bljbg67m84qwpaqpzs934a5pcbhpgh39fvbbbfvnnlm4lirl";
33 })
34 (fetchurl {
35 url = "http://instead-games.googlecode.com/files/instead-kayleth-0.4.1.zip";
36 sha256 = "0xmn9inys0kbcdd02qaqp8gazqs67xq3fq7hvcy2qb9jbq85j8b2";
37 })
38 ];
39in
40
41stdenv.mkDerivation (finalAttrs: {
42 pname = "instead";
43 version = "3.5.2";
44
45 src = fetchurl {
46 url = "mirror://sourceforge/project/instead/instead/${finalAttrs.version}/instead_${finalAttrs.version}.tar.gz";
47 hash = "sha256-d5BvzZCZ3P5CLptuCuJ4KxfEp4CDbtmIZDIbGDcyV3o=";
48 };
49
50 NIX_LDFLAGS = "-llua -lgcc_s";
51
52 nativeBuildInputs = [
53 pkg-config
54 unzip
55 ];
56
57 buildInputs = [
58 SDL2
59 SDL2_ttf
60 SDL2_image
61 SDL2_mixer
62 lua
63 zlib
64 ];
65
66 postPatch = ''
67 substituteInPlace configure.sh \
68 --replace-fail "/tmp/sdl-test" $(mktemp)
69 '';
70
71 configurePhase = ''
72 runHook preConfigure
73
74 { echo 2; echo $out; } | ./configure.sh
75
76 runHook postConfigure
77 '';
78
79 inherit games;
80
81 postInstall = ''
82 pushd $out/share/instead/games
83 for a in $games; do
84 unzip $a
85 done
86 popd
87 '';
88
89 enableParallelBuilding = true;
90
91 meta = {
92 description = "Simple text adventure interpreter for Unix and Windows";
93 homepage = "https://instead.syscall.ru/";
94 license = lib.licenses.mit;
95 platforms = with lib.platforms; linux;
96 maintainers = with lib.maintainers; [ pSub ];
97 };
98})