nixpkgs/pkgs/by-name/py/pyxel/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
1.4 KiB
Nix
Raw Normal View History

2024-08-03 08:04:30 +00:00
{
lib,
python3,
fetchFromGitHub,
rustPlatform,
SDL2,
2023-12-25 01:15:33 +00:00
}:
python3.pkgs.buildPythonApplication rec {
pname = "pyxel";
2024-08-03 08:04:30 +00:00
version = "2.1.6";
2023-12-25 01:15:33 +00:00
pyproject = true;
disabled = python3.pythonOlder "3.7";
src = fetchFromGitHub {
owner = "kitao";
repo = "pyxel";
rev = "v${version}";
2024-08-03 08:04:30 +00:00
hash = "sha256-6S+fl6J1JN785HxG8i0oYlwoTsqa3Gm1DpCd4swUPZ8=";
2023-12-25 01:15:33 +00:00
};
2024-06-08 12:58:41 +00:00
patches = [ ./never-bundle-sdl2.patch ];
postPatch = ''
cp ${./Cargo.lock} rust/Cargo.lock
'';
2023-12-25 01:15:33 +00:00
2024-06-08 12:58:41 +00:00
cargoRoot = "rust";
2023-12-25 01:15:33 +00:00
cargoDeps = rustPlatform.importCargoLock {
2024-06-08 12:58:41 +00:00
# generated by running `cargo generate-lockfile` in the `rust` directory
2023-12-25 01:15:33 +00:00
lockFile = ./Cargo.lock;
};
2024-06-08 12:58:41 +00:00
buildAndTestSubdir = "python";
2023-12-25 01:15:33 +00:00
nativeBuildInputs = with rustPlatform; [
cargoSetupHook
maturinBuildHook
bindgenHook
];
buildInputs = [ SDL2 ];
2023-12-25 01:15:33 +00:00
env.NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL2}/include/SDL2";
2024-06-08 12:58:41 +00:00
# Tests want to use the display
doCheck = false;
2023-12-25 01:15:33 +00:00
pythonImportsCheck = [
"pyxel"
"pyxel.pyxel_wrapper"
];
meta = {
changelog = "https://github.com/kitao/pyxel/tree/${src.rev}/CHANGELOG.md";
description = "Retro game engine for Python";
homepage = "https://github.com/kitao/pyxel";
license = lib.licenses.mit;
mainProgram = "pyxel";
maintainers = with lib.maintainers; [ tomasajt ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
}