summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorFrancesco Gazzetta <fgaz@users.noreply.github.com>2018-08-26 19:38:52 +0200
committerRobert Schütz <rschuetz17@gmail.com>2018-08-26 19:38:52 +0200
commitff583d81146f8f7b3c988204fb2237faa5b0976f (patch)
treeb4d35d028dc5a22d12b2f547702cb819d63c31be /pkgs/games
parenta78b364ed487dd1287c69772c816a57211f021f5 (diff)
downloadnixlib-ff583d81146f8f7b3c988204fb2237faa5b0976f.tar
nixlib-ff583d81146f8f7b3c988204fb2237faa5b0976f.tar.gz
nixlib-ff583d81146f8f7b3c988204fb2237faa5b0976f.tar.bz2
nixlib-ff583d81146f8f7b3c988204fb2237faa5b0976f.tar.lz
nixlib-ff583d81146f8f7b3c988204fb2237faa5b0976f.tar.xz
nixlib-ff583d81146f8f7b3c988204fb2237faa5b0976f.tar.zst
nixlib-ff583d81146f8f7b3c988204fb2237faa5b0976f.zip
endgame-singularity: init at 0.30c (#45057)
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/endgame-singularity/default.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/games/endgame-singularity/default.nix b/pkgs/games/endgame-singularity/default.nix
new file mode 100644
index 000000000000..8b259bad88d7
--- /dev/null
+++ b/pkgs/games/endgame-singularity/default.nix
@@ -0,0 +1,56 @@
+{ stdenv, fetchurl, unzip, python2 }:
+
+python2.pkgs.buildPythonApplication rec {
+  pname = "endgame-singularity";
+  version = "0.30c";
+  format = "other";
+
+  srcs = [
+    (fetchurl {
+      url = "http://www.emhsoft.com/singularity/singularity-${version}-src.tar.gz";
+      sha256 = "13zjhf67gmla67nkfpxb01rxs8j9n4hs0s4n9lnnq4zgb709yxgl";
+    })
+    (fetchurl {
+      url = "http://www.emhsoft.com/singularity/endgame-singularity-music-007.zip";
+      sha256 = "0vf2qaf66jh56728pq1zbnw50yckjz6pf6c6qw6dl7vk60kkqnpb";
+    })
+  ];
+  sourceRoot = ".";
+
+  nativeBuildInputs = [ unzip ]; # The music is zipped
+  propagatedBuildInputs = with python2.pkgs; [ pygame numpy ];
+
+  # This is not an error: it needs both compilation rounds
+  buildPhase = ''
+    ${python2.interpreter} -m compileall "singularity-${version}"
+    ${python2.interpreter} -O -m compileall "singularity-${version}"
+  '';
+
+  installPhase = ''
+    install -Dm755 "singularity-${version}/singularity.py"  "$out/share/singularity.py"
+    install -Dm644 "singularity-${version}/singularity.pyo" "$out/share/singularity.pyo"
+    install -Dm644 "singularity-${version}/singularity.pyc" "$out/share/singularity.pyc"
+    cp -R "singularity-${version}/code" "singularity-${version}/data" "$out/share/"
+    cp -R "endgame-singularity-music-007" "$out/share/music"
+  '';
+
+  # Tell it where to find python libraries
+  # Also cd to the same directory as the code, since it uses relative paths
+  postFixup = ''
+    makeWrapper "${python2.interpreter}" "$out/bin/endgame-singularity" \
+          --set PYTHONPATH "$PYTHONPATH" \
+          --run "cd \"$out/share\"" \
+          --add-flags "$out/share/singularity.py"
+  '';
+
+  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
+    '';
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = with stdenv.lib.maintainers; [ fgaz ];
+  };
+}