2021-01-25 09:26:54 +01:00
|
|
|
{ lib
|
2021-03-27 18:54:47 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, python3Packages
|
|
|
|
}:
|
2018-08-26 02:23:32 +02:00
|
|
|
|
2021-03-27 18:54:47 +01:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2018-08-26 02:23:32 +02:00
|
|
|
pname = "20kly";
|
2021-03-27 18:54:47 +01:00
|
|
|
version = "1.5.0";
|
|
|
|
|
2018-08-26 02:23:32 +02:00
|
|
|
format = "other";
|
|
|
|
|
2021-03-27 18:54:47 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "20kly";
|
|
|
|
repo = "20kly";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1zxsxg49a02k7zidx3kgk2maa0vv0n1f9wrl5vch07sq3ghvpphx";
|
2018-08-26 02:23:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace lightyears \
|
|
|
|
--replace \
|
|
|
|
"LIGHTYEARS_DIR = \".\"" \
|
|
|
|
"LIGHTYEARS_DIR = \"$out/share\""
|
|
|
|
'';
|
|
|
|
|
2021-03-27 18:54:47 +01:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
pygame
|
|
|
|
];
|
2018-08-26 02:23:32 +02:00
|
|
|
|
2021-03-27 18:54:47 +01:00
|
|
|
buildPhase = ''
|
|
|
|
python -O -m compileall .
|
|
|
|
'';
|
2018-08-26 02:23:32 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/share"
|
2021-03-27 18:54:47 +01:00
|
|
|
cp -r data lib20k lightyears "$out/share"
|
2018-08-26 02:23:32 +02:00
|
|
|
install -Dm755 lightyears "$out/bin/lightyears"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2018-08-26 02:23:32 +02:00
|
|
|
description = "A steampunk-themed strategy game where you have to manage a steam supply network";
|
2024-03-19 03:14:51 +01:00
|
|
|
mainProgram = "lightyears";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://jwhitham.org.uk/20kly/";
|
2021-03-27 18:54:47 +01:00
|
|
|
license = licenses.gpl2Only;
|
2018-08-26 02:23:32 +02:00
|
|
|
maintainers = with maintainers; [ fgaz ];
|
|
|
|
};
|
|
|
|
}
|