1{ lib 2, stdenv 3, rustPlatform 4, fetchFromGitHub 5, SystemConfiguration 6, python3 7}: 8 9rustPlatform.buildRustPackage rec { 10 pname = "rustpython"; 11 version = "unstable-2022-10-11"; 12 13 src = fetchFromGitHub { 14 owner = "RustPython"; 15 repo = "RustPython"; 16 rev = "273ffd969ca6536df06d9f69076c2badb86f8f8c"; 17 sha256 = "sha256-t/3++EeP7a8t2H0IEPLogBri7+6u+2+v+lNb4/Ty1/w="; 18 }; 19 20 cargoHash = "sha256-Pv7SK64+eoK1VUxDh1oH0g1veWoIvBhiZE9JI/alXJ4="; 21 22 # freeze the stdlib into the rustpython binary 23 cargoBuildFlags = [ "--features=freeze-stdlib" ]; 24 25 buildInputs = lib.optionals stdenv.isDarwin [ SystemConfiguration ]; 26 27 checkInputs = [ python3 ]; 28 29 meta = with lib; { 30 description = "Python 3 interpreter in written Rust"; 31 homepage = "https://rustpython.github.io"; 32 license = licenses.mit; 33 maintainers = with maintainers; [ prusnak ]; 34 35 # TODO: Remove once nixpkgs uses newer SDKs that supports '*at' functions. 36 # Probably macOS SDK 10.13 or later. Check the current version in 37 # .../os-specific/darwin/apple-sdk/default.nix 38 # 39 # From the build logs: 40 # 41 # > Undefined symbols for architecture x86_64: "_utimensat" 42 broken = stdenv.isDarwin && stdenv.isx86_64; 43 }; 44}