Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 50bb0a3a8d2f
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c09177d5dc8a
Choose a head ref
  • 3 commits
  • 1 file changed
  • 2 contributors

Commits on Jul 5, 2020

  1. Verified

    This commit was signed with the committer’s verified signature.
    jtojnar Jan Tojnar
    Copy the full SHA
    d80eeae View commit details
  2. endgame-singularity: add option to disable the default music pack

    It's the heaviest part of the game. People may not want to have it take
    space or may want to use their own music.
    fgaz committed Jul 5, 2020
    Copy the full SHA
    c823b4c View commit details
  3. Merge pull request #92346 from fgaz/endgame-singularity/1.00

    Endgame singularity/1.00
    ryantm authored Jul 5, 2020
    Copy the full SHA
    c09177d View commit details
Showing with 25 additions and 33 deletions.
  1. +25 −33 pkgs/games/endgame-singularity/default.nix
58 changes: 25 additions & 33 deletions pkgs/games/endgame-singularity/default.nix
Original file line number Diff line number Diff line change
@@ -1,46 +1,38 @@
{ stdenv, fetchurl, unzip, python2 }:
{ stdenv
, fetchurl
, fetchFromGitHub
, unzip
, python3
, enableDefaultMusicPack ? true
}:

python2.pkgs.buildPythonApplication rec {
python3.pkgs.buildPythonApplication rec {
pname = "endgame-singularity";
version = "0.30c";
format = "other";
version = "1.00";

srcs = [
(fetchurl {
url = "http://www.emhsoft.com/singularity/singularity-${version}-src.tar.gz";
sha256 = "13zjhf67gmla67nkfpxb01rxs8j9n4hs0s4n9lnnq4zgb709yxgl";
(fetchFromGitHub {
owner = "singularity";
repo = "singularity";
rev = "v${version}";
sha256 = "0ndrnxwii8lag6vrjpwpf5n36hhv223bb46d431l9gsigbizv0hl";
})
(fetchurl {
] ++ stdenv.lib.optional enableDefaultMusicPack (
fetchurl {
url = "http://www.emhsoft.com/singularity/endgame-singularity-music-007.zip";
sha256 = "0vf2qaf66jh56728pq1zbnw50yckjz6pf6c6qw6dl7vk60kkqnpb";
})
];
sourceRoot = ".";
}
);
sourceRoot = "source";

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"
'';
propagatedBuildInputs = with python3.pkgs; [ pygame numpy polib ];

# 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"
# Add the music
postInstall = stdenv.lib.optionalString enableDefaultMusicPack ''
cp -R "../endgame-singularity-music-007" \
"$(echo $out/lib/python*/site-packages/singularity)/music"
# ↑ we cannot glob on [...]/music, it doesn't exist yet
'';

meta = {