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