summary refs log tree commit diff
path: root/pkgs/development/interpreters
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r--pkgs/development/interpreters/python/cpython/2.7/default.nix12
-rw-r--r--pkgs/development/interpreters/python/cpython/default.nix18
-rw-r--r--pkgs/development/interpreters/python/hooks/default.nix12
-rw-r--r--pkgs/development/interpreters/python/hooks/pypa-build-hook-test.nix8
-rw-r--r--pkgs/development/interpreters/python/mk-python-derivation.nix6
-rw-r--r--pkgs/development/interpreters/python/passthrufun.nix7
-rw-r--r--pkgs/development/interpreters/python/python2/mk-python-derivation.nix2
-rw-r--r--pkgs/development/interpreters/python/wrap-python.nix2
-rw-r--r--pkgs/development/interpreters/renpy/default.nix4
-rw-r--r--pkgs/development/interpreters/spidermonkey/common.nix6
10 files changed, 42 insertions, 35 deletions
diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix
index 9cd806c0523..b336caf6a0a 100644
--- a/pkgs/development/interpreters/python/cpython/2.7/default.nix
+++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix
@@ -56,11 +56,11 @@ assert lib.assertMsg (reproducibleBuild -> (!rebuildBytecode))
 
 let
   buildPackages = pkgsBuildHost;
-  inherit (passthru) pythonForBuild;
+  inherit (passthru) pythonOnBuildForHost;
 
-  pythonForBuildInterpreter = if stdenv.hostPlatform == stdenv.buildPlatform then
+  pythonOnBuildForHostInterpreter = if stdenv.hostPlatform == stdenv.buildPlatform then
     "$out/bin/python"
