pyxel: init at 2.0.7

This commit is contained in:
TomaSajt 2023-12-25 02:15:33 +01:00
parent 35ff7e87ee
commit 6a1634c0b4
No known key found for this signature in database
GPG key ID: F011163C050122A1
4 changed files with 1764 additions and 0 deletions

1663
pkgs/by-name/py/pyxel/Cargo.lock generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,13 @@
diff --git a/crates/pyxel-platform/build.rs b/crates/pyxel-platform/build.rs
index 35cdeef5..68a93ed9 100644
--- a/crates/pyxel-platform/build.rs
+++ b/crates/pyxel-platform/build.rs
@@ -30,7 +30,7 @@ impl SDL2BindingsBuilder {
}
fn should_bundle_sdl2(&self) -> bool {
- self.target_os.contains("windows") || self.target_os == "darwin"
+ false
}
fn download_sdl2(&self) {

View file

@ -0,0 +1,75 @@
{ lib
, stdenv
, python3
, fetchFromGitHub
, rustPlatform
, SDL2
, libiconv
, darwin
}:
python3.pkgs.buildPythonApplication rec {
pname = "pyxel";
version = "2.0.7";
pyproject = true;
disabled = python3.pythonOlder "3.7";
src = fetchFromGitHub {
owner = "kitao";
repo = "pyxel";
rev = "v${version}";
hash = "sha256-5Jrwfi79HbS4hh+eMwI49Rsk4jrAdAuDhNpUT2cEvDo=";
};
patches = [
./never-bundle-sdl2.patch
./update-bindgen-f16-support.patch # can be removed once rust-bindgen gets a new release
];
cargoRoot = "crates/pyxel-wrapper";
# Lockfile is generated by applying patches with `git apply`
# and then running `cargo generate-lockfile` in `crates/pyxel-wrapper`
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
outputHashes = {
"bindgen-0.69.1" = "sha256-1967EmuyWgmrKmhwAcW49dlmuWPNuKjuRr5/u7ZKpXQ=";
};
};
postPatch = ''
cp ${./Cargo.lock} crates/pyxel-wrapper/Cargo.lock
'';
nativeBuildInputs = with rustPlatform; [
cargoSetupHook
maturinBuildHook
bindgenHook
];
buildInputs = [ SDL2 ] ++ lib.optionals stdenv.isDarwin [
libiconv
darwin.apple_sdk.frameworks.IOKit
];
env.NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL2}/include/SDL2";
# Tests can't use the display
dontCheck = true;
pythonImportsCheck = [
"pyxel"
"pyxel.pyxel_wrapper"
];
meta = {
changelog = "https://github.com/kitao/pyxel/tree/${src.rev}/CHANGELOG.md";
description = "A 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;
};
}

View file

@ -0,0 +1,13 @@
diff --git a/crates/pyxel-platform/Cargo.toml b/crates/pyxel-platform/Cargo.toml
index 01a87b68..088ffbdd 100644
--- a/crates/pyxel-platform/Cargo.toml
+++ b/crates/pyxel-platform/Cargo.toml
@@ -22,7 +22,7 @@ parking_lot = "0.12"
paste = "1.0"
[build-dependencies]
-bindgen = "0.69"
+bindgen = { git = "https://github.com/rust-lang/rust-bindgen.git", rev = "d77e53ed8398743bf68831d25063719fa0f4f136" }
cmake = "0.1"
flate2 = "1.0"
tar = "0.4"