nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, fetchurl
3, fetchFromGitHub
4, unzip
5, python3
6, enableDefaultMusicPack ? true
7}:
8
9python3.pkgs.buildPythonApplication rec {
10 pname = "endgame-singularity";
11 version = "1.00";
12
13 srcs = [
14 (fetchFromGitHub {
15 owner = "singularity";
16 repo = "singularity";
17 rev = "v${version}";
18 sha256 = "0ndrnxwii8lag6vrjpwpf5n36hhv223bb46d431l9gsigbizv0hl";
19 })
20 ] ++ lib.optional enableDefaultMusicPack (
21 fetchurl {
22 url = "http://www.emhsoft.com/singularity/endgame-singularity-music-007.zip";
23 sha256 = "0vf2qaf66jh56728pq1zbnw50yckjz6pf6c6qw6dl7vk60kkqnpb";
24 }
25 );
26 sourceRoot = "source";
27
28 nativeBuildInputs = [ unzip ]; # The music is zipped
29 propagatedBuildInputs = with python3.pkgs; [ pygame numpy polib ];
30
31 # Add the music
32 postInstall = lib.optionalString enableDefaultMusicPack ''
33 cp -R "../endgame-singularity-music-007" \
34 "$(echo $out/lib/python*/site-packages/singularity)/music"
35 # ↑ we cannot glob on [...]/music, it doesn't exist yet
36 '';
37
38 meta = {
39 homepage = "http://www.emhsoft.com/singularity/";
40 description = "A simulation game about strong AI";
41 longDescription = ''
42 A simulation of a true AI. Go from computer to computer, pursued by the
43 entire world. Keep hidden, and you might have a chance
44 '';
45 # License details are in LICENSE.txt
46 license = with lib.licenses; [
47 gpl2Plus # most of the code, some translations
48 mit # recursive_fix_pickle, polib
49 cc-by-sa-30 # data and artwork, some translations
50 free # earth images from NASA, some fonts
51 cc0 # cick0.wav
52 ];
53 maintainers = with lib.maintainers; [ fgaz ];
54 };
55}