2021-12-19 01:06:50 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, SystemConfiguration
|
|
|
|
, python3
|
2023-03-08 16:32:21 +00:00
|
|
|
, fetchpatch
|
2021-12-19 01:06:50 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "rustpython";
|
2023-03-08 16:32:21 +00:00
|
|
|
version = "0.2.0";
|
2021-12-19 01:06:50 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RustPython";
|
|
|
|
repo = "RustPython";
|
2023-03-08 16:32:21 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-RNUOBBbq4ca9yEKNj5TZTOQW0hruWOIm/G+YCHoJ19U=";
|
2021-12-19 01:06:50 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
|
|
|
"rustpython-doc-0.1.0" = "sha256-4xBiV1FcYA05cWs9fQV+OklZEU1VZunhCo9deOSWPe8=";
|
|
|
|
};
|
|
|
|
};
|
2023-03-08 16:32:21 +00:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Fix aarch64 compatibility for sqlite. Remove with the next release. https://github.com/RustPython/RustPython/pull/4499
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/RustPython/RustPython/commit/9cac89347e2276fcb309f108561e99f4be5baff2.patch";
|
|
|
|
hash = "sha256-vUPQI/5ec6/36Vdtt7/B2unPDsVrGh5iEiSMBRatxWU=";
|
|
|
|
})
|
|
|
|
];
|
2021-12-19 01:06:50 +00:00
|
|
|
|
|
|
|
# freeze the stdlib into the rustpython binary
|
2022-10-30 15:09:59 +00:00
|
|
|
cargoBuildFlags = [ "--features=freeze-stdlib" ];
|
2021-12-19 01:06:50 +00:00
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ SystemConfiguration ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ python3 ];
|
2021-12-19 01:06:50 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python 3 interpreter in written Rust";
|
|
|
|
homepage = "https://rustpython.github.io";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ prusnak ];
|
|
|
|
};
|
|
|
|
}
|