2021-01-25 09:26:54 +01:00
|
|
|
{ lib
|
2020-07-05 17:29:17 +02:00
|
|
|
, fetchurl
|
|
|
|
, fetchFromGitHub
|
|
|
|
, unzip
|
|
|
|
, python3
|
2020-07-05 17:37:04 +02:00
|
|
|
, enableDefaultMusicPack ? true
|
2020-07-05 17:29:17 +02:00
|
|
|
}:
|
2018-08-26 19:38:52 +02:00
|
|
|
|
2020-07-05 17:29:17 +02:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2018-08-26 19:38:52 +02:00
|
|
|
pname = "endgame-singularity";
|
2020-07-05 17:29:17 +02:00
|
|
|
version = "1.00";
|
2018-08-26 19:38:52 +02:00
|
|
|
|
|
|
|
srcs = [
|
2020-07-05 17:29:17 +02:00
|
|
|
(fetchFromGitHub {
|
|
|
|
owner = "singularity";
|
|
|
|
repo = "singularity";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0ndrnxwii8lag6vrjpwpf5n36hhv223bb46d431l9gsigbizv0hl";
|
2018-08-26 19:38:52 +02:00
|
|
|
})
|
2021-01-15 05:31:39 +01:00
|
|
|
] ++ lib.optional enableDefaultMusicPack (
|
2020-07-05 17:37:04 +02:00
|
|
|
fetchurl {
|
2018-08-26 19:38:52 +02:00
|
|
|
url = "http://www.emhsoft.com/singularity/endgame-singularity-music-007.zip";
|
|
|
|
sha256 = "0vf2qaf66jh56728pq1zbnw50yckjz6pf6c6qw6dl7vk60kkqnpb";
|
2020-07-05 17:37:04 +02:00
|
|
|
}
|
|
|
|
);
|
2020-07-05 17:29:17 +02:00
|
|
|
sourceRoot = "source";
|
2018-08-26 19:38:52 +02:00
|
|
|
|
|
|
|
nativeBuildInputs = [ unzip ]; # The music is zipped
|
2020-07-05 17:29:17 +02:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [ pygame numpy polib ];
|
2018-08-26 19:38:52 +02:00
|
|
|
|
2020-07-05 17:29:17 +02:00
|
|
|
# Add the music
|
2021-01-15 05:31:39 +01:00
|
|
|
postInstall = lib.optionalString enableDefaultMusicPack ''
|
2020-07-05 17:29:17 +02:00
|
|
|
cp -R "../endgame-singularity-music-007" \
|
|
|
|
"$(echo $out/lib/python*/site-packages/singularity)/music"
|
|
|
|
# ↑ we cannot glob on [...]/music, it doesn't exist yet
|
2018-08-26 19:38:52 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://www.emhsoft.com/singularity/";
|
2018-08-26 19:38:52 +02:00
|
|
|
description = "A simulation game about strong AI";
|
|
|
|
longDescription = ''
|
|
|
|
A simulation of a true AI. Go from computer to computer, pursued by the
|
|
|
|
entire world. Keep hidden, and you might have a chance
|
|
|
|
'';
|
2021-01-15 05:31:39 +01:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
maintainers = with lib.maintainers; [ fgaz ];
|
2018-08-26 19:38:52 +02:00
|
|
|
};
|
|
|
|
}
|