summary refs log tree commit diff
path: root/pkgs/development/interpreters/python
diff options
context:
space:
mode:
authorsternenseemann <sternenseemann@systemli.org>2021-12-15 11:30:31 +0100
committersternenseemann <sternenseemann@systemli.org>2021-12-15 11:30:31 +0100
commitd860ba7f0990548b2485ec77126c760789ba3fd9 (patch)
tree9e21a8f88db01fb1eadb062002f1af3bfe538f0d /pkgs/development/interpreters/python
parentdfe70100691395c0b3fe6d1737b3b719209b0cc6 (diff)
parent8a8ab455d06d6e770aa17955fa854552344e8064 (diff)
downloadnixpkgs-d860ba7f0990548b2485ec77126c760789ba3fd9.tar
nixpkgs-d860ba7f0990548b2485ec77126c760789ba3fd9.tar.gz
nixpkgs-d860ba7f0990548b2485ec77126c760789ba3fd9.tar.bz2
nixpkgs-d860ba7f0990548b2485ec77126c760789ba3fd9.tar.lz
nixpkgs-d860ba7f0990548b2485ec77126c760789ba3fd9.tar.xz
nixpkgs-d860ba7f0990548b2485ec77126c760789ba3fd9.tar.zst
nixpkgs-d860ba7f0990548b2485ec77126c760789ba3fd9.zip
Merge remote-tracking branch 'origin/master' into staging-next
Diffstat (limited to 'pkgs/development/interpreters/python')
-rw-r--r--pkgs/development/interpreters/python/default.nix4
-rw-r--r--pkgs/development/interpreters/python/rustpython/default.nix44
2 files changed, 48 insertions, 0 deletions
diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix
index e7b86eef96c..1931867d14f 100644
--- a/pkgs/development/interpreters/python/default.nix
+++ b/pkgs/development/interpreters/python/default.nix
@@ -299,4 +299,8 @@ in {
     inherit passthruFun;
   };
 
+  rustpython = callPackage ./rustpython/default.nix {
+    inherit (darwin.apple_sdk.frameworks) SystemConfiguration;
+  };
+
 })
diff --git a/pkgs/development/interpreters/python/rustpython/default.nix b/pkgs/development/interpreters/python/rustpython/default.nix
new file mode 100644
index 00000000000..ad438220322
--- /dev/null
+++ b/pkgs/development/interpreters/python/rustpython/default.nix
@@ -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;
+  };
+}