1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 cargo,
6 fetchFromGitHub,
7 libiconv,
8 rustPlatform,
9 rustc,
10 setuptools-rust,
11 range-typed-integers,
12}:
13
14buildPythonPackage rec {
15 pname = "skytemple-rust";
16 version = "1.8.5";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "SkyTemple";
21 repo = "skytemple-rust";
22 rev = version;
23 hash = "sha256-yJ78P00h4SITVuDnIh5IIlWkoed/VtIw3NB8ETB95bk=";
24 };
25
26 cargoDeps = rustPlatform.fetchCargoVendor {
27 inherit pname version src;
28 hash = "sha256-9OgUuuMuo2l4YsZMhBZJBqKqbNwj1W4yidoogjcNgm8=";
29 };
30
31 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
32 libiconv
33 ];
34 nativeBuildInputs = [
35 setuptools-rust
36 rustPlatform.cargoSetupHook
37 cargo
38 rustc
39 ];
40 propagatedBuildInputs = [ range-typed-integers ];
41
42 GETTEXT_SYSTEM = true;
43
44 doCheck = false; # tests for this package are in skytemple-files package
45 pythonImportsCheck = [ "skytemple_rust" ];
46
47 meta = with lib; {
48 homepage = "https://github.com/SkyTemple/skytemple-rust";
49 description = "Binary Rust extensions for SkyTemple";
50 license = licenses.mit;
51 maintainers = with maintainers; [ marius851000 ];
52 };
53}