openttd-nml: modernise

This commit is contained in:
magicquark
2026-06-30 05:10:26 +01:00
parent ee5cd34aeb
commit fede1fc3ca
+15 -7
View File
@@ -1,14 +1,16 @@
{
lib,
fetchFromGitHub,
python3,
python3Packages,
versionCheckHook,
}:
python3.pkgs.buildPythonApplication (finalAttrs: {
python3Packages.buildPythonApplication (finalAttrs: {
pname = "openttd-nml";
version = "0.9.0";
format = "setuptools";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "OpenTTD";
@@ -17,18 +19,24 @@ python3.pkgs.buildPythonApplication (finalAttrs: {
hash = "sha256-FVGjXh04uHZM9vZNzjdYEk4ClMR9t0kl44JePrUGx84=";
};
build-system = [
python3Packages.setuptools
];
postPatch = ''
echo 'version = "${finalAttrs.version}"' > nml/__version__.py
# Ply's source code is vendored.
substituteInPlace pyproject.toml \
--replace-fail '"setuptools", "ply"' '"setuptools"'
'';
propagatedBuildInputs = with python3.pkgs; [
pillow
dependencies = [
python3Packages.pillow
];
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
meta = {
changelog = "https://github.com/OpenTTD/nml/releases/tag/${finalAttrs.version}";
homepage = "https://github.com/OpenTTD/nml";