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