-  else pythonForBuild.interpreter;
+  else pythonOnBuildForHost.interpreter;
 
   passthru = passthruFun rec {
     inherit self sourceVersion packageOverrides;
@@ -297,9 +297,9 @@ in with passthru; stdenv.mkDerivation ({
         # We build 3 levels of optimized bytecode. Note the default level, without optimizations,
         # is not reproducible yet. https://bugs.python.org/issue29708
         # Not creating bytecode will result in a large performance loss however, so we do build it.
-        find $out -name "*.py" | ${pythonForBuildInterpreter} -m compileall -q -f -x "lib2to3" -i -
-        find $out -name "*.py" | ${pythonForBuildInterpreter} -O  -m compileall -q -f -x "lib2to3" -i -
-        find $out -name "*.py" | ${pythonForBuildInterpreter} -OO -m compileall -q -f -x "lib2to3" -i -
+        find $out -name "*.py" | ${pythonOnBuildForHostInterpreter} -m compileall -q -f -x "lib2to3" -i -
+        find $out -name "*.py" | ${pythonOnBuildForHostInterpreter} -O  -m compileall -q -f -x "lib2to3" -i -
+        find $out -name "*.py" | ${pythonOnBuildForHostInterpreter} -OO -m compileall -q -f -x "lib2to3" -i -
       '' + lib.optionalString stdenv.hostPlatform.isCygwin ''
         cp libpython2.7.dll.a $out/lib
       '';
diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix
index 9ecc27fa1c7..8bc5c6c586d 100644
--- a/pkgs/development/interpreters/python/cpython/default.nix
+++ b/pkgs/development/interpreters/python/cpython/default.nix
@@ -92,7 +92,7 @@ let
   openssl' = if openssl != null then openssl_legacy else null;
 
   buildPackages = pkgsBuildHost;
-  inherit (passthru) pythonForBuild;
+  inherit (passthru) pythonOnBuildForHost;
 
   inherit (darwin.apple_sdk.frameworks) Cocoa;
 
@@ -127,7 +127,7 @@ let
     nukeReferences
   ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     buildPackages.stdenv.cc
-    pythonForBuild
+    pythonOnBuildForHost
   ] ++ optionals (stdenv.cc.isClang && (!stdenv.hostPlatform.useAndroidPrebuilt or false) && (enableLTO || enableOptimizations)) [
     stdenv.cc.cc.libllvm.out
   ];
@@ -148,9 +148,9 @@ let
 
   hasDistutilsCxxPatch = !(stdenv.cc.isGNU or false);
 
-  pythonForBuildInterpreter = if stdenv.hostPlatform == stdenv.buildPlatform then
+  pythonOnBuildForHostInterpreter = if stdenv.hostPlatform == stdenv.buildPlatform then
     "$out/bin/python"
-  else pythonForBuild.interpreter;
+  else pythonOnBuildForHost.interpreter;
 
   src = fetchurl {
     url = with sourceVersion; "https://www.python.org/ftp/python/${major}.${minor}.${patch}/Python-${version}.tar.xz";
@@ -388,7 +388,7 @@ in with passthru; stdenv.mkDerivation (finalAttrs: {
     "ac_cv_file__dev_ptmx=${if stdenv.hostPlatform.isWindows then "no" else "yes"}"
     "ac_cv_file__dev_ptc=${if stdenv.hostPlatform.isWindows then "no" else "yes"}"
   ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform && pythonAtLeast "3.11") [
-    "--with-build-python=${pythonForBuildInterpreter}"
+    "--with-build-python=${pythonOnBuildForHostInterpreter}"
   ] ++ optionals stdenv.hostPlatform.isLinux [
     # Never even try to use lchmod on linux,
     # don't rely on detecting glibc-isms.
@@ -511,9 +511,9 @@ in with passthru; stdenv.mkDerivation (finalAttrs: {
     # We build 3 levels of optimized bytecode. Note the default level, without optimizations,
     # is not reproducible yet. https://bugs.python.org/issue29708
     # Not creating bytecode will result in a large performance loss however, so we do build it.
-    find $out -name "*.py" | ${pythonForBuildInterpreter} -m compileall -q -f -x "lib2to3" -i -
-    find $out -name "*.py" | ${pythonForBuildInterpreter} -O  -m compileall -q -f -x "lib2to3" -i -
-    find $out -name "*.py" | ${pythonForBuildInterpreter} -OO -m compileall -q -f -x "lib2to3" -i -
+    find $out -name "*.py" | ${pythonOnBuildForHostInterpreter} -m compileall -q -f -x "lib2to3" -i -
+    find $out -name "*.py" | ${pythonOnBuildForHostInterpreter} -O  -m compileall -q -f -x "lib2to3" -i -
+    find $out -name "*.py" | ${pythonOnBuildForHostInterpreter} -OO -m compileall -q -f -x "lib2to3" -i -
     '' + ''
     # *strip* shebang from libpython gdb script - it should be dual-syntax and
     # interpretable by whatever python the gdb in question is using, which may
@@ -561,7 +561,7 @@ in with passthru; stdenv.mkDerivation (finalAttrs: {
     ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     # Ensure we don't have references to build-time packages.
     # These typically end up in shebangs.
-    pythonForBuild buildPackages.bash
+    pythonOnBuildForHost buildPackages.bash
   ];
 
   separateDebugInfo = true;
diff --git a/pkgs/development/interpreters/python/hooks/default.nix b/pkgs/development/interpreters/python/hooks/default.nix
index 6a05a7fa6ee..ea2511b2881 100644
--- a/pkgs/development/interpreters/python/hooks/default.nix
+++ b/pkgs/development/interpreters/python/hooks/default.nix
@@ -1,8 +1,8 @@
 self: dontUse: with self;
 
 let
-  inherit (python) pythonForBuild;
-  pythonInterpreter = pythonForBuild.interpreter;
+  inherit (python) pythonOnBuildForHost;
+  pythonInterpreter = pythonOnBuildForHost.interpreter;
   pythonSitePackages = python.sitePackages;
   pythonCheckInterpreter = python.interpreter;
   setuppy = ../run_setup.py;
@@ -68,10 +68,10 @@ in {
       #   set, but in downstream projects that build packages depending on other
       #   versions of this hook's dependencies.
       passthru.tests = import ./pypa-build-hook-tests.nix {
-        inherit pythonForBuild runCommand;
+        inherit pythonOnBuildForHost runCommand;
       };
     } ./pypa-build-hook.sh) {
-      inherit (pythonForBuild.pkgs) build;
+      inherit (pythonOnBuildForHost.pkgs) build;
     };
 
   pipInstallHook = callPackage ({ makePythonHook, pip }:
@@ -91,7 +91,7 @@ in {
         inherit pythonInterpreter pythonSitePackages;
       };
     } ./pypa-install-hook.sh) {
-      inherit (pythonForBuild.pkgs) installer;
+      inherit (pythonOnBuildForHost.pkgs) installer;
     };
 
   pytestCheckHook = callPackage ({ makePythonHook, pytest }:
@@ -227,7 +227,7 @@ in {
   sphinxHook = callPackage ({ makePythonHook, installShellFiles }:
     makePythonHook {
       name = "python${python.pythonVersion}-sphinx-hook";
-      propagatedBuildInputs = [ installShellFiles ];
+      propagatedBuildInputs = [ pythonOnBuildForHost.pkgs.sphinx installShellFiles ];
       substitutions = {
         sphinxBuild = "${pythonForBuild.pkgs.sphinx}/bin/sphinx-build";
       };
diff --git a/pkgs/development/interpreters/python/hooks/pypa-build-hook-test.nix b/pkgs/development/interpreters/python/hooks/pypa-build-hook-test.nix
index d909e34241f..4153c21ca4f 100644
--- a/pkgs/development/interpreters/python/hooks/pypa-build-hook-test.nix
+++ b/pkgs/development/interpreters/python/hooks/pypa-build-hook-test.nix
@@ -1,4 +1,4 @@
-{ pythonForBuild, runCommand }: {
+{ pythonOnBuildForHost, runCommand }: {
   dont-propagate-conflicting-deps = let
     # customize a package so that its store paths differs
     mkConflict = pkg: pkg.overrideAttrs { some_modification = true; };
@@ -16,7 +16,7 @@
     '';
     in
     # this build must never triger conflicts
-    pythonForBuild.pkgs.buildPythonPackage {
+    pythonOnBuildForHost.pkgs.buildPythonPackage {
       pname = "dont-propagate-conflicting-deps";
       version = "0.0.0";
       src = projectSource;
@@ -24,9 +24,9 @@
       propagatedBuildInputs = [
         # At least one dependency of `build` should be included here to
         # keep the test meaningful
-        (mkConflict pythonForBuild.pkgs.tomli)
+        (mkConflict pythonOnBuildForHost.pkgs.tomli)
         # setuptools is also needed to build the example project
-        pythonForBuild.pkgs.setuptools
+        pythonOnBuildForHost.pkgs.setuptools
       ];
     };
 }
diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix
index 81308900f22..c14c6bc096f 100644
--- a/pkgs/development/interpreters/python/mk-python-derivation.nix
+++ b/pkgs/development/interpreters/python/mk-python-derivation.nix
@@ -224,7 +224,7 @@ let
     ] ++ lib.optionals (format' == "pyproject") [(
       if isBootstrapPackage then
         pypaBuildHook.override {
-          inherit (python.pythonForBuild.pkgs.bootstrap) build;
+          inherit (python.pythonOnBuildForHost.pkgs.bootstrap) build;
           wheel = null;
         }
       else
@@ -236,7 +236,7 @@ let
     ] ++ lib.optionals (format' != "other") [(
       if isBootstrapInstallPackage then
         pypaInstallHook.override {
-          inherit (python.pythonForBuild.pkgs.bootstrap) installer;
+          inherit (python.pythonOnBuildForHost.pkgs.bootstrap) installer;
         }
       else
         pypaInstallHook
@@ -280,7 +280,7 @@ let
     '' + attrs.postFixup or "";
 
     # Python packages built through cross-compilation are always for the host platform.
-    disallowedReferences = lib.optionals (python.stdenv.hostPlatform != python.stdenv.buildPlatform) [ python.pythonForBuild ];
+    disallowedReferences = lib.optionals (python.stdenv.hostPlatform != python.stdenv.buildPlatform) [ python.pythonOnBuildForHost ];
 
     outputs = outputs ++ lib.optional withDistOutput "dist";
 
diff --git a/pkgs/development/interpreters/python/passthrufun.nix b/pkgs/development/interpreters/python/passthrufun.nix
index 6cb906be0a5..b06433113b6 100644
--- a/pkgs/development/interpreters/python/passthrufun.nix
+++ b/pkgs/development/interpreters/python/passthrufun.nix
@@ -91,9 +91,10 @@ in rec {
     pythonAtLeast = lib.versionAtLeast pythonVersion;
     pythonOlder = lib.versionOlder pythonVersion;
     inherit hasDistutilsCxxPatch;
-    # TODO: deprecate
-    # Not done immediately because its likely used outside Nixpkgs.
-    pythonForBuild = pythonOnBuildForHost_overridden;
+    # Remove after 24.11 is released.
+    pythonForBuild =
+      lib.warnIf (lib.isInOldestRelease 2311) "`pythonForBuild` (from `python*`) has been renamed to `pythonOnBuildForHost`"
+        pythonOnBuildForHost_overridden;
     pythonOnBuildForHost = pythonOnBuildForHost_overridden;
 
     tests = callPackage ./tests.nix {
diff --git a/pkgs/development/interpreters/python/python2/mk-python-derivation.nix b/pkgs/development/interpreters/python/python2/mk-python-derivation.nix
index d42e4e85c10..1a6f9c784cf 100644
--- a/pkgs/development/interpreters/python/python2/mk-python-derivation.nix
+++ b/pkgs/development/interpreters/python/python2/mk-python-derivation.nix
@@ -224,7 +224,7 @@ let
     '' + attrs.postFixup or "";
 
     # Python packages built through cross-compilation are always for the host platform.
-    disallowedReferences = lib.optionals (python.stdenv.hostPlatform != python.stdenv.buildPlatform) [ python.pythonForBuild ];
+    disallowedReferences = lib.optionals (python.stdenv.hostPlatform != python.stdenv.buildPlatform) [ python.pythonOnBuildForHost ];
 
     outputs = outputs ++ lib.optional withDistOutput "dist";
 
diff --git a/pkgs/development/interpreters/python/wrap-python.nix b/pkgs/development/interpreters/python/wrap-python.nix
index c67a8e08851..8817d091a28 100644
--- a/pkgs/development/interpreters/python/wrap-python.nix
+++ b/pkgs/development/interpreters/python/wrap-python.nix
@@ -8,7 +8,7 @@ makePythonHook {
       propagatedBuildInputs = [ makeWrapper ];
       substitutions.sitePackages = python.sitePackages;
       substitutions.executable = python.interpreter;
-      substitutions.python = python.pythonForBuild;
+      substitutions.python = python.pythonOnBuildForHost;
       substitutions.pythonHost = python;
       substitutions.magicalSedExpression = let
         # Looks weird? Of course, it's between single quoted shell strings.
diff --git a/pkgs/development/interpreters/renpy/default.nix b/pkgs/development/interpreters/renpy/default.nix
index 4bbeb224ce3..b68c540b39c 100644
--- a/pkgs/development/interpreters/renpy/default.nix
+++ b/pkgs/development/interpreters/renpy/default.nix
@@ -59,14 +59,14 @@ in stdenv.mkDerivation rec {
 
   buildPhase = with python3.pkgs; ''
     runHook preBuild
-    ${python.pythonForBuild.interpreter} module/setup.py build --parallel=$NIX_BUILD_CORES
+    ${python.pythonOnBuildForHost.interpreter} module/setup.py build --parallel=$NIX_BUILD_CORES
     runHook postBuild
   '';
 
   installPhase = with python3.pkgs; ''
     runHook preInstall
 
-    ${python.pythonForBuild.interpreter} module/setup.py install_lib -d $out/${python.sitePackages}
+    ${python.pythonOnBuildForHost.interpreter} module/setup.py install_lib -d $out/${python.sitePackages}
     mkdir -p $out/share/renpy
     cp -vr sdk-fonts gui launcher renpy the_question tutorial renpy.py $out/share/renpy
 
diff --git a/pkgs/development/interpreters/spidermonkey/common.nix b/pkgs/development/interpreters/spidermonkey/common.nix
index 5beac058eb9..ff9bb39e0a2 100644
--- a/pkgs/development/interpreters/spidermonkey/common.nix
+++ b/pkgs/development/interpreters/spidermonkey/common.nix
@@ -65,6 +65,12 @@ stdenv.mkDerivation (finalAttrs: rec {
   ] ++ lib.optionals (lib.versionAtLeast version "91" && stdenv.hostPlatform.system == "i686-linux") [
     # Fixes i686 build, https://bugzilla.mozilla.org/show_bug.cgi?id=1729459
     ./fix-float-i686.patch
+  ] ++ lib.optionals (lib.versionAtLeast version "91" && lib.versionOlder version "102") [
+    # Fix 91 compatibility with python311
+    (fetchpatch {
+      url = "https://src.fedoraproject.org/rpms/mozjs91/raw/rawhide/f/0001-Python-Build-Use-r-instead-of-rU-file-read-modes.patch";
+      hash = "sha256-WgDIBidB9XNQ/+HacK7jxWnjOF8PEUt5eB0+Aubtl48=";
+    })
   ];
 
   nativeBuildInputs = [