nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, fetchFromGitHub
3, python3Packages
4}:
5
6python3Packages.buildPythonApplication rec {
7 pname = "20kly";
8 version = "1.5.0";
9
10 format = "other";
11
12 src = fetchFromGitHub {
13 owner = "20kly";
14 repo = "20kly";
15 rev = "v${version}";
16 sha256 = "1zxsxg49a02k7zidx3kgk2maa0vv0n1f9wrl5vch07sq3ghvpphx";
17 };
18
19 patchPhase = ''
20 substituteInPlace lightyears \
21 --replace \
22 "LIGHTYEARS_DIR = \".\"" \
23 "LIGHTYEARS_DIR = \"$out/share\""
24 '';
25
26 propagatedBuildInputs = with python3Packages; [
27 pygame
28 ];
29
30 buildPhase = ''
31 python -O -m compileall .
32 '';
33
34 installPhase = ''
35 mkdir -p "$out/share"
36 cp -r data lib20k lightyears "$out/share"
37 install -Dm755 lightyears "$out/bin/lightyears"
38 '';
39
40 meta = with lib; {
41 description = "A steampunk-themed strategy game where you have to manage a steam supply network";
42 homepage = "http://jwhitham.org.uk/20kly/";
43 license = licenses.gpl2Only;
44 maintainers = with maintainers; [ fgaz ];
45 };
46}