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