2021-01-17 05:49:22 +00:00
|
|
|
{ lib, stdenv, fetchurl, SDL2, SDL2_ttf, SDL2_image, SDL2_mixer, pkg-config, lua, zlib, unzip }:
|
2010-09-30 19:58:48 +01:00
|
|
|
|
|
|
|
let
|
2020-09-09 17:23:23 +01:00
|
|
|
version = "3.3.2";
|
2010-09-30 19:58:48 +01:00
|
|
|
|
2020-10-02 08:58:50 +01:00
|
|
|
# I took several games at random from https://instead.syscall.ru/games/
|
2010-09-30 19:58:48 +01:00
|
|
|
games = [
|
|
|
|
(fetchurl {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "http://instead-games.googlecode.com/files/instead-apple-day-1.2.zip";
|
2010-09-30 19:58:48 +01:00
|
|
|
sha256 = "0d4m554hiqmgl4xl0jp0b3bqjl35879768hqznh9y57y04sygd2a";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "http://instead-games.googlecode.com/files/instead-cat_en-1.2.zip";
|
2010-09-30 19:58:48 +01:00
|
|
|
sha256 = "0jlm3ssqlka16dm0rg6qfjh6xdh3pv7lj2s4ib4mqwj2vfy0v6sg";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "http://instead-games.googlecode.com/files/instead-vinny-0.1.zip";
|
2010-09-30 19:58:48 +01:00
|
|
|
sha256 = "15qdbg82zp3a8vz4qxminr0xbzbdpnsciliy2wm3raz4hnadawg1";
|
|
|
|
})
|
2010-12-20 17:34:49 +00:00
|
|
|
(fetchurl {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "http://instead-games.googlecode.com/files/instead-toilet3in1-1.2.zip";
|
2013-08-17 21:19:54 +01:00
|
|
|
sha256 = "0wz4bljbg67m84qwpaqpzs934a5pcbhpgh39fvbbbfvnnlm4lirl";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "http://instead-games.googlecode.com/files/instead-kayleth-0.4.1.zip";
|
2013-08-17 21:19:54 +01:00
|
|
|
sha256 = "0xmn9inys0kbcdd02qaqp8gazqs67xq3fq7hvcy2qb9jbq85j8b2";
|
2010-12-20 17:34:49 +00:00
|
|
|
})
|
2010-09-30 19:58:48 +01:00
|
|
|
];
|
|
|
|
in
|
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation {
|
2010-09-30 19:58:48 +01:00
|
|
|
name = "instead-" + version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
2016-02-28 12:07:42 +00:00
|
|
|
url = "mirror://sourceforge/project/instead/instead/${version}/instead_${version}.tar.gz";
|
2020-09-09 17:23:23 +01:00
|
|
|
sha256 = "u5j2kDKRvMQPsG8iA6uOBScuyE/e1BJIK2+qVL6jqQs=";
|
2010-09-30 19:58:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
NIX_LDFLAGS = "-llua -lgcc_s";
|
|
|
|
|
2021-01-17 05:49:22 +00:00
|
|
|
nativeBuildInputs = [ pkg-config unzip ];
|
2019-12-08 23:35:30 +00:00
|
|
|
buildInputs = [ SDL2 SDL2_ttf SDL2_image SDL2_mixer lua zlib ];
|
2010-09-30 19:58:48 +01:00
|
|
|
|
2020-09-09 17:23:23 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace configure.sh \
|
|
|
|
--replace "/tmp/sdl-test" $(mktemp)
|
|
|
|
'';
|
2020-10-02 09:31:30 +01:00
|
|
|
|
2010-09-30 19:58:48 +01:00
|
|
|
configurePhase = ''
|
2013-08-17 21:19:54 +01:00
|
|
|
{ echo 2; echo $out; } | ./configure.sh
|
2010-09-30 19:58:48 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
inherit games;
|
|
|
|
|
2019-12-08 23:35:30 +00:00
|
|
|
postInstall = ''
|
2013-08-17 21:19:54 +01:00
|
|
|
pushd $out/share/instead/games
|
2010-09-30 19:58:48 +01:00
|
|
|
for a in $games; do
|
|
|
|
unzip $a
|
|
|
|
done
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
2019-12-08 23:35:30 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2010-09-30 19:58:48 +01:00
|
|
|
description = "Simple text adventure interpreter for Unix and Windows";
|
2020-10-02 08:58:50 +01:00
|
|
|
homepage = "https://instead.syscall.ru/";
|
2021-01-15 04:31:39 +00:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
platforms = with lib.platforms; linux;
|
2015-01-14 23:42:17 +00:00
|
|
|
maintainers = with maintainers; [ pSub ];
|
2010-09-30 19:58:48 +01:00
|
|
|
};
|
|
|
|
}
|