2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-07-18 16:06:22 +00:00
|
|
|
, fetchurl
|
|
|
|
, fetchFromGitHub
|
|
|
|
, unzip
|
|
|
|
, python3
|
|
|
|
, enableDefaultMusicPack ? true
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
let
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "endgame-singularity";
|
2020-07-18 16:06:22 +00:00
|
|
|
version = "1.00";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
main_src = fetchFromGitHub {
|
|
|
|
owner = "singularity";
|
|
|
|
repo = "singularity";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0ndrnxwii8lag6vrjpwpf5n36hhv223bb46d431l9gsigbizv0hl";
|
|
|
|
};
|
|
|
|
|
|
|
|
music_src = fetchurl {
|
|
|
|
url = "http://www.emhsoft.com/singularity/endgame-singularity-music-007.zip";
|
|
|
|
sha256 = "0vf2qaf66jh56728pq1zbnw50yckjz6pf6c6qw6dl7vk60kkqnpb";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
srcs = [ main_src ] ++ lib.optional enableDefaultMusicPack music_src;
|
|
|
|
sourceRoot = main_src.name;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ unzip ]; # The music is zipped
|
2020-07-18 16:06:22 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [ pygame numpy polib ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
# Add the music
|
2021-01-15 22:18:51 +00:00
|
|
|
postInstall = lib.optionalString enableDefaultMusicPack ''
|
2020-07-18 16:06:22 +00: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
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://www.emhsoft.com/singularity/";
|
|
|
|
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-12-21 02:18:32 +00:00
|
|
|
# License details are in LICENSE.txt
|
|
|
|
license = with lib.licenses; [
|
|
|
|
gpl2Plus # most of the code, some translations
|
|
|
|
mit # recursive_fix_pickle, polib
|
|
|
|
cc-by-sa-30 # data and artwork, some translations
|
|
|
|
free # earth images from NASA, some fonts
|
|
|
|
cc0 # cick0.wav
|
|
|
|
];
|
2023-11-16 04:20:00 +00:00
|
|
|
mainProgram = "singularity";
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = with lib.maintainers; [ fgaz ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|