git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #149748 from prusnak/rustpython

rustpython: init at unstable-2021-12-09

commitfc58c3761e9b9b3aee635bb2894bab97aa1b6ff6 authorPavol Rusnak <pavol@rusnak.io> dateTue 14 Dec 2021, 19:11 (5 years ago) parentdcf4fb5dbf7134
3 files changed+49−1
pkgs/development/interpreters/python/default.nix+4 pkgs/development/interpreters/python/rustpython/default.nix+44 pkgs/top-level/all-packages.nix+1−1
pkgs/development/interpreters/python/default.nix+4
@@ -285,4 +285,8 @@ in {
285285 inherit passthruFun;
286286 };
287287
288+ rustpython = callPackage ./rustpython/default.nix {
289+ inherit (darwin.apple_sdk.frameworks) SystemConfiguration;
290+ };
291+
288292})
pkgs/development/interpreters/python/rustpython/default.nixnew file+44
@@ -0,0 +1,44 @@
1+{ lib
2+, stdenv
3+, rustPlatform
4+, fetchFromGitHub
5+, SystemConfiguration
6+, python3
7+}:
8+
9+rustPlatform.buildRustPackage rec {
10+ pname = "rustpython";
11+ version = "unstable-2021-12-09";
12+
13+ src = fetchFromGitHub {
14+ owner = "RustPython";
15+ repo = "RustPython";
16+ rev = "db3b3127df34ff5dd569301aa36ed71ae5624e4e";
17+ sha256 = "sha256-YwGfXs3A5L/18mHnnWubPU3Y8EI9uU3keJ2HJnnTwv0=";
18+ };
19+
20+ cargoHash = "sha256-T85kiPG80oZ4mwpb8Ag40wDHKx2Aens+gM7NGXan5lM=";
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+}
pkgs/top-level/all-packages.nix+1−1
@@ -13604,7 +13604,7 @@ with pkgs;
1360413604 python3Packages = python3.pkgs;
1360513605
1360613606 pythonInterpreters = callPackage ./../development/interpreters/python { };
13607− inherit (pythonInterpreters) python27 python37 python38 python39 python310 python3Minimal pypy27 pypy38;
13607+ inherit (pythonInterpreters) python27 python37 python38 python39 python310 python3Minimal pypy27 pypy38 rustpython;
1360813608
1360913609 # Python package sets.
1361013610 python27Packages = python27.pkgs;