Merge pull request #149748 from prusnak/rustpython

rustpython: init at unstable-2021-12-09
This commit is contained in:
Pavol Rusnak 2021-12-14 19:11:14 +01:00 committed by GitHub
commit fc58c3761e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 49 additions and 1 deletions

View file

@ -285,4 +285,8 @@ in {
inherit passthruFun;
};
rustpython = callPackage ./rustpython/default.nix {
inherit (darwin.apple_sdk.frameworks) SystemConfiguration;
};
})

View file

@ -0,0 +1,44 @@
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, SystemConfiguration
, python3
}:
rustPlatform.buildRustPackage rec {
pname = "rustpython";
version = "unstable-2021-12-09";
src = fetchFromGitHub {
owner = "RustPython";
repo = "RustPython";
rev = "db3b3127df34ff5dd569301aa36ed71ae5624e4e";
sha256 = "sha256-YwGfXs3A5L/18mHnnWubPU3Y8EI9uU3keJ2HJnnTwv0=";
};
cargoHash = "sha256-T85kiPG80oZ4mwpb8Ag40wDHKx2Aens+gM7NGXan5lM=";
# freeze the stdlib into the rustpython binary
cargoBuildFlags = "--features=freeze-stdlib";
buildInputs = lib.optionals stdenv.isDarwin [ SystemConfiguration ];
checkInputs = [ python3 ];
meta = with lib; {
description = "Python 3 interpreter in written Rust";
homepage = "https://rustpython.github.io";
license = licenses.mit;
maintainers = with maintainers; [ prusnak ];
# TODO: Remove once nixpkgs uses newer SDKs that supports '*at' functions.
# Probably macOS SDK 10.13 or later. Check the current version in
# .../os-specific/darwin/apple-sdk/default.nix
#
# From the build logs:
#
# > Undefined symbols for architecture x86_64: "_utimensat"
broken = stdenv.isDarwin && stdenv.isx86_64;
};
}

View file

@ -13604,7 +13604,7 @@ with pkgs;
python3Packages = python3.pkgs;
pythonInterpreters = callPackage ./../development/interpreters/python { };
inherit (pythonInterpreters) python27 python37 python38 python39 python310 python3Minimal pypy27 pypy38;
inherit (pythonInterpreters) python27 python37 python38 python39 python310 python3Minimal pypy27 pypy38 rustpython;
# Python package sets.
python27Packages = python27.pkgs;