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