evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / py / pyxel / package.nix
blobb2041d5e768253b81a6001fca437bb3c653e9152
2   lib,
3   python3,
4   fetchFromGitHub,
5   rustPlatform,
6   SDL2,
7 }:
9 python3.pkgs.buildPythonApplication rec {
10   pname = "pyxel";
11   version = "2.1.6";
12   pyproject = true;
14   disabled = python3.pythonOlder "3.7";
16   src = fetchFromGitHub {
17     owner = "kitao";
18     repo = "pyxel";
19     rev = "v${version}";
20     hash = "sha256-6S+fl6J1JN785HxG8i0oYlwoTsqa3Gm1DpCd4swUPZ8=";
21   };
23   patches = [ ./never-bundle-sdl2.patch ];
25   postPatch = ''
26     cp ${./Cargo.lock} rust/Cargo.lock
27   '';
29   cargoRoot = "rust";
31   cargoDeps = rustPlatform.importCargoLock {
32     # generated by running `cargo generate-lockfile` in the `rust` directory
33     lockFile = ./Cargo.lock;
34   };
36   buildAndTestSubdir = "python";
38   nativeBuildInputs = with rustPlatform; [
39     cargoSetupHook
40     maturinBuildHook
41     bindgenHook
42   ];
44   buildInputs = [ SDL2 ];
46   env.NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL2}/include/SDL2";
48   # Tests want to use the display
49   doCheck = false;
51   pythonImportsCheck = [
52     "pyxel"
53     "pyxel.pyxel_wrapper"
54   ];
56   meta = {
57     changelog = "https://github.com/kitao/pyxel/tree/${src.rev}/CHANGELOG.md";
58     description = "Retro game engine for Python";
59     homepage = "https://github.com/kitao/pyxel";
60     license = lib.licenses.mit;
61     mainProgram = "pyxel";
62     maintainers = with lib.maintainers; [ tomasajt ];
63     platforms = lib.platforms.linux ++ lib.platforms.darwin;
64   };