about 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/acl2/default.nix2
-rw-r--r--pkgs/development/interpreters/acl2/libipasirglucose4/default.nix4
-rw-r--r--pkgs/development/interpreters/angelscript/default.nix4
-rw-r--r--pkgs/development/interpreters/anko/default.nix29
-rw-r--r--pkgs/development/interpreters/babashka/clojure-tools.nix15
-rw-r--r--pkgs/development/interpreters/babashka/completions/bb.bash5
-rw-r--r--pkgs/development/interpreters/babashka/completions/bb.fish9
-rw-r--r--pkgs/development/interpreters/babashka/completions/bb.zsh6
-rw-r--r--pkgs/development/interpreters/babashka/default.nix114
-rw-r--r--pkgs/development/interpreters/babashka/wrapped.nix59
-rw-r--r--pkgs/development/interpreters/bats/default.nix8
-rw-r--r--pkgs/development/interpreters/bats/libraries.nix57
-rw-r--r--pkgs/development/interpreters/bqn/cbqn/cbqn-bytecode.nix10
-rw-r--r--pkgs/development/interpreters/bqn/cbqn/default.nix56
-rw-r--r--pkgs/development/interpreters/bqn/cbqn/replxx.nix8
-rw-r--r--pkgs/development/interpreters/bqn/cbqn/singeli.nix8
-rw-r--r--pkgs/development/interpreters/bqn/mlochbaum-bqn/default.nix6
-rw-r--r--pkgs/development/interpreters/cel-go/default.nix38
-rw-r--r--pkgs/development/interpreters/cling/default.nix153
-rw-r--r--pkgs/development/interpreters/cling/fix-llvm-dylib-usage.patch24
-rw-r--r--pkgs/development/interpreters/cling/fix-llvm-include.patch27
-rw-r--r--pkgs/development/interpreters/cling/force-install-cling-targets.patch16
-rw-r--r--pkgs/development/interpreters/cling/no-clang-cpp.patch13
-rw-r--r--pkgs/development/interpreters/clisp/bits_ipctypes_to_sys_ipc.patch12
-rw-r--r--pkgs/development/interpreters/clisp/default.nix95
-rw-r--r--pkgs/development/interpreters/clisp/gnulib_aarch64.patch13
-rw-r--r--pkgs/development/interpreters/clisp/hg.nix98
-rw-r--r--pkgs/development/interpreters/clisp/remove-cfree-binding.patch12
-rw-r--r--pkgs/development/interpreters/clojure/babashka.nix96
-rw-r--r--pkgs/development/interpreters/clojure/default.nix23
-rw-r--r--pkgs/development/interpreters/clojure/obb.nix4
-rw-r--r--pkgs/development/interpreters/cyber/default.nix38
-rw-r--r--pkgs/development/interpreters/elixir/1.14.nix6
-rw-r--r--pkgs/development/interpreters/elixir/1.15.nix8
-rw-r--r--pkgs/development/interpreters/elixir/generic-builder.nix19
-rw-r--r--pkgs/development/interpreters/emilua/default.nix114
-rw-r--r--pkgs/development/interpreters/erlang/23.nix6
-rw-r--r--pkgs/development/interpreters/erlang/24.nix4
-rw-r--r--pkgs/development/interpreters/erlang/25.nix4
-rw-r--r--pkgs/development/interpreters/erlang/26.nix6
-rw-r--r--pkgs/development/interpreters/evcxr/default.nix13
-rw-r--r--pkgs/development/interpreters/expr/default.nix35
-rw-r--r--pkgs/development/interpreters/femtolisp/default.nix41
-rw-r--r--pkgs/development/interpreters/gauche/boot.nix6
-rw-r--r--pkgs/development/interpreters/gauche/default.nix8
-rw-r--r--pkgs/development/interpreters/gpython/default.nix47
-rw-r--r--pkgs/development/interpreters/guile/1.8.nix6
-rw-r--r--pkgs/development/interpreters/guile/2.0.nix6
-rw-r--r--pkgs/development/interpreters/guile/2.2.nix6
-rw-r--r--pkgs/development/interpreters/guile/3.0.nix23
-rw-r--r--pkgs/development/interpreters/guile/guile-hurd-posix-spawn.patch44
-rw-r--r--pkgs/development/interpreters/guile/setup-hook-1.8.sh2
-rw-r--r--pkgs/development/interpreters/guile/setup-hook-2.0.sh12
-rw-r--r--pkgs/development/interpreters/guile/setup-hook-2.2.sh12
-rw-r--r--pkgs/development/interpreters/guile/setup-hook-3.0.sh18
-rw-r--r--pkgs/development/interpreters/hugs/default.nix1
-rw-r--r--pkgs/development/interpreters/ivy/default.nix8
-rw-r--r--pkgs/development/interpreters/janet/default.nix41
-rw-r--r--pkgs/development/interpreters/jimtcl/default.nix15
-rw-r--r--pkgs/development/interpreters/joker/default.nix6
-rw-r--r--pkgs/development/interpreters/jruby/default.nix73
-rw-r--r--pkgs/development/interpreters/kamilalisp/default.nix38
-rw-r--r--pkgs/development/interpreters/kerf/default.nix2
-rw-r--r--pkgs/development/interpreters/lambda-lisp/default.nix82
-rw-r--r--pkgs/development/interpreters/lambda-lisp/sources.nix50
-rw-r--r--pkgs/development/interpreters/love/0.7-gl-prototypes.patch21
-rw-r--r--pkgs/development/interpreters/love/11.nix4
-rw-r--r--pkgs/development/interpreters/lua-5/build-luarocks-package.nix (renamed from pkgs/development/interpreters/lua-5/build-lua-package.nix)122
-rw-r--r--pkgs/development/interpreters/lua-5/default.nix44
-rw-r--r--pkgs/development/interpreters/lua-5/interpreter.nix59
-rw-r--r--pkgs/development/interpreters/lua-5/wrap-lua.nix2
-rw-r--r--pkgs/development/interpreters/luajit/2.0.nix10
-rw-r--r--pkgs/development/interpreters/luajit/2.1.nix10
-rw-r--r--pkgs/development/interpreters/luajit/default.nix9
-rw-r--r--pkgs/development/interpreters/luau/default.nix13
-rw-r--r--pkgs/development/interpreters/lunatic/default.nix27
-rw-r--r--pkgs/development/interpreters/lune/default.nix54
-rw-r--r--pkgs/development/interpreters/maude/default.nix31
-rw-r--r--pkgs/development/interpreters/micropython/default.nix7
-rw-r--r--pkgs/development/interpreters/mujs/default.nix33
-rw-r--r--pkgs/development/interpreters/nelua/default.nix18
-rw-r--r--pkgs/development/interpreters/nextflow/default.nix4
-rw-r--r--pkgs/development/interpreters/nickel/default.nix34
-rw-r--r--pkgs/development/interpreters/oak/default.nix2
-rw-r--r--pkgs/development/interpreters/octave/default.nix131
-rw-r--r--pkgs/development/interpreters/octave/patches/bug62436.patch27
-rw-r--r--pkgs/development/interpreters/octave/wrap-octave.nix2
-rw-r--r--pkgs/development/interpreters/perl/MakeMaker-cross.patch17
-rw-r--r--pkgs/development/interpreters/perl/cross.patch250
-rw-r--r--pkgs/development/interpreters/perl/default.nix318
-rw-r--r--pkgs/development/interpreters/perl/intepreter.nix261
-rw-r--r--pkgs/development/interpreters/perl/no-sys-dirs-5.38.0.patch256
-rw-r--r--pkgs/development/interpreters/perl/wrapper.nix4
-rw-r--r--pkgs/development/interpreters/php/8.1.nix6
-rw-r--r--pkgs/development/interpreters/php/8.2.nix6
-rw-r--r--pkgs/development/interpreters/php/8.3.nix (renamed from pkgs/development/interpreters/php/8.0.nix)7
-rw-r--r--pkgs/development/interpreters/php/generic.nix55
-rw-r--r--pkgs/development/interpreters/php/install-pear-nozlib-phar.nix8
-rw-r--r--pkgs/development/interpreters/php/skip-sqlite3_bind_bug68849.phpt.patch75
-rw-r--r--pkgs/development/interpreters/picolisp/default.nix2
-rw-r--r--pkgs/development/interpreters/python/catch_conflicts/catch_conflicts.py30
-rw-r--r--pkgs/development/interpreters/python/catch_conflicts/catch_conflicts_py2.py30
-rw-r--r--pkgs/development/interpreters/python/cpython/2.7/default.nix17
-rw-r--r--pkgs/development/interpreters/python/cpython/3.13/no-ldconfig.patch107
-rw-r--r--pkgs/development/interpreters/python/cpython/default.nix185
-rw-r--r--pkgs/development/interpreters/python/cpython/loongarch-support.patch50
-rw-r--r--pkgs/development/interpreters/python/cpython/platform-triplet-detection.patch295
-rw-r--r--pkgs/development/interpreters/python/default.nix185
-rw-r--r--pkgs/development/interpreters/python/hooks/default.nix89
-rw-r--r--pkgs/development/interpreters/python/hooks/flit-build-hook.sh15
-rw-r--r--pkgs/development/interpreters/python/hooks/pip-build-hook.sh11
-rw-r--r--pkgs/development/interpreters/python/hooks/pypa-build-hook-test.nix32
-rw-r--r--pkgs/development/interpreters/python/hooks/pypa-build-hook.sh19
-rw-r--r--pkgs/development/interpreters/python/hooks/pypa-install-hook.sh26
-rw-r--r--pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh17
-rw-r--r--pkgs/development/interpreters/python/hooks/setuptools-rust-hook.sh18
-rw-r--r--pkgs/development/interpreters/python/hooks/sphinx-hook.sh2
-rw-r--r--pkgs/development/interpreters/python/manylinux/default.nix2
-rw-r--r--pkgs/development/interpreters/python/mk-python-derivation.nix153
-rw-r--r--pkgs/development/interpreters/python/passthrufun.nix105
-rw-r--r--pkgs/development/interpreters/python/pypy/default.nix17
-rw-r--r--pkgs/development/interpreters/python/pypy/prebuilt.nix1
-rw-r--r--pkgs/development/interpreters/python/pypy/prebuilt_2_7.nix1
-rw-r--r--pkgs/development/interpreters/python/python-packages-base.nix20
-rw-r--r--pkgs/development/interpreters/python/python2/mk-python-derivation.nix250
-rw-r--r--pkgs/development/interpreters/python/rustpython/Cargo.lock1165
-rw-r--r--pkgs/development/interpreters/python/rustpython/default.nix24
-rw-r--r--pkgs/development/interpreters/python/tests.nix15
-rw-r--r--pkgs/development/interpreters/python/tests/test_tkinter/default.nix17
-rwxr-xr-xpkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py297
-rw-r--r--pkgs/development/interpreters/python/wrap-python.nix2
-rw-r--r--pkgs/development/interpreters/python/wrapper.nix2
-rw-r--r--pkgs/development/interpreters/quickjs/default.nix16
-rw-r--r--pkgs/development/interpreters/racket/default.nix29
-rw-r--r--pkgs/development/interpreters/racket/minimal.nix3
-rw-r--r--pkgs/development/interpreters/racket/racket_7_9.nix2
-rw-r--r--pkgs/development/interpreters/rakudo/default.nix13
-rw-r--r--pkgs/development/interpreters/rakudo/moarvm.nix18
-rw-r--r--pkgs/development/interpreters/rakudo/nqp.nix15
-rw-r--r--pkgs/development/interpreters/rakudo/zef.nix39
-rw-r--r--pkgs/development/interpreters/rascal/default.nix4
-rw-r--r--pkgs/development/interpreters/regina/default.nix24
-rw-r--r--pkgs/development/interpreters/renpy/default.nix30
-rw-r--r--pkgs/development/interpreters/renpy/renpy-system-fribidi.diff51
-rw-r--r--pkgs/development/interpreters/renpy/shutup-erofs-errors.patch28
-rw-r--r--pkgs/development/interpreters/risor/default.nix47
-rw-r--r--pkgs/development/interpreters/rlci/default.nix26
-rw-r--r--pkgs/development/interpreters/ruby/default.nix29
-rw-r--r--pkgs/development/interpreters/ruby/dev.nix2
-rw-r--r--pkgs/development/interpreters/ruby/rubygems/default.nix5
-rw-r--r--pkgs/development/interpreters/rune/default.nix37
-rw-r--r--pkgs/development/interpreters/scheme48/default.nix9
-rw-r--r--pkgs/development/interpreters/self/default.nix45
-rwxr-xr-xpkgs/development/interpreters/self/self18
-rw-r--r--pkgs/development/interpreters/shen-sbcl/default.nix1
-rw-r--r--pkgs/development/interpreters/snobol4/default.nix64
-rw-r--r--pkgs/development/interpreters/snobol4/fix-paths.patch23
-rw-r--r--pkgs/development/interpreters/spidermonkey/102.nix4
-rw-r--r--pkgs/development/interpreters/spidermonkey/115.nix4
-rw-r--r--pkgs/development/interpreters/spidermonkey/common.nix10
-rw-r--r--pkgs/development/interpreters/starlark-rust/default.nix26
-rw-r--r--pkgs/development/interpreters/starlark/default.nix10
-rw-r--r--pkgs/development/interpreters/supercollider/default.nix17
-rw-r--r--pkgs/development/interpreters/supercollider/plugins/sc3-plugins.nix4
-rw-r--r--pkgs/development/interpreters/tcl/8.6.nix4
-rw-r--r--pkgs/development/interpreters/tcl/generic.nix24
-rw-r--r--pkgs/development/interpreters/tinyscheme/default.nix2
-rw-r--r--pkgs/development/interpreters/trealla/default.nix54
-rw-r--r--pkgs/development/interpreters/wamr/default.nix38
-rw-r--r--pkgs/development/interpreters/wasm3/default.nix2
-rw-r--r--pkgs/development/interpreters/wasmer/default.nix23
-rw-r--r--pkgs/development/interpreters/wasmtime/default.nix44
-rw-r--r--pkgs/development/interpreters/wavm/default.nix26
-rw-r--r--pkgs/development/interpreters/wazero/default.nix51
-rw-r--r--pkgs/development/interpreters/yabasic/default.nix8
-rw-r--r--pkgs/development/interpreters/yaegi/default.nix45
-rw-r--r--pkgs/development/interpreters/zuo/default.nix10
177 files changed, 5536 insertions, 2400 deletions
diff --git a/pkgs/development/interpreters/acl2/default.nix b/pkgs/development/interpreters/acl2/default.nix
index 9953eaa3144c1..bf37d19cd8c4d 100644
--- a/pkgs/development/interpreters/acl2/default.nix
+++ b/pkgs/development/interpreters/acl2/default.nix
@@ -50,7 +50,7 @@ in stdenv.mkDerivation rec {
     which perl hostname
     # Some of the books require one or more of these external tools:
     glucose minisat abc-verifier libipasir
-    z3 (python3.withPackages (ps: [ ps.z3 ]))
+    z3 (python3.withPackages (ps: [ ps.z3-solver ]))
   ];
 
   # NOTE: Parallel building can be memory-intensive depending on the number of
diff --git a/pkgs/development/interpreters/acl2/libipasirglucose4/default.nix b/pkgs/development/interpreters/acl2/libipasirglucose4/default.nix
index dc8308267f40e..e59d2ed7c176a 100644
--- a/pkgs/development/interpreters/acl2/libipasirglucose4/default.nix
+++ b/pkgs/development/interpreters/acl2/libipasirglucose4/default.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
   # that as the version number, I guess.
   version = "2017";
 
-  libname = pname + stdenv.targetPlatform.extensions.sharedLibrary;
+  libname = pname + stdenv.hostPlatform.extensions.sharedLibrary;
 
   src = fetchurl {
     url = "https://baldur.iti.kit.edu/sat-competition-2017/solvers/incremental/glucose-ipasir.zip";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   postBuild = ''
     $CXX -shared -o ${libname} \
-        ${if stdenv.cc.isClang then "" else "-Wl,-soname,${libname}"} \
+        ${lib.optionalString (!stdenv.cc.isClang) "-Wl,-soname,${libname}"} \
         ipasirglucoseglue.o libipasirglucose4.a
   '';
 
diff --git a/pkgs/development/interpreters/angelscript/default.nix b/pkgs/development/interpreters/angelscript/default.nix
index 5aa19f665a82f..24ac89eb4c5b0 100644
--- a/pkgs/development/interpreters/angelscript/default.nix
+++ b/pkgs/development/interpreters/angelscript/default.nix
@@ -7,11 +7,11 @@
 
 stdenv.mkDerivation rec {
   pname = "angelscript";
-  version = "2.36.0";
+  version = "2.36.1";
 
   src = fetchurl {
     url = "https://www.angelcode.com/angelscript/sdk/files/angelscript_${version}.zip";
-    sha256 = "sha256-M/lfdZe8DYiwl9NeexMg0VQZ/8V3mFHZ0qbMzsV4EbM=";
+    sha256 = "sha256-WLt0mvnH44YwRwX05uYnrkHf4D4LanPD0NLgF8T8lI8=";
   };
 
   nativeBuildInputs = [ unzip cmake ];
diff --git a/pkgs/development/interpreters/anko/default.nix b/pkgs/development/interpreters/anko/default.nix
new file mode 100644
index 0000000000000..f88534e9ecf83
--- /dev/null
+++ b/pkgs/development/interpreters/anko/default.nix
@@ -0,0 +1,29 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+}:
+
+buildGoModule rec {
+  pname = "anko";
+  version = "0.1.9";
+
+  src = fetchFromGitHub {
+    owner = "mattn";
+    repo = "anko";
+    rev = "v${version}";
+    hash = "sha256-ZVNkQu5IxBx3f+FkUWc36EOEcY176wQJ2ravLPQAHAA=";
+  };
+
+  vendorHash = null;
+
+  ldflags = [ "-s" "-w" ];
+
+  __darwinAllowLocalNetworking = true;
+
+  meta = with lib; {
+    description = "Scriptable interpreter written in golang";
+    homepage = "https://github.com/mattn/anko";
+    license = licenses.mit;
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/pkgs/development/interpreters/babashka/clojure-tools.nix b/pkgs/development/interpreters/babashka/clojure-tools.nix
new file mode 100644
index 0000000000000..732b3631583b2
--- /dev/null
+++ b/pkgs/development/interpreters/babashka/clojure-tools.nix
@@ -0,0 +1,15 @@
+# This file tracks the Clojure tools version required by babashka.
+# See https://github.com/borkdude/deps.clj#deps_clj_tools_version for background.
+# The `updateScript` provided in default.nix takes care of keeping it in sync, as well.
+{ clojure
+, fetchurl
+}:
+clojure.overrideAttrs (previousAttrs: {
+  pname = "babashka-clojure-tools";
+  version = "1.11.1.1413";
+
+  src = fetchurl {
+    url = previousAttrs.src.url;
+    hash = "sha256-k8Olo63KUcWFgGNBmr9myD2/JOoV4f2S95v35mI4H+A=";
+  };
+})
diff --git a/pkgs/development/interpreters/babashka/completions/bb.bash b/pkgs/development/interpreters/babashka/completions/bb.bash
new file mode 100644
index 0000000000000..9746fd02a0580
--- /dev/null
+++ b/pkgs/development/interpreters/babashka/completions/bb.bash
@@ -0,0 +1,5 @@
+_bb_tasks() {
+    COMPREPLY=( $(compgen -W "$(bb tasks |tail -n +3 |cut -f1 -d ' ')" -- ${COMP_WORDS[COMP_CWORD]}) );
+}
+# autocomplete filenames as well
+complete -f -F _bb_tasks bb
diff --git a/pkgs/development/interpreters/babashka/completions/bb.fish b/pkgs/development/interpreters/babashka/completions/bb.fish
new file mode 100644
index 0000000000000..36cf89fbced77
--- /dev/null
+++ b/pkgs/development/interpreters/babashka/completions/bb.fish
@@ -0,0 +1,9 @@
+function __bb_complete_tasks
+  if not test "$__bb_tasks"
+    set -g __bb_tasks (bb tasks |tail -n +3 |cut -f1 -d ' ')
+  end
+
+  printf "%s\n" $__bb_tasks
+end
+
+complete -c bb -a "(__bb_complete_tasks)" -d 'tasks'
diff --git a/pkgs/development/interpreters/babashka/completions/bb.zsh b/pkgs/development/interpreters/babashka/completions/bb.zsh
new file mode 100644
index 0000000000000..5082197405293
--- /dev/null
+++ b/pkgs/development/interpreters/babashka/completions/bb.zsh
@@ -0,0 +1,6 @@
+_bb_tasks() {
+    local matches=(`bb tasks |tail -n +3 |cut -f1 -d ' '`)
+    compadd -a matches
+    _files # autocomplete filenames as well
+}
+compdef _bb_tasks bb
diff --git a/pkgs/development/interpreters/babashka/default.nix b/pkgs/development/interpreters/babashka/default.nix
new file mode 100644
index 0000000000000..c56ca1ed252c3
--- /dev/null
+++ b/pkgs/development/interpreters/babashka/default.nix
@@ -0,0 +1,114 @@
+{ lib
+, buildGraalvmNativeImage
+, graalvmCEPackages
+, fetchurl
+, writeScript
+, installShellFiles
+}:
+
+let
+  babashka-unwrapped = buildGraalvmNativeImage rec {
+    pname = "babashka-unwrapped";
+    version = "1.3.186";
+
+    src = fetchurl {
+      url = "https://github.com/babashka/babashka/releases/download/v${version}/babashka-${version}-standalone.jar";
+      sha256 = "sha256-T7inTJHSnUySituU0fcgZ0xWjIY3yb8BlSakqym67ew=";
+    };
+
+    graalvmDrv = graalvmCEPackages.graalvm-ce;
+
+    executable = "bb";
+
+    nativeBuildInputs = [ installShellFiles ];
+
+    extraNativeImageBuildArgs = [
+      "-H:+ReportExceptionStackTraces"
+      "--no-fallback"
+      "--native-image-info"
+      "--enable-preview"
+    ];
+
+    doInstallCheck = true;
+
+    installCheckPhase = ''
+      $out/bin/bb --version | fgrep '${version}'
+      $out/bin/bb '(+ 1 2)' | fgrep '3'
+      $out/bin/bb '(vec (dedupe *input*))' <<< '[1 1 1 1 2]' | fgrep '[1 2]'
+      $out/bin/bb '(prn "bépo àê")' | fgrep 'bépo àê'
+    '';
+
+    postInstall = ''
+      installShellCompletion --cmd bb --bash ${./completions/bb.bash}
+      installShellCompletion --cmd bb --zsh ${./completions/bb.zsh}
+      installShellCompletion --cmd bb --fish ${./completions/bb.fish}
+    '';
+
+    passthru.updateScript = writeScript "update-babashka" ''
+      #!/usr/bin/env nix-shell
+      #!nix-shell -i bash -p curl common-updater-scripts jq libarchive
+
+      set -euo pipefail
+      shopt -s inherit_errexit
+
+      latest_version="$(curl \
+        ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
+        -fsL "https://api.github.com/repos/babashka/babashka/releases/latest" \
+        | jq -r '.tag_name')"
+
+      if [ "$(update-source-version babashka-unwrapped "''${latest_version/v/}" --print-changes)" = "[]" ]; then
+        # no need to update babashka.clojure-tools when babashka-unwrapped wasn't updated
+        exit 0
+      fi
+
+      clojure_tools_version=$(curl \
+        -fsL \
+        "https://github.com/babashka/babashka/releases/download/''${latest_version}/babashka-''${latest_version/v/}-standalone.jar" \
+        | bsdtar -qxOf - borkdude/deps.clj \
+        | ${babashka-unwrapped}/bin/bb -I -o -e "(or (some->> *input* (filter #(= '(def version) (take 2 %))) first last last last) (throw (ex-info \"Couldn't find expected '(def version ...)' form in 'borkdude/deps.clj'.\" {})))")
+
+      update-source-version babashka.clojure-tools "$clojure_tools_version" \
+        --file="pkgs/development/interpreters/babashka/clojure-tools.nix"
+    '';
+
+    meta = with lib; {
+      description = "A Clojure babushka for the grey areas of Bash";
+      longDescription = ''
+        The main idea behind babashka is to leverage Clojure in places where you
+        would be using bash otherwise.
+
+        As one user described it:
+
+            I’m quite at home in Bash most of the time, but there’s a substantial
+            grey area of things that are too complicated to be simple in bash, but
+            too simple to be worth writing a clj/s script for. Babashka really
+            seems to hit the sweet spot for those cases.
+
+        Goals:
+
+        - Low latency Clojure scripting alternative to JVM Clojure.
+        - Easy installation: grab the self-contained binary and run. No JVM needed.
+        - Familiarity and portability:
+          - Scripts should be compatible with JVM Clojure as much as possible
+          - Scripts should be platform-independent as much as possible. Babashka
+            offers support for linux, macOS and Windows.
+        - Allow interop with commonly used classes like java.io.File and System
+        - Multi-threading support (pmap, future, core.async)
+        - Batteries included (tools.cli, cheshire, ...)
+        - Library support via popular tools like the clojure CLI
+      '';
+      homepage = "https://github.com/babashka/babashka";
+      changelog = "https://github.com/babashka/babashka/blob/v${version}/CHANGELOG.md";
+      sourceProvenance = with sourceTypes; [ binaryBytecode ];
+      license = licenses.epl10;
+      maintainers = with maintainers; [
+        bandresen
+        bhougland
+        DerGuteMoritz
+        jlesquembre
+        thiagokokada
+      ];
+    };
+  };
+in
+babashka-unwrapped
diff --git a/pkgs/development/interpreters/babashka/wrapped.nix b/pkgs/development/interpreters/babashka/wrapped.nix
new file mode 100644
index 0000000000000..29468265eb9c1
--- /dev/null
+++ b/pkgs/development/interpreters/babashka/wrapped.nix
@@ -0,0 +1,59 @@
+{ stdenvNoCC
+, lib
+, babashka-unwrapped
+, callPackage
+, makeWrapper
+, installShellFiles
+, rlwrap
+, clojureToolsBabashka ? callPackage ./clojure-tools.nix { }
+, jdkBabashka ? clojureToolsBabashka.jdk
+
+  # rlwrap is a small utility to allow the editing of keyboard input, see
+  # https://book.babashka.org/#_repl
+  #
+  # NOTE In some cases, rlwrap prints some extra empty lines. That behavior can
+  # break some babashka scripts. For this reason, it is disabled by default. See:
+  # https://github.com/NixOS/nixpkgs/issues/246839
+  # https://github.com/NixOS/nixpkgs/pull/248207
+, withRlwrap ? false
+}:
+stdenvNoCC.mkDerivation (finalAttrs: {
+  pname = "babashka";
+  inherit (babashka-unwrapped) version meta doInstallCheck;
+
+  dontUnpack = true;
+  dontBuild = true;
+
+  nativeBuildInputs = [ makeWrapper installShellFiles ];
+
+  installPhase =
+    let unwrapped-bin = "${babashka-unwrapped}/bin/bb"; in
+    ''
+      mkdir -p $out/clojure_tools
+      ln -s -t $out/clojure_tools ${clojureToolsBabashka}/*.edn
+      ln -s -t $out/clojure_tools ${clojureToolsBabashka}/libexec/*
+
+      makeWrapper "${babashka-unwrapped}/bin/bb" "$out/bin/bb" \
+        --inherit-argv0 \
+        --set-default DEPS_CLJ_TOOLS_DIR $out/clojure_tools \
+        --set-default JAVA_HOME ${jdkBabashka}
+
+      installShellCompletion --cmd bb --bash ${babashka-unwrapped}/share/bash-completion/completions/bb.bash
+      installShellCompletion --cmd bb --zsh ${babashka-unwrapped}/share/fish/vendor_completions.d/bb.fish
+      installShellCompletion --cmd bb --fish ${babashka-unwrapped}/share/zsh/site-functions/_bb
+    '' +
+    lib.optionalString withRlwrap ''
+      substituteInPlace $out/bin/bb \
+        --replace '"${unwrapped-bin}"' '"${rlwrap}/bin/rlwrap" "${unwrapped-bin}"'
+    '';
+
+  installCheckPhase = ''
+    ${babashka-unwrapped.installCheckPhase}
+    # Needed for Darwin compat, see https://github.com/borkdude/deps.clj/issues/114
+    export CLJ_CONFIG="$TMP/.clojure"
+    $out/bin/bb clojure --version | grep -wF '${clojureToolsBabashka.version}'
+  '';
+
+  passthru.unwrapped = babashka-unwrapped;
+  passthru.clojure-tools = clojureToolsBabashka;
+})
diff --git a/pkgs/development/interpreters/bats/default.nix b/pkgs/development/interpreters/bats/default.nix
index 97a209f208411..afffef1d1f680 100644
--- a/pkgs/development/interpreters/bats/default.nix
+++ b/pkgs/development/interpreters/bats/default.nix
@@ -22,13 +22,13 @@
 
 resholve.mkDerivation rec {
   pname = "bats";
-  version = "1.9.0";
+  version = "1.10.0";
 
   src = fetchFromGitHub {
     owner = "bats-core";
     repo = "bats-core";
     rev = "v${version}";
-    sha256 = "sha256-nKBNbqJYRd/3tO85E6KrOh32yOaNKpLXxz5gQ5Uvmcc=";
+    sha256 = "sha256-gy4dyoKRlf2WFmH1/mSNwhVR3df92BgpT4TjTpV4FyQ=";
   };
 
   patchPhase = ''
@@ -93,6 +93,7 @@ resholve.mkDerivation rec {
         "${placeholder "out"}/libexec/bats-core/bats-exec-test" = true;
         "$BATS_LINE_REFERENCE_FORMAT" = "comma_line";
         "$BATS_LOCKING_IMPLEMENTATION" = "${flock}/bin/flock";
+        "$parallel_binary_name" = "${parallel}/bin/parallel";
       };
       execer = [
         /*
@@ -139,6 +140,7 @@ resholve.mkDerivation rec {
         bats_load_library bats-support
         bats_load_library bats-assert
         bats_load_library bats-file
+        bats_load_library bats-detik/detik.bash
 
         bats_require_minimum_version 1.5.0
 
@@ -169,7 +171,7 @@ resholve.mkDerivation rec {
     '';
     passAsFile = [ "testScript" ];
   } ''
-    ${bats.withLibraries (p: [ p.bats-support p.bats-assert p.bats-file ])}/bin/bats "$testScriptPath"
+    ${bats.withLibraries (p: [ p.bats-support p.bats-assert p.bats-file p.bats-detik ])}/bin/bats "$testScriptPath"
     touch "$out"
   '';
 
diff --git a/pkgs/development/interpreters/bats/libraries.nix b/pkgs/development/interpreters/bats/libraries.nix
index 9e60a4dc992ce..a7d5e2b87747b 100644
--- a/pkgs/development/interpreters/bats/libraries.nix
+++ b/pkgs/development/interpreters/bats/libraries.nix
@@ -1,18 +1,20 @@
 { lib, stdenv, fetchFromGitHub }: {
-  bats-assert = stdenv.mkDerivation rec {
+  bats-assert = stdenv.mkDerivation (finalAttrs: {
     pname = "bats-assert";
     version = "2.1.0";
     src = fetchFromGitHub {
       owner = "bats-core";
       repo = "bats-assert";
-      rev = "v${version}";
-      sha256 = "sha256-opgyrkqTwtnn/lUjMebbLfS/3sbI2axSusWd5i/5wm4=";
+      rev = "v${finalAttrs.version}";
+      hash = "sha256-opgyrkqTwtnn/lUjMebbLfS/3sbI2axSusWd5i/5wm4=";
     };
     dontBuild = true;
     installPhase = ''
+      runHook preInstall
       mkdir -p "$out/share/bats/bats-assert"
       cp load.bash "$out/share/bats/bats-assert"
       cp -r src "$out/share/bats/bats-assert"
+      runHook postInstall
     '';
     meta = {
       description = "Common assertions for Bats";
@@ -21,22 +23,24 @@
       license = lib.licenses.cc0;
       maintainers = with lib.maintainers; [ infinisil ];
     };
-  };
+  });
 
-  bats-file = stdenv.mkDerivation rec {
+  bats-file = stdenv.mkDerivation (finalAttrs: {
     pname = "bats-file";
-    version = "0.3.0";
+    version = "0.4.0";
     src = fetchFromGitHub {
       owner = "bats-core";
       repo = "bats-file";
-      rev = "v${version}";
-      sha256 = "sha256-3xevy0QpwNZrEe+2IJq58tKyxQzYx8cz6dD2nz7fYUM=";
+      rev = "v${finalAttrs.version}";
+      hash = "sha256-NJzpu1fGAw8zxRKFU2awiFM2Z3Va5WONAD2Nusgrf4o=";
     };
     dontBuild = true;
     installPhase = ''
+      runHook preInstall
       mkdir -p "$out/share/bats/bats-file"
       cp load.bash "$out/share/bats/bats-file"
       cp -r src "$out/share/bats/bats-file"
+      runHook postInstall
     '';
     meta = {
       description = "Common filesystem assertions for Bats";
@@ -45,22 +49,49 @@
       license = lib.licenses.cc0;
       maintainers = with lib.maintainers; [ infinisil ];
     };
-  };
+  });
+
+  bats-detik = stdenv.mkDerivation (finalAttrs: {
+    pname = "bats-detik";
+    version = "1.2.1";
+    src = fetchFromGitHub {
+      owner = "bats-core";
+      repo = "bats-detik";
+      rev = "v${finalAttrs.version}";
+      hash = "sha256-2BEIqRSc21oPjd9BgTLg5mGyAdNJYA2b7gZe7Nj2dks=";
+    };
+    dontBuild = true;
+    installPhase = ''
+      runHook preInstall
+      mkdir -p "$out/share/bats/bats-detik"
+      cp -r lib/* "$out/share/bats/bats-detik"
+      runHook postInstall
+    '';
+    meta = {
+      description = "Library to ease e2e tests of applications in K8s environments";
+      platforms = lib.platforms.all;
+      homepage = "https://github.com/bats-core/bats-detik";
+      license = lib.licenses.mit;
+      maintainers = with lib.maintainers; [ brokenpip3 ];
+    };
+  });
 
-  bats-support = stdenv.mkDerivation rec {
+  bats-support = stdenv.mkDerivation (finalAttrs: {
     pname = "bats-support";
     version = "0.3.0";
     src = fetchFromGitHub {
       owner = "bats-core";
       repo = "bats-support";
-      rev = "v${version}";
-      sha256 = "sha256-4N7XJS5XOKxMCXNC7ef9halhRpg79kUqDuRnKcrxoeo=";
+      rev = "v${finalAttrs.version}";
+      hash = "sha256-4N7XJS5XOKxMCXNC7ef9halhRpg79kUqDuRnKcrxoeo=";
     };
     dontBuild = true;
     installPhase = ''
+      runHook preInstall
       mkdir -p "$out/share/bats/bats-support"
       cp load.bash "$out/share/bats/bats-support"
       cp -r src "$out/share/bats/bats-support"
+      runHook postInstall
     '';
     meta = {
       description = "Supporting library for Bats test helpers";
@@ -69,5 +100,5 @@
       license = lib.licenses.cc0;
       maintainers = with lib.maintainers; [ infinisil ];
     };
-  };
+  });
 }
diff --git a/pkgs/development/interpreters/bqn/cbqn/cbqn-bytecode.nix b/pkgs/development/interpreters/bqn/cbqn/cbqn-bytecode.nix
index 85e78f86cc3bd..d311f3d61ebd4 100644
--- a/pkgs/development/interpreters/bqn/cbqn/cbqn-bytecode.nix
+++ b/pkgs/development/interpreters/bqn/cbqn/cbqn-bytecode.nix
@@ -5,13 +5,13 @@
 
 stdenvNoCC.mkDerivation {
   pname = "cbqn-bytecode";
-  version = "unstable-2023-01-27";
+  version = "unstable-2023-05-17";
 
   src = fetchFromGitHub {
     owner = "dzaima";
     repo = "cbqnBytecode";
-    rev = "b2f47806ea770451d06d04e20177baeaec92e6dd";
-    hash = "sha256-dukpEB5qg6jF4AIHKK+atTvCKZTVtJ1M/nw7+SNp250=";
+    rev = "32db4dfbfc753835bf112f3d8ae2991d8aebbe3d";
+    hash = "sha256-9uBPrEESn/rB9u0xXwKaQ7ABveQWPc8LRMPlnI/79kg=";
   };
 
   dontConfigure = true;
@@ -20,7 +20,7 @@ stdenvNoCC.mkDerivation {
   installPhase = ''
     runHook preInstall
 
-    install -D $src/gen/{compiles,explain,formatter,runtime0,runtime1,src} -t $out/dev
+    install -D $src/gen/{compiles,explain,formatter,runtime0,runtime1,runtime1x,src} -t $out/dev
 
     runHook postInstall
   '';
@@ -29,7 +29,7 @@ stdenvNoCC.mkDerivation {
     homepage = "https://github.com/dzaima/cbqnBytecode";
     description = "CBQN precompiled bytecode";
     license = licenses.gpl3Plus;
-    maintainers = with maintainers; [ AndersonTorres sternenseemann synthetica shnarazk ];
+    maintainers = with maintainers; [ AndersonTorres sternenseemann synthetica shnarazk detegr ];
     platforms = platforms.all;
   };
 }
diff --git a/pkgs/development/interpreters/bqn/cbqn/default.nix b/pkgs/development/interpreters/bqn/cbqn/default.nix
index 632aa8ca1e480..6f5b889883910 100644
--- a/pkgs/development/interpreters/bqn/cbqn/default.nix
+++ b/pkgs/development/interpreters/bqn/cbqn/default.nix
@@ -3,13 +3,12 @@
 , stdenv
 , stdenvNoCC
 , fetchFromGitHub
+, fixDarwinDylibNames
 , genBytecode ? false
 , bqn-path ? null
-, mbqn-source ? null
+, mbqn-source
 , enableReplxx ? false
-, enableSingeli ? stdenv.hostPlatform.avx2Support
-  # No support for macOS' .dylib on the CBQN side
-, enableLibcbqn ? stdenv.hostPlatform.isLinux
+, enableLibcbqn ? ((stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isDarwin) && !enableReplxx)
 , libffi
 , pkg-config
 }:
@@ -24,37 +23,42 @@ assert genBytecode -> ((bqn-path != null) && (mbqn-source != null));
 
 stdenv.mkDerivation rec {
   pname = "cbqn" + lib.optionalString (!genBytecode) "-standalone";
-  version = "unstable-2023-02-01";
+  version = "0.5.0";
 
   src = fetchFromGitHub {
     owner = "dzaima";
     repo = "CBQN";
-    rev = "05c1270344908e98c9f2d06b3671c3646f8634c3";
-    hash = "sha256-wKeyYWMgTZPr+Ienz3xnsXeD67vwdK4sXbQlW+GpQho=";
+    rev = "v${version}";
+    hash = "sha256-PCpePevWQ+aPG6Yx3WqBZ4yTeyJsCGkYMSY6kzGDL1U=";
   };
 
   nativeBuildInputs = [
     pkg-config
-  ];
+  ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
   buildInputs = [
     libffi
   ];
 
   dontConfigure = true;
+  doInstallCheck = true;
 
   postPatch = ''
     sed -i '/SHELL =.*/ d' makefile
+    patchShebangs build/build
   '';
 
   makeFlags = [
     "CC=${stdenv.cc.targetPrefix}cc"
-  ]
-  ++ lib.optional enableReplxx "REPLXX=1";
+  ];
 
   buildFlags = [
     # interpreter binary
-    (lib.flatten (if enableSingeli then ["o3n-singeli" "f='-mavx2'"] else ["o3"]))
+    "o3"
+    "notui=1" # display build progress in a plain-text format
+    "REPLXX=${if enableReplxx then "1" else "0"}"
+  ] ++ lib.optionals stdenv.hostPlatform.avx2Support [
+    "has=avx2"
   ] ++ lib.optionals enableLibcbqn [
     # embeddable interpreter as a shared lib
     "shared-o3"
@@ -63,6 +67,7 @@ stdenv.mkDerivation rec {
   preBuild = ''
     # Purity: avoids git downloading bytecode files
     mkdir -p build/bytecodeLocal/gen
+    cp -r ${singeli-submodule}/dev/* build/singeliLocal/
   '' + (if genBytecode then ''
     ${bqn-path} ./build/genRuntime ${mbqn-source} build/bytecodeLocal/
   '' else ''
@@ -70,10 +75,7 @@ stdenv.mkDerivation rec {
   '')
   + lib.optionalString enableReplxx ''
     cp -r ${replxx-submodule}/dev/* build/replxxLocal/
-  ''
-  + lib.optionalString enableSingeli ''
-    cp -r ${singeli-submodule}/dev/* build/singeliLocal/
- '';
+  '';
 
   outputs = [
     "out"
@@ -99,12 +101,32 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
+  installCheckPhase = ''
+    runHook preInstallCheck
+
+    # main test suite from mlochbaum/BQN
+    $out/bin/BQN ${mbqn-source}/test/this.bqn
+
+    # CBQN tests that do not require compiling with test-only flags
+    $out/bin/BQN test/cmp.bqn
+    $out/bin/BQN test/equal.bqn
+    $out/bin/BQN test/copy.bqn
+    $out/bin/BQN test/bit.bqn
+    $out/bin/BQN test/hash.bqn
+    $out/bin/BQN test/squeezeValid.bqn
+    $out/bin/BQN test/squeezeExact.bqn
+    $out/bin/BQN test/various.bqn
+    $out/bin/BQN test/random.bqn
+
+    runHook postInstallCheck
+  '';
+
   meta = with lib; {
     homepage = "https://github.com/dzaima/CBQN/";
     description = "BQN implementation in C";
     license = licenses.gpl3Plus;
-    maintainers = with maintainers; [ AndersonTorres sternenseemann synthetica shnarazk ];
+    maintainers = with maintainers; [ AndersonTorres sternenseemann synthetica shnarazk detegr ];
     platforms = platforms.all;
+    mainProgram = "cbqn";
   };
 }
-# TODO: test suite
diff --git a/pkgs/development/interpreters/bqn/cbqn/replxx.nix b/pkgs/development/interpreters/bqn/cbqn/replxx.nix
index afe6cef2aed34..71b479a4cda48 100644
--- a/pkgs/development/interpreters/bqn/cbqn/replxx.nix
+++ b/pkgs/development/interpreters/bqn/cbqn/replxx.nix
@@ -5,13 +5,13 @@
 
 stdenvNoCC.mkDerivation {
   pname = "replxx";
-  version = "unstable-2023-01-21";
+  version = "unstable-2023-10-31";
 
   src = fetchFromGitHub {
     owner = "dzaima";
     repo = "replxx";
-    rev = "eb6bcecff4ca6051120c99e9dd64c3bd20fcc42f";
-    hash = "sha256-cb486FGF+4sUxgBbRfnbTTnZn2WQ3p93fSwDRCEtFJg=";
+    rev = "13f7b60f4f79c2f14f352a76d94860bad0fc7ce9";
+    hash = "sha256-xPuQ5YBDSqhZCwssbaN/FcTZlc3ampYl7nfl2bbsgBA=";
   };
 
   dontConfigure = true;
@@ -31,7 +31,7 @@ stdenvNoCC.mkDerivation {
     homepage = "https://github.com/dzaima/replxx";
     description = "A replxx fork for CBQN";
     license = licenses.free;
-    maintainers = with maintainers; [ AndersonTorres sternenseemann synthetica shnarazk ];
+    maintainers = with maintainers; [ AndersonTorres sternenseemann synthetica shnarazk detegr ];
     platforms = platforms.all;
   };
 }
diff --git a/pkgs/development/interpreters/bqn/cbqn/singeli.nix b/pkgs/development/interpreters/bqn/cbqn/singeli.nix
index 3dfade53dfc25..212b96b6cb3f0 100644
--- a/pkgs/development/interpreters/bqn/cbqn/singeli.nix
+++ b/pkgs/development/interpreters/bqn/cbqn/singeli.nix
@@ -5,13 +5,13 @@
 
 stdenvNoCC.mkDerivation {
   pname = "singeli";
-  version = "unstable-2023-01-23";
+  version = "unstable-2023-11-22";
 
   src = fetchFromGitHub {
     owner = "mlochbaum";
     repo = "Singeli";
-    rev = "0bc519ccbbe4051204d40bfc861a5bed7132e95f";
-    hash = "sha256-zo4yr9t3hp6BOX1ac3md6R/O+hl5MphZdCmI8nNP9Yc=";
+    rev = "528faaf9e2a7f4f3434365bcd91d6c18c87c4f08";
+    hash = "sha256-/z1KHqflCqPGC9JU80jtgqdk2mkX06eWSziuf4TU4TM=";
   };
 
   dontConfigure = true;
@@ -31,7 +31,7 @@ stdenvNoCC.mkDerivation {
     homepage = "https://github.com/mlochbaum/Singeli";
     description = "A metaprogramming DSL for SIMD";
     license = licenses.isc;
-    maintainers = with maintainers; [ AndersonTorres sternenseemann synthetica shnarazk ];
+    maintainers = with maintainers; [ AndersonTorres sternenseemann synthetica shnarazk detegr ];
     platforms = platforms.all;
   };
 }
diff --git a/pkgs/development/interpreters/bqn/mlochbaum-bqn/default.nix b/pkgs/development/interpreters/bqn/mlochbaum-bqn/default.nix
index 1390eebe44efe..d217ec99ebe5a 100644
--- a/pkgs/development/interpreters/bqn/mlochbaum-bqn/default.nix
+++ b/pkgs/development/interpreters/bqn/mlochbaum-bqn/default.nix
@@ -7,13 +7,13 @@
 
 stdenvNoCC.mkDerivation rec {
   pname = "bqn";
-  version = "0.pre+date=2022-11-24";
+  version = "unstable-2023-05-17";
 
   src = fetchFromGitHub {
     owner = "mlochbaum";
     repo = "BQN";
-    rev = "976bd82fb0e830876cca117c302c8a19048033a4";
-    hash = "sha256:1nhn30ypc2zvq58b3zi66ypc9wv3v8cryn43cqihazc1lq8qxqdw";
+    rev = "070bd07dc10c291695215265218ec0ff856ce457";
+    hash = "sha256-GRIIzJwlJ+JTBHXZjoX/9vLFbAC7zyeuqVcrA/Jm/NA=";
   };
 
   nativeBuildInputs = [ makeWrapper ];
diff --git a/pkgs/development/interpreters/cel-go/default.nix b/pkgs/development/interpreters/cel-go/default.nix
new file mode 100644
index 0000000000000..821e8da2ee34e
--- /dev/null
+++ b/pkgs/development/interpreters/cel-go/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+}:
+
+buildGoModule rec {
+  pname = "cel-go";
+  version = "0.18.2";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "cel-go";
+    rev = "v${version}";
+    hash = "sha256-c4MVOHkDaUGlRVYb9YS9BH4ld2zS3SR5efP6amLhTig=";
+  };
+
+  modRoot = "repl";
+
+  vendorHash = "sha256-Oj/XUUmuj5scD5WT6zBxnU1hSapDyRBBz75rbIdY4Ho=";
+
+  subPackages = [
+    "main"
+  ];
+
+  ldflags = [ "-s" "-w" ];
+
+  postInstall = ''
+    mv $out/bin/{main,cel-go}
+  '';
+
+  meta = with lib; {
+    description = "Fast, portable, non-Turing complete expression evaluation with gradual typing";
+    homepage = "https://github.com/google/cel-go";
+    changelog = "https://github.com/google/cel-go/releases/tag/${src.rev}";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/pkgs/development/interpreters/cling/default.nix b/pkgs/development/interpreters/cling/default.nix
index 1ec265f305b6d..f59c1910a6ff6 100644
--- a/pkgs/development/interpreters/cling/default.nix
+++ b/pkgs/development/interpreters/cling/default.nix
@@ -1,57 +1,119 @@
-{ lib, stdenv
-, python3
-, libffi
-, git
-, cmake
-, zlib
+{ cmake
+, fetchFromGitHub
 , fetchgit
+, git
+, lib
+, libffi
+, llvmPackages_9
 , makeWrapper
-, runCommand
-, llvmPackages_5
-, glibc
 , ncurses
+, python3
+, runCommand
+, zlib
+
+# *NOT* from LLVM 9!
+# The compiler used to compile Cling may affect the runtime include and lib
+# directories it expects to be run with. Cling builds against (a fork of) Clang,
+# so we prefer to use Clang as the compiler as well for consistency.
+# It would be cleanest to use LLVM 9's clang, but it errors. So, we use a later
+# version of Clang to compile, but we check out the Cling fork of Clang 9 to
+# build Cling against.
+, clangStdenv
+
+# For runtime C++ standard library
+, gcc-unwrapped
+
+# Build with debug symbols
+, debug ? false
+
+# Build with libc++ (LLVM) rather than stdlibc++ (GCC).
+# This is experimental and not all features work.
+, useLLVMLibcxx ? false
 }:
 
 let
+  stdenv = clangStdenv;
+
+  # The LLVM 9 headers have a couple bugs we need to patch
+  fixedLlvmDev = runCommand "llvm-dev-${llvmPackages_9.llvm.version}" { buildInputs = [git]; } ''
+    mkdir $out
+    cp -r ${llvmPackages_9.llvm.dev}/include $out
+    cd $out
+    chmod -R u+w include
+    git apply ${./fix-llvm-include.patch}
+  '';
+
   unwrapped = stdenv.mkDerivation rec {
     pname = "cling-unwrapped";
-    version = "0.7";
+    version = "0.9";
 
     src = fetchgit {
       url = "http://root.cern/git/clang.git";
-      # This commit has the tag cling-0.7 so we use it, even though cpt.py
-      # tries to use refs/tags/cling-patches-rrelease_50
-      rev = "354b25b5d915ff3b1946479ad07f3f2768ea1621";
-      branchName = "cling-patches";
-      sha256 = "0q8q2nnvjx3v59ng0q3qqqhzmzf4pmfqqiy3rz1f3drx5w3lgyjg";
+      rev = "cling-v0.9";
+      sha256 = "sha256-ft1NUIclSiZ9lN3Z3DJCWA0U9q/K1M0TKkZr+PjsFYk=";
     };
 
-    clingSrc = fetchgit {
-      url = "http://root.cern/git/cling.git";
-      rev = "70163975eee5a76b45a1ca4016bfafebc9b57e07";
-      sha256 = "1mv2fhk857kp5rq714bq49iv7gy9fgdwibydj5wy1kq2m3sf3ysi";
+    clingSrc = fetchFromGitHub {
+      owner = "root-project";
+      repo = "cling";
+      rev = "v0.9";
+      sha256 = "0wx3fi19wfjcph5kclf8108i436y79ddwakrcf0lgxnnxhdjyd29";
     };
 
-    preConfigure = ''
+    prePatch = ''
       echo "add_llvm_external_project(cling)" >> tools/CMakeLists.txt
+
       cp -r $clingSrc ./tools/cling
       chmod -R a+w ./tools/cling
     '';
 
-    nativeBuildInputs = [ python3 git cmake llvmPackages_5.llvm.dev ];
-    buildInputs = [ libffi llvmPackages_5.llvm zlib ncurses ];
+    patches = [
+      ./no-clang-cpp.patch
+
+      # https://github.com/root-project/root/commit/286d96b12aad8688b9d8e4b3b5df843dcfb716a8
+      ./fix-llvm-dylib-usage.patch
+
+      ./force-install-cling-targets.patch
+    ];
+
+    nativeBuildInputs = [ python3 git cmake ];
+    buildInputs = [ libffi ncurses zlib ];
 
     strictDeps = true;
 
     cmakeFlags = [
+      "-DLLVM_BINARY_DIR=${llvmPackages_9.llvm.out}"
+      "-DLLVM_CONFIG=${llvmPackages_9.llvm.dev}/bin/llvm-config"
+      "-DLLVM_LIBRARY_DIR=${llvmPackages_9.llvm.lib}/lib"
+      "-DLLVM_MAIN_INCLUDE_DIR=${fixedLlvmDev}/include"
+      "-DLLVM_TABLEGEN_EXE=${llvmPackages_9.llvm.out}/bin/llvm-tblgen"
+      "-DLLVM_TOOLS_BINARY_DIR=${llvmPackages_9.llvm.out}/bin"
+      "-DLLVM_BUILD_TOOLS=Off"
+      "-DLLVM_TOOL_CLING_BUILD=ON"
+
       "-DLLVM_TARGETS_TO_BUILD=host;NVPTX"
       "-DLLVM_ENABLE_RTTI=ON"
 
       # Setting -DCLING_INCLUDE_TESTS=ON causes the cling/tools targets to be built;
       # see cling/tools/CMakeLists.txt
       "-DCLING_INCLUDE_TESTS=ON"
+      "-DCLANG-TOOLS=OFF"
+    ] ++ lib.optionals debug [
+      "-DCMAKE_BUILD_TYPE=Debug"
+    ] ++ lib.optionals useLLVMLibcxx [
+      "-DLLVM_ENABLE_LIBCXX=ON"
+      "-DLLVM_ENABLE_LIBCXXABI=ON"
     ];
 
+    CPPFLAGS = if useLLVMLibcxx then [ "-stdlib=libc++" ] else [];
+
+    postInstall = lib.optionalString (!stdenv.isDarwin) ''
+      mkdir -p $out/share/Jupyter
+      cp -r /build/clang/tools/cling/tools/Jupyter/kernel $out/share/Jupyter
+    '';
+
+    dontStrip = debug;
+
     meta = with lib; {
       description = "The Interactive C++ Interpreter";
       homepage = "https://root.cern/cling/";
@@ -61,44 +123,49 @@ let
     };
   };
 
+  # Runtime flags for the C++ standard library
+  cxxFlags = if useLLVMLibcxx then [
+    "-I" "${lib.getDev llvmPackages_9.libcxx}/include/c++/v1"
+    "-L" "${llvmPackages_9.libcxx}/lib"
+    "-l" "${llvmPackages_9.libcxx}/lib/libc++.so"
+  ] else [
+    "-I" "${gcc-unwrapped}/include/c++/${gcc-unwrapped.version}"
+    "-I" "${gcc-unwrapped}/include/c++/${gcc-unwrapped.version}/x86_64-unknown-linux-gnu"
+  ];
+
   # The flags passed to the wrapped cling should
   # a) prevent it from searching for system include files and libs, and
-  # b) provide it with the include files and libs it needs (C and C++ standard library)
+  # b) provide it with the include files and libs it needs (C and C++ standard library plus
+  # its own stuff)
 
-  # These are also exposed as cling.flags/cling.compilerIncludeFlags because it's handy to be
-  # able to pass them to tools that wrap Cling, particularly Jupyter kernels such as xeus-cling
-  # and the built-in jupyter-cling-kernel. Both of these use Cling as a library by linking against
-  # libclingJupyter.so, so the makeWrapper approach to wrapping the binary doesn't work.
+  # These are also exposed as cling.flags because it's handy to be able to pass them to tools
+  # that wrap Cling, particularly Jupyter kernels such as xeus-cling and the built-in
+  # jupyter-cling-kernel, which use Cling as a library.
   # Thus, if you're packaging a Jupyter kernel, you either need to pass these flags as extra
   # args to xcpp (for xeus-cling) or put them in the environment variable CLING_OPTS
-  # (for jupyter-cling-kernel)
+  # (for jupyter-cling-kernel).
   flags = [
     "-nostdinc"
     "-nostdinc++"
+
+    "-isystem" "${lib.getLib unwrapped}/lib/clang/9.0.1/include"
+  ]
+  ++ cxxFlags
+  ++ [
+    # System libc
     "-isystem" "${lib.getDev stdenv.cc.libc}/include"
-    "-I" "${lib.getDev unwrapped}/include"
-    "-I" "${lib.getLib unwrapped}/lib/clang/5.0.2/include"
-  ];
 
-  # Autodetect the include paths for the compiler used to build Cling, in the same way Cling does at
-  # https://github.com/root-project/cling/blob/v0.7/lib/Interpreter/CIFactory.cpp#L107:L111
-  # Note: it would be nice to just put the compiler in Cling's PATH and let it do this by itself, but
-  # unfortunately passing -nostdinc/-nostdinc++ disables Cling's autodetection logic.
-  compilerIncludeFlags = runCommand "compiler-include-flags.txt" {} ''
-    export LC_ALL=C
-    ${stdenv.cc}/bin/c++ -xc++ -E -v /dev/null 2>&1 | sed -n -e '/^.include/,''${' -e '/^ \/.*++/p' -e '}' > tmp
-    sed -e 's/^/-isystem /' -i tmp
-    tr '\n' ' ' < tmp > $out
-  '';
+    # cling includes
+    "-isystem" "${lib.getDev unwrapped}/include"
+  ];
 
 in
 
 runCommand "cling-${unwrapped.version}" {
   nativeBuildInputs = [ makeWrapper ];
-  inherit unwrapped flags compilerIncludeFlags;
+  inherit unwrapped flags;
   inherit (unwrapped) meta;
 } ''
   makeWrapper $unwrapped/bin/cling $out/bin/cling \
-    --add-flags "$(cat "$compilerIncludeFlags")" \
     --add-flags "$flags"
 ''
diff --git a/pkgs/development/interpreters/cling/fix-llvm-dylib-usage.patch b/pkgs/development/interpreters/cling/fix-llvm-dylib-usage.patch
new file mode 100644
index 0000000000000..df1fba6b43869
--- /dev/null
+++ b/pkgs/development/interpreters/cling/fix-llvm-dylib-usage.patch
@@ -0,0 +1,24 @@
+diff --git a/tools/cling/tools/driver/CMakeLists.txt b/tools/cling/tools/driver/CMakeLists.txt
+--- a/tools/cling/tools/driver/CMakeLists.txt
++++ b/tools/cling/tools/driver/CMakeLists.txt
+@@ -9,10 +9,10 @@
+ # Keep symbols for JIT resolution
+ set(LLVM_NO_DEAD_STRIP 1)
+
++set(LLVM_LINK_COMPONENTS support)
++
+ if(BUILD_SHARED_LIBS)
+   set(LIBS
+-    LLVMSupport
+-
+     clangFrontendTool
+
+     clingInterpreter
+@@ -25,8 +25,6 @@ if(BUILD_SHARED_LIBS)
+   )
+ else()
+   set(LIBS
+-    LLVMSupport
+-
+     clangASTMatchers
+     clangFrontendTool
diff --git a/pkgs/development/interpreters/cling/fix-llvm-include.patch b/pkgs/development/interpreters/cling/fix-llvm-include.patch
new file mode 100644
index 0000000000000..801965d02d3a2
--- /dev/null
+++ b/pkgs/development/interpreters/cling/fix-llvm-include.patch
@@ -0,0 +1,27 @@
+diff --git a/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h b/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
+index 16202d8..3afdac3 100644
+--- a/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
++++ b/include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h
+@@ -220,7 +220,7 @@ public:
+   Error removeModule(VModuleKey K) {
+     auto I = ModuleMap.find(K);
+     assert(I != ModuleMap.end() && "VModuleKey K not valid here");
+-    auto EDM = std::move(I.second);
++    auto EDM = std::move(I->second);
+     ModuleMap.erase(I);
+     return EDM->removeModuleFromBaseLayer(BaseLayer);
+   }
+diff --git a/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h b/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
+index d9535ce..4c688c3 100644
+--- a/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
++++ b/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
+@@ -472,7 +472,9 @@ private:
+ 
+   // NB!  `LinkedObjects` needs to be destroyed before `NotifyFreed` because
+   // `~ConcreteLinkedObject` calls `NotifyFreed`
++protected:
+   std::map<VModuleKey, std::unique_ptr<LinkedObject>> LinkedObjects;
++private:
+   bool ProcessAllSections = false;
+ };
+ 
diff --git a/pkgs/development/interpreters/cling/force-install-cling-targets.patch b/pkgs/development/interpreters/cling/force-install-cling-targets.patch
new file mode 100644
index 0000000000000..627e2593298e1
--- /dev/null
+++ b/pkgs/development/interpreters/cling/force-install-cling-targets.patch
@@ -0,0 +1,16 @@
+diff --git a/tools/cling/cmake/modules/CMakeLists.txt b/tools/cling/cmake/modules/CMakeLists.txt
+--- a/tools/cling/cmake/modules/CMakeLists.txt
++++ b/tools/cling/cmake/modules/CMakeLists.txt
+@@ -54,10 +54,8 @@ set(CLING_CONFIG_EXPORTS_FILE)
+
+ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+   get_property(cling_has_exports GLOBAL PROPERTY CLING_HAS_EXPORTS)
+-  if(cling_has_exports)
+-    install(EXPORT ClingTargets DESTINATION ${CLING_INSTALL_PACKAGE_DIR}
+-            COMPONENT cling-cmake-exports)
+-  endif()
++  install(EXPORT ClingTargets DESTINATION ${CLING_INSTALL_PACKAGE_DIR}
++          COMPONENT cling-cmake-exports)
+
+   install(FILES
+     ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ClingConfig.cmake
diff --git a/pkgs/development/interpreters/cling/no-clang-cpp.patch b/pkgs/development/interpreters/cling/no-clang-cpp.patch
new file mode 100644
index 0000000000000..6048037cee84f
--- /dev/null
+++ b/pkgs/development/interpreters/cling/no-clang-cpp.patch
@@ -0,0 +1,13 @@
+diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt
+index 590d708d83..340ae529d4 100644
+--- a/tools/driver/CMakeLists.txt
++++ b/tools/driver/CMakeLists.txt
+@@ -63,7 +63,7 @@ endif()
+ add_dependencies(clang clang-resource-headers)
+
+ if(NOT CLANG_LINKS_TO_CREATE)
+-  set(CLANG_LINKS_TO_CREATE clang++ clang-cl clang-cpp)
++  set(CLANG_LINKS_TO_CREATE clang++ clang-cl)
+ endif()
+
+ foreach(link ${CLANG_LINKS_TO_CREATE})
diff --git a/pkgs/development/interpreters/clisp/bits_ipctypes_to_sys_ipc.patch b/pkgs/development/interpreters/clisp/bits_ipctypes_to_sys_ipc.patch
deleted file mode 100644
index d6163022830da..0000000000000
--- a/pkgs/development/interpreters/clisp/bits_ipctypes_to_sys_ipc.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ru a/modules/bindings/glibc/linux.lisp b/modules/bindings/glibc/linux.lisp
---- a/modules/bindings/glibc/linux.lisp	2008-10-10 16:15:49.000000000 +0300
-+++ b/modules/bindings/glibc/linux.lisp	2012-12-04 01:01:35.000000000 +0200
-@@ -86,7 +86,7 @@
- 
- (def-c-type __key_t)            ; int
- 
--(c-lines "#include <bits/ipctypes.h>~%")
-+(c-lines "#include <sys/ipc.h>~%")
- (def-c-type __ipc_pid_t)        ; ushort
- 
- ; --------------------------- <sys/types.h> -----------------------------------
diff --git a/pkgs/development/interpreters/clisp/default.nix b/pkgs/development/interpreters/clisp/default.nix
index bdd15fd4fcc1a..0ff0f6a498169 100644
--- a/pkgs/development/interpreters/clisp/default.nix
+++ b/pkgs/development/interpreters/clisp/default.nix
@@ -3,39 +3,62 @@
 # - base (default): contains readline and i18n, regexp and syscalls modules
 #   by default
 # - full: contains base plus modules in withModules
-{ lib, stdenv, fetchurl, libsigsegv, gettext, ncurses, readline, libX11
-, libXau, libXt, pcre, zlib, libXpm, xorgproto, libXext
+{ lib
+, stdenv
+, fetchFromGitLab
+, autoconf269
+, automake
+, libtool
+, libsigsegv
+, gettext
+, ncurses
+, pcre
+, zlib
+, readline
 , libffi
 , libffcall
+, libX11
+, libXau
+, libXt
+, libXpm
+, libXext
+, xorgproto
 , coreutils
 # build options
-, threadSupport ? stdenv.hostPlatform.isx86
-, x11Support ? stdenv.hostPlatform.isx86
+, threadSupport ? (stdenv.hostPlatform.isx86 && ! stdenv.hostPlatform.isDarwin)
+, x11Support ? (stdenv.hostPlatform.isx86 && ! stdenv.hostPlatform.isDarwin)
 , dllSupport ? true
 , withModules ? [
+    "asdf"
     "pcre"
     "rawsock"
   ]
-  ++ lib.optionals stdenv.isLinux [ "bindings/glibc" "zlib" "wildcard" ]
+  ++ lib.optionals stdenv.isLinux [ "bindings/glibc" "zlib" ]
   ++ lib.optional x11Support "clx/new-clx"
 }:
 
 assert x11Support -> (libX11 != null && libXau != null && libXt != null
   && libXpm != null && xorgproto != null && libXext != null);
 
-stdenv.mkDerivation rec {
-  version = "2.49";
+let
+  ffcallAvailable = stdenv.isLinux && (libffcall != null);
+  # Some modules need autoreconf called in their directory.
+  shouldReconfModule = name: name != "asdf";
+in
+
+stdenv.mkDerivation {
+  version = "2.50pre20230112";
   pname = "clisp";
 
-  src = fetchurl {
-    url = "mirror://gnu/clisp/release/${version}/clisp-${version}.tar.bz2";
-    sha256 = "8132ff353afaa70e6b19367a25ae3d5a43627279c25647c220641fed00f8e890";
+  src = fetchFromGitLab {
+    owner = "gnu-clisp";
+    repo = "clisp";
+    rev = "bf72805c4dace982a6d3399ff4e7f7d5e77ab99a";
+    hash = "sha256-sQoN2FUg9BPaCgvCF91lFsU/zLja1NrgWsEIr2cPiqo=";
   };
 
-  inherit libsigsegv gettext coreutils;
-
-  ffcallAvailable = stdenv.isLinux && (libffcall != null);
-
+  strictDeps = true;
+  nativeBuildInputs = [ autoconf269 automake libtool ];
   buildInputs = [libsigsegv]
   ++ lib.optional (gettext != null) gettext
   ++ lib.optional (ncurses != null) ncurses
@@ -49,24 +72,32 @@ stdenv.mkDerivation rec {
   ];
 
   patches = [
-    ./bits_ipctypes_to_sys_ipc.patch # from Gentoo
-    # The cfree alias no longer exists since glibc 2.26
-    ./remove-cfree-binding.patch
+    ./gnulib_aarch64.patch
   ];
 
   # First, replace port 9090 (rather low, can be used)
   # with 64237 (much higher, IANA private area, not
   # anything rememberable).
-  # Also remove reference to a type that disappeared from recent glibc
-  # (seems the correct thing to do, found no reference to any solution)
   postPatch = ''
     sed -e 's@9090@64237@g' -i tests/socket.tst
     sed -i 's@/bin/pwd@${coreutils}&@' src/clisp-link.in
+    sed -i 's@1\.16\.2@${automake.version}@' src/aclocal.m4
     find . -type f | xargs sed -e 's/-lICE/-lXau &/' -i
-
-    substituteInPlace modules/bindings/glibc/linux.lisp --replace "(def-c-type __swblk_t)" ""
   '';
 
+  preConfigure = lib.optionalString stdenv.isDarwin (''
+    (
+      cd src
+      autoreconf -f -i -I m4 -I glm4
+    )
+  '' + lib.concatMapStrings (x: ''
+    (
+      root="$PWD"
+      cd modules/${x}
+      autoreconf -f -i -I "$root/src" -I "$root/src/m4" -I "$root/src/glm4"
+    )
+  '') (builtins.filter shouldReconfModule withModules));
+
   configureFlags = [ "builddir" ]
   ++ lib.optional (!dllSupport) "--without-dynamic-modules"
   ++ lib.optional (readline != null) "--with-readline"
@@ -74,35 +105,29 @@ stdenv.mkDerivation rec {
   ++ lib.optional (ffcallAvailable && (libffi != null)) "--with-dynamic-ffi"
   ++ lib.optional ffcallAvailable "--with-ffcall"
   ++ lib.optional (!ffcallAvailable) "--without-ffcall"
-  ++ builtins.map (x: "--with-module=" + x) withModules
+  ++ builtins.map (x: " --with-module=" + x) withModules
   ++ lib.optional threadSupport "--with-threads=POSIX_THREADS";
 
   preBuild = ''
     sed -e '/avcall.h/a\#include "config.h"' -i src/foreign.d
+    sed -i -re '/ cfree /d' -i modules/bindings/glibc/linux.lisp
     cd builddir
   '';
 
-  # Fails to build in parallel due to missing gnulib header dependency used in charstrg.d:
-  #   ../src/charstrg.d:319:10: fatal error: uniwidth.h: No such file or directory
-  enableParallelBuilding = false;
+  doCheck = true;
 
   postInstall =
     lib.optionalString (withModules != [])
       (''./clisp-link add "$out"/lib/clisp*/base "$(dirname "$out"/lib/clisp*/base)"/full''
       + lib.concatMapStrings (x: " " + x) withModules);
 
-  env.NIX_CFLAGS_COMPILE = "-O0 ${lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}";
-
-  # TODO : make mod-check fails
-  doCheck = false;
+  env.NIX_CFLAGS_COMPILE = "-O0 -falign-functions=${if stdenv.is64bit then "8" else "4"}";
 
   meta = {
     description = "ANSI Common Lisp Implementation";
-    homepage = "http://clisp.cons.org";
-    maintainers = with lib.maintainers; [ raskin ];
-    platforms = lib.platforms.unix;
-    # problems on Darwin: https://github.com/NixOS/nixpkgs/issues/20062
-    broken = stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isAarch64;
-    license = lib.licenses.gpl2;
+    homepage = "http://clisp.org";
+    maintainers = lib.teams.lisp.members;
+    license = lib.licenses.gpl2Plus;
+    platforms = with lib.platforms; linux ++ darwin;
   };
 }
diff --git a/pkgs/development/interpreters/clisp/gnulib_aarch64.patch b/pkgs/development/interpreters/clisp/gnulib_aarch64.patch
new file mode 100644
index 0000000000000..a0095835706a5
--- /dev/null
+++ b/pkgs/development/interpreters/clisp/gnulib_aarch64.patch
@@ -0,0 +1,13 @@
+diff --git a/src/gllib/vma-iter.c b/src/gllib/vma-iter.c
+index 6045f21d7..d50a3a398 100644
+--- a/src/gllib/vma-iter.c
++++ b/src/gllib/vma-iter.c
+@@ -1327,7 +1327,7 @@ vma_iterate (vma_iterate_callback_fn callback, void *data)
+          In 64-bit processes, we could use vm_region_64 or mach_vm_region.
+          I choose vm_region_64 because it uses the same types as vm_region,
+          resulting in less conditional code.  */
+-# if defined __ppc64__ || defined __x86_64__
++# if defined __aarch64__ || defined __ppc64__ || defined __x86_64__
+       struct vm_region_basic_info_64 info;
+       mach_msg_type_number_t info_count = VM_REGION_BASIC_INFO_COUNT_64;
+ 
diff --git a/pkgs/development/interpreters/clisp/hg.nix b/pkgs/development/interpreters/clisp/hg.nix
deleted file mode 100644
index 8ad72842dc787..0000000000000
--- a/pkgs/development/interpreters/clisp/hg.nix
+++ /dev/null
@@ -1,98 +0,0 @@
-# there are the following linking sets:
-# - boot (not installed): without modules, only used when building clisp
-# - base (default): contains readline and i18n, regexp and syscalls modules
-#   by default
-# - full: contains base plus modules in withModules
-{ lib, stdenv, fetchhg, libsigsegv, gettext, ncurses, readline, libX11
-, libXau, libXt, pcre, zlib, libXpm, xorgproto, libXext
-, libffi, libffcall, automake
-, coreutils
-# build options
-, threadSupport ? stdenv.hostPlatform.isx86
-, x11Support ? stdenv.hostPlatform.isx86
-, dllSupport ? true
-, withModules ? [
-    "pcre"
-    "rawsock"
-  ]
-  ++ lib.optionals stdenv.isLinux [ "bindings/glibc" "zlib" ]
-  ++ lib.optional x11Support "clx/new-clx"
-}:
-
-assert x11Support -> (libX11 != null && libXau != null && libXt != null
-  && libXpm != null && xorgproto != null && libXext != null);
-
-stdenv.mkDerivation rec {
-  version = "2.50pre20171114";
-  pname = "clisp";
-
-  src = fetchhg {
-    url = "http://hg.code.sf.net/p/clisp/clisp";
-    rev = "36df6dc59b8f";
-    sha256 = "1pidiv1m55lvc4ln8vx0ylnnhlj95y6hrfdq96nrj14f4v8fkvmr";
-  };
-
-  inherit libsigsegv gettext coreutils;
-
-  ffcallAvailable = stdenv.isLinux && (libffcall != null);
-
-  nativeBuildInputs = [ automake ]; # sometimes fails otherwise
-  buildInputs = [libsigsegv]
-  ++ lib.optional (gettext != null) gettext
-  ++ lib.optional (ncurses != null) ncurses
-  ++ lib.optional (pcre != null) pcre
-  ++ lib.optional (zlib != null) zlib
-  ++ lib.optional (readline != null) readline
-  ++ lib.optional (ffcallAvailable && (libffi != null)) libffi
-  ++ lib.optional ffcallAvailable libffcall
-  ++ lib.optionals x11Support [
-    libX11 libXau libXt libXpm xorgproto libXext
-  ];
-
-  # First, replace port 9090 (rather low, can be used)
-  # with 64237 (much higher, IANA private area, not
-  # anything rememberable).
-  # Also remove reference to a type that disappeared from recent glibc
-  # (seems the correct thing to do, found no reference to any solution)
-  postPatch = ''
-    sed -e 's@9090@64237@g' -i tests/socket.tst
-    sed -i 's@/bin/pwd@${coreutils}&@' src/clisp-link.in
-    find . -type f | xargs sed -e 's/-lICE/-lXau &/' -i
-
-    substituteInPlace modules/bindings/glibc/linux.lisp --replace "(def-c-type __swblk_t)" ""
-  '';
-
-  configureFlags = [ "builddir" ]
-  ++ lib.optional (!dllSupport) "--without-dynamic-modules"
-  ++ lib.optional (readline != null) "--with-readline"
-  # --with-dynamic-ffi can only exist with --with-ffcall - foreign.d does not compile otherwise
-  ++ lib.optional (ffcallAvailable && (libffi != null)) "--with-dynamic-ffi"
-  ++ lib.optional ffcallAvailable "--with-ffcall"
-  ++ lib.optional (!ffcallAvailable) "--without-ffcall"
-  ++ builtins.map (x: " --with-module=" + x) withModules
-  ++ lib.optional threadSupport "--with-threads=POSIX_THREADS";
-
-  preBuild = ''
-    sed -e '/avcall.h/a\#include "config.h"' -i src/foreign.d
-    sed -i -re '/ cfree /d' -i modules/bindings/glibc/linux.lisp
-    cd builddir
-  '';
-
-  postInstall =
-    lib.optionalString (withModules != [])
-      (''./clisp-link add "$out"/lib/clisp*/base "$(dirname "$out"/lib/clisp*/base)"/full''
-      + lib.concatMapStrings (x: " " + x) withModules);
-
-  env.NIX_CFLAGS_COMPILE = "-O0 ${lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}";
-
-  # TODO : make mod-check fails
-  doCheck = false;
-
-  meta = {
-    description = "ANSI Common Lisp Implementation";
-    homepage = "http://clisp.cons.org";
-    maintainers = with lib.maintainers; [ raskin ];
-    # problems on Darwin: https://github.com/NixOS/nixpkgs/issues/20062
-    platforms = lib.platforms.linux;
-  };
-}
diff --git a/pkgs/development/interpreters/clisp/remove-cfree-binding.patch b/pkgs/development/interpreters/clisp/remove-cfree-binding.patch
deleted file mode 100644
index 4b570c3a46724..0000000000000
--- a/pkgs/development/interpreters/clisp/remove-cfree-binding.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/modules/bindings/glibc/linux.lisp b/modules/bindings/glibc/linux.lisp
-index c40b4f8..1c8edca 100644
---- a/modules/bindings/glibc/linux.lisp
-+++ b/modules/bindings/glibc/linux.lisp
-@@ -648,7 +648,6 @@
- (def-call-out calloc (:arguments (nmemb size_t) (size size_t))
-   (:return-type c-pointer))
- (def-call-out free (:arguments (ptr c-pointer)) (:return-type nil))
--(def-call-out cfree (:arguments (ptr c-pointer)) (:return-type nil))
- (def-call-out valloc (:arguments (size size_t)) (:return-type c-pointer))
- 
- (def-call-out abort (:arguments) (:return-type nil))
diff --git a/pkgs/development/interpreters/clojure/babashka.nix b/pkgs/development/interpreters/clojure/babashka.nix
deleted file mode 100644
index e8ed1a25224f8..0000000000000
--- a/pkgs/development/interpreters/clojure/babashka.nix
+++ /dev/null
@@ -1,96 +0,0 @@
-{ lib
-, buildGraalvmNativeImage
-, graalvmCEPackages
-, removeReferencesTo
-, fetchurl
-, writeScript }:
-
-buildGraalvmNativeImage rec {
-  pname = "babashka";
-  version = "1.3.176";
-
-  src = fetchurl {
-    url = "https://github.com/babashka/${pname}/releases/download/v${version}/${pname}-${version}-standalone.jar";
-    sha256 = "sha256-Kf7Yb7IrXiX5MGbpxvXSKqx3LEdHFV8+hgq43SAoe00=";
-  };
-
-  graalvmDrv = graalvmCEPackages.graalvm19-ce;
-
-  executable = "bb";
-
-  nativeBuildInputs = [ removeReferencesTo ];
-
-  extraNativeImageBuildArgs = [
-    "-H:+ReportExceptionStackTraces"
-    "--no-fallback"
-    "--native-image-info"
-    "--enable-preview"
-  ];
-
-  installCheckPhase = ''
-    $out/bin/bb --version | grep '${version}'
-    $out/bin/bb '(+ 1 2)' | grep '3'
-    $out/bin/bb '(vec (dedupe *input*))' <<< '[1 1 1 1 2]' | grep '[1 2]'
-  '';
-
-  # As of v1.2.174, this will remove references to ${graalvmDrv}/conf/chronology,
-  # not sure the implications of this but this file is not available in
-  # graalvm19-ce anyway.
-  postInstall = ''
-    remove-references-to -t ${graalvmDrv} $out/bin/${executable}
-  '';
-
-  passthru.updateScript = writeScript "update-babashka" ''
-    #!/usr/bin/env nix-shell
-    #!nix-shell -i bash -p curl common-updater-scripts jq
-
-    set -euo pipefail
-
-    readonly latest_version="$(curl \
-      ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
-      -s "https://api.github.com/repos/babashka/babashka/releases/latest" \
-      | jq -r '.tag_name')"
-
-    # v0.6.2 -> 0.6.2
-    update-source-version babashka "''${latest_version/v/}"
-  '';
-
-  meta = with lib; {
-    description = "A Clojure babushka for the grey areas of Bash";
-    longDescription = ''
-      The main idea behind babashka is to leverage Clojure in places where you
-      would be using bash otherwise.
-
-      As one user described it:
-
-          I’m quite at home in Bash most of the time, but there’s a substantial
-          grey area of things that are too complicated to be simple in bash, but
-          too simple to be worth writing a clj/s script for. Babashka really
-          seems to hit the sweet spot for those cases.
-
-    Goals:
-
-    - Low latency Clojure scripting alternative to JVM Clojure.
-    - Easy installation: grab the self-contained binary and run. No JVM needed.
-    - Familiarity and portability:
-      - Scripts should be compatible with JVM Clojure as much as possible
-      - Scripts should be platform-independent as much as possible. Babashka
-        offers support for linux, macOS and Windows.
-    - Allow interop with commonly used classes like java.io.File and System
-    - Multi-threading support (pmap, future, core.async)
-    - Batteries included (tools.cli, cheshire, ...)
-    - Library support via popular tools like the clojure CLI
-    '';
-    homepage = "https://github.com/babashka/babashka";
-    changelog = "https://github.com/babashka/babashka/blob/v${version}/CHANGELOG.md";
-    sourceProvenance = with sourceTypes; [ binaryBytecode ];
-    license = licenses.epl10;
-    maintainers = with maintainers; [
-      bandresen
-      bhougland
-      DerGuteMoritz
-      jlesquembre
-      thiagokokada
-    ];
-  };
-}
diff --git a/pkgs/development/interpreters/clojure/default.nix b/pkgs/development/interpreters/clojure/default.nix
index 1228a765a775e..630b5f5193fb6 100644
--- a/pkgs/development/interpreters/clojure/default.nix
+++ b/pkgs/development/interpreters/clojure/default.nix
@@ -1,13 +1,13 @@
 { lib, stdenv, fetchurl, installShellFiles, jdk, rlwrap, makeWrapper, writeScript }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "clojure";
-  version = "1.11.1.1262";
+  version = "1.11.1.1429";
 
   src = fetchurl {
-    # https://clojure.org/releases/tools
-    url = "https://download.clojure.org/install/clojure-tools-${version}.tar.gz";
-    sha256 = "sha256-k++uGj1CdOjPXYAVERs6UqLnrUXE1Bv/hm1JXRxAHuI=";
+    # https://github.com/clojure/brew-install/releases
+    url = "https://github.com/clojure/brew-install/releases/download/${finalAttrs.version}/clojure-tools-${finalAttrs.version}.tar.gz";
+    hash = "sha256-ov3s1qPGHfPGAPtgwAqPG+hU6R5nGMA7ucg8QVpquC4=";
   };
 
   nativeBuildInputs = [
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
       install -Dm644 example-deps.edn "$clojure_lib_dir/example-deps.edn"
       install -Dm644 tools.edn "$clojure_lib_dir/tools.edn"
       install -Dm644 exec.jar "$clojure_lib_dir/libexec/exec.jar"
-      install -Dm644 clojure-tools-${version}.jar "$clojure_lib_dir/libexec/clojure-tools-${version}.jar"
+      install -Dm644 clojure-tools-${finalAttrs.version}.jar "$clojure_lib_dir/libexec/clojure-tools-${finalAttrs.version}.jar"
 
       echo "Installing clojure and clj into $bin_dir"
       substituteInPlace clojure --replace PREFIX $out
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
     CLJ_CONFIG=$TMPDIR CLJ_CACHE=$TMPDIR/.clj_cache $out/bin/clojure \
       -Spath \
       -Sverbose \
-      -Scp $out/libexec/clojure-tools-${version}.jar
+      -Scp $out/libexec/clojure-tools-${finalAttrs.version}.jar
   '';
 
   passthru.updateScript = writeScript "update-clojure" ''
@@ -61,16 +61,19 @@ stdenv.mkDerivation rec {
     #!nix-shell -i bash -p curl common-updater-scripts jq
 
     set -euo pipefail
+    shopt -s inherit_errexit
 
     # `jq -r '.[0].name'` results in `v0.0`
-    readonly latest_version="$(curl \
+    latest_version="$(curl \
       ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
-      -s "https://api.github.com/repos/clojure/brew-install/tags" \
+      -fsL "https://api.github.com/repos/clojure/brew-install/tags" \
       | jq -r '.[1].name')"
 
     update-source-version clojure "$latest_version"
   '';
 
+  passthru.jdk = jdk;
+
   meta = with lib; {
     description = "A Lisp dialect for the JVM";
     homepage = "https://clojure.org/";
@@ -98,4 +101,4 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; [ jlesquembre thiagokokada ];
     platforms = platforms.unix;
   };
-}
+})
diff --git a/pkgs/development/interpreters/clojure/obb.nix b/pkgs/development/interpreters/clojure/obb.nix
index adb7a92617396..d6717c4ec701c 100644
--- a/pkgs/development/interpreters/clojure/obb.nix
+++ b/pkgs/development/interpreters/clojure/obb.nix
@@ -1,6 +1,5 @@
 { lib
 , stdenv
-, fetchurl
 , babashka
 , cacert
 , clojure
@@ -79,5 +78,8 @@ stdenv.mkDerivation rec {
       willcohen
     ];
     platforms = platforms.darwin;
+
+    # https://hydra.nixos.org/job/nixpkgs/trunk/obb.aarch64-darwin/all
+    broken = true;
   };
 }
diff --git a/pkgs/development/interpreters/cyber/default.nix b/pkgs/development/interpreters/cyber/default.nix
new file mode 100644
index 0000000000000..d71ec5648100a
--- /dev/null
+++ b/pkgs/development/interpreters/cyber/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, zig_0_11
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cyber";
+  version = "unstable-2023-09-19";
+
+  src = fetchFromGitHub {
+    owner = "fubark";
+    repo = "cyber";
+    rev = "f95cd189cf090d26542a87b1d2ced461e75fa1a7";
+    hash = "sha256-ctEd8doXMKq3L9/T+jOcWqlBQN0pVhsu9DjBXsg/u/4=";
+  };
+
+  nativeBuildInputs = [
+    zig_0_11.hook
+  ];
+
+  zigBuildFlags = [
+    "cli"
+  ];
+
+  env = {
+    COMMIT = lib.substring 0 7 src.rev;
+  };
+
+  meta = with lib; {
+    description = "A fast, efficient, and concurrent scripting language";
+    homepage = "https://github.com/fubark/cyber";
+    license = licenses.mit;
+    maintainers = with maintainers; [ figsoda ];
+    inherit (zig_0_11.meta) platforms;
+    broken = stdenv.isDarwin;
+  };
+}
diff --git a/pkgs/development/interpreters/elixir/1.14.nix b/pkgs/development/interpreters/elixir/1.14.nix
index bedc3054eb172..1b20938a6108c 100644
--- a/pkgs/development/interpreters/elixir/1.14.nix
+++ b/pkgs/development/interpreters/elixir/1.14.nix
@@ -1,8 +1,8 @@
 { mkDerivation }:
 
 mkDerivation {
-  version = "1.14.3";
-  sha256 = "sha256-8rkuyAQAZdaKFXnSMaIPwbgoHnPs+nJ+mdbqcqYNeE4=";
-  # https://hexdocs.pm/elixir/1.14.3/compatibility-and-deprecations.html#compatibility-between-elixir-and-erlang-otp
+  version = "1.14.5";
+  sha256 = "sha256-bCCTjFT+FG1hz+0H6k/izbCmi0JgO3Kkqc3LWWCs5Po=";
+  # https://hexdocs.pm/elixir/1.14.5/compatibility-and-deprecations.html#compatibility-between-elixir-and-erlang-otp
   minimumOTPVersion = "23";
 }
diff --git a/pkgs/development/interpreters/elixir/1.15.nix b/pkgs/development/interpreters/elixir/1.15.nix
new file mode 100644
index 0000000000000..fe11d552a8372
--- /dev/null
+++ b/pkgs/development/interpreters/elixir/1.15.nix
@@ -0,0 +1,8 @@
+{ mkDerivation }:
+mkDerivation {
+  version = "1.15.7";
+  sha256 = "sha256-6GfZycylh+sHIuiQk/GQr1pRQRY1uBycSQdsVJ0J13k=";
+  # https://hexdocs.pm/elixir/1.15.0/compatibility-and-deprecations.html#compatibility-between-elixir-and-erlang-otp
+  minimumOTPVersion = "24";
+  escriptPath = "lib/elixir/scripts/generate_app.escript";
+}
diff --git a/pkgs/development/interpreters/elixir/generic-builder.nix b/pkgs/development/interpreters/elixir/generic-builder.nix
index 5f08386c9f511..7901d24d0f771 100644
--- a/pkgs/development/interpreters/elixir/generic-builder.nix
+++ b/pkgs/development/interpreters/elixir/generic-builder.nix
@@ -8,18 +8,20 @@
 , curl
 , bash
 , debugInfo ? false
-}:
+} @ inputs:
 
 { baseName ? "elixir"
 , version
+, erlang ? inputs.erlang
 , minimumOTPVersion
 , sha256 ? null
 , rev ? "v${version}"
 , src ? fetchFromGitHub { inherit rev sha256; owner = "elixir-lang"; repo = "elixir"; }
+, escriptPath ? "lib/elixir/generate_app.escript"
 } @ args:
 
 let
-  inherit (lib) getVersion versionAtLeast optional;
+  inherit (lib) getVersion versionAtLeast optional concatStringsSep;
 
 in
 assert versionAtLeast (getVersion erlang) minimumOTPVersion;
@@ -35,10 +37,15 @@ stdenv.mkDerivation ({
   LANG = "C.UTF-8";
   LC_TYPE = "C.UTF-8";
 
-  buildFlags = optional debugInfo "ERL_COMPILER_OPTIONS=debug_info";
+  ERLC_OPTS =
+    let
+      erlc_opts = [ "deterministic" ]
+        ++ optional debugInfo "debug_info";
+    in
+    "[${concatStringsSep "," erlc_opts}]";
 
   preBuild = ''
-    patchShebangs lib/elixir/generate_app.escript || true
+    patchShebangs ${escriptPath} || true
 
     substituteInPlace Makefile \
       --replace "/usr/local" $out
@@ -49,14 +56,14 @@ stdenv.mkDerivation ({
     # to PATH so the scripts can run without problems.
 
     for f in $out/bin/*; do
-     b=$(basename $f)
+      b=$(basename $f)
       if [ "$b" = mix ]; then continue; fi
       wrapProgram $f \
         --prefix PATH ":" "${lib.makeBinPath [ erlang coreutils curl bash ]}"
     done
 
     substituteInPlace $out/bin/mix \
-          --replace "/usr/bin/env elixir" "${coreutils}/bin/env elixir"
+      --replace "/usr/bin/env elixir" "${coreutils}/bin/env $out/bin/elixir"
   '';
 
   pos = builtins.unsafeGetAttrPos "sha256" args;
diff --git a/pkgs/development/interpreters/emilua/default.nix b/pkgs/development/interpreters/emilua/default.nix
new file mode 100644
index 0000000000000..341888f6cda78
--- /dev/null
+++ b/pkgs/development/interpreters/emilua/default.nix
@@ -0,0 +1,114 @@
+{ lib
+, stdenv
+, meson
+, ninja
+, fetchFromGitHub
+, fetchFromGitLab
+, re2c
+, gperf
+, gawk
+, pkg-config
+, boost182
+, fmt
+, luajit_openresty
+, ncurses
+, serd
+, sord
+, libcap
+, liburing
+, openssl
+, cereal
+, cmake
+, asciidoctor
+}:
+
+let
+  emilua-http-wrap = fetchFromGitHub {
+      owner = "BoostGSoC14";
+      repo = "boost.http";
+      rev = "93ae527c89ffc517862e1f5f54c8a257278f1195";
+      name = "emilua-http";
+      hash = "sha256-MN29YwkTi0TJ2V+vRI9nUIxvJKsG+j3nT3o0yQB3p0o=";
+  };
+
+  trial-protocol-wrap = fetchFromGitHub {
+      owner = "breese";
+      repo = "trial.protocol";
+      rev = "79149f604a49b8dfec57857ca28aaf508069b669";
+      name = "trial-protocol";
+      hash = "sha256-Xd8bX3z9PZWU17N9R95HXdj6qo9at5FBL/+PTVaJgkw=";
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "emilua";
+  version = "0.5.1";
+
+  src = fetchFromGitLab {
+      owner = "emilua";
+      repo = "emilua";
+      rev = "v${version}";
+      hash = "sha256-5NzxZHdQGw3qLEzW/mv1sLCuqehn5pjUYkCna4PUzDQ=";
+  };
+
+  buildInputs = [
+    luajit_openresty
+    boost182
+    fmt
+    ncurses
+    serd
+    sord
+    libcap
+    liburing
+    openssl
+    cereal
+  ];
+
+  nativeBuildInputs = [
+    re2c
+    gperf
+    gawk
+    pkg-config
+    asciidoctor
+    meson
+    cmake
+    ninja
+  ];
+
+  dontUseCmakeConfigure = true;
+
+  # Meson is no longer able to pick up Boost automatically.
+  # https://github.com/NixOS/nixpkgs/issues/86131
+  env = {
+    BOOST_INCLUDEDIR = "${lib.getDev boost182}/include";
+    BOOST_LIBRARYDIR = "${lib.getLib boost182}/lib";
+  };
+
+  mesonFlags = [
+    (lib.mesonOption "version_suffix" "-nixpkgs1")
+    (lib.mesonBool "enable_http" true)
+    (lib.mesonBool "enable_file_io" true)
+    (lib.mesonBool "enable_io_uring" true)
+    (lib.mesonBool "enable_tests" true)
+    (lib.mesonBool "enable_manpages" true)
+  ];
+
+  postPatch = ''
+    pushd subprojects
+    cp -r ${emilua-http-wrap} emilua-http
+    cp -r ${trial-protocol-wrap} trial-protocol
+    chmod +w emilua-http trial-protocol
+    cp "packagefiles/emilua-http/meson.build" "emilua-http/"
+    cp "packagefiles/trial.protocol/meson.build" "trial-protocol/"
+    popd
+
+    substituteInPlace src/emilua_gperf.awk  --replace '#!/usr/bin/env -S gawk --file' '#!${gawk}/bin/gawk -f'
+  '';
+
+  meta = with lib; {
+    description = "Lua execution engine";
+    homepage = "https://emilua.org/";
+    license = licenses.boost;
+    maintainers = with maintainers; [ manipuladordedados ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/interpreters/erlang/23.nix b/pkgs/development/interpreters/erlang/23.nix
deleted file mode 100644
index 89faebdde1284..0000000000000
--- a/pkgs/development/interpreters/erlang/23.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{ mkDerivation }:
-
-mkDerivation {
-  version = "23.3.4.18";
-  sha256 = "sha256-sxNVu/52kOMFKQYPLi5uXnR1mYTF2KlHUo4T7kh0KoY=";
-}
diff --git a/pkgs/development/interpreters/erlang/24.nix b/pkgs/development/interpreters/erlang/24.nix
index 26205ba0da1d6..c66d829433b0a 100644
--- a/pkgs/development/interpreters/erlang/24.nix
+++ b/pkgs/development/interpreters/erlang/24.nix
@@ -1,6 +1,6 @@
 { mkDerivation }:
 
 mkDerivation {
-  version = "24.3.4.10";
-  sha256 = "sha256-mz9ZSqp/MgdW3tMLLV84Uiwqb4FIOAnYjYgri68LlWs=";
+  version = "24.3.4.14";
+  sha256 = "sha256-+OEA7bVomZox/iHhkRQPt91WayyxZQDkDI92B5Ez24Q=";
 }
diff --git a/pkgs/development/interpreters/erlang/25.nix b/pkgs/development/interpreters/erlang/25.nix
index 16481441ccc88..dc129ecdecef0 100644
--- a/pkgs/development/interpreters/erlang/25.nix
+++ b/pkgs/development/interpreters/erlang/25.nix
@@ -1,6 +1,6 @@
 { mkDerivation }:
 
 mkDerivation {
-  version = "25.3";
-  sha256 = "UOBrDaXpvpeM79VN0PxVQ1XsYI+OYWBbaBfYE5lZXgE=";
+  version = "25.3.2.7";
+  sha256 = "sha256-JMHfnnvjAIrJ2YhSzk1qVeS7qGx2HDf2J+8+WFD5Bv8=";
 }
diff --git a/pkgs/development/interpreters/erlang/26.nix b/pkgs/development/interpreters/erlang/26.nix
new file mode 100644
index 0000000000000..a0e55bad3c5a7
--- /dev/null
+++ b/pkgs/development/interpreters/erlang/26.nix
@@ -0,0 +1,6 @@
+{ mkDerivation }:
+
+mkDerivation {
+  version = "26.1.2";
+  sha256 = "sha256-exLLdg7z/HKJI81w33vcQUDF6NG5n2WKtcYwdPxN+0A=";
+}
diff --git a/pkgs/development/interpreters/evcxr/default.nix b/pkgs/development/interpreters/evcxr/default.nix
index eab1f90e5f327..7b1a9b8b08351 100644
--- a/pkgs/development/interpreters/evcxr/default.nix
+++ b/pkgs/development/interpreters/evcxr/default.nix
@@ -3,16 +3,16 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "evcxr";
-  version = "0.14.2";
+  version = "0.16.0";
 
   src = fetchFromGitHub {
     owner = "google";
     repo = "evcxr";
     rev = "v${version}";
-    sha256 = "sha256-gREAtCh4jerqxhwNslXIXRMLkoj0RlhbIwQXbb8LVws=";
+    sha256 = "sha256-TQG0YNwD3WU50fftFv5nGUK9ucxDXYnbQVv8Dewhwm8=";
   };
 
-  cargoSha256 = "sha256-xuxWOVSUJVQvSDA5xhFBjdO/ODLA4fzEnzG9p0DRF2Q=";
+  cargoHash = "sha256-F2CduT0/vjoVHua5WshYxsxf4P0QBa+BjFVp7iTsFkU=";
 
   RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
 
@@ -20,6 +20,13 @@ rustPlatform.buildRustPackage rec {
   buildInputs = lib.optionals stdenv.isDarwin
     [ libiconv CoreServices Security ];
 
+  checkFlags = [
+    # test broken with rust 1.69:
+    # * https://github.com/evcxr/evcxr/issues/294
+    # * https://github.com/NixOS/nixpkgs/issues/229524
+    "--skip=check_for_errors"
+  ];
+
   postInstall = let
     wrap = exe: ''
       wrapProgram $out/bin/${exe} \
diff --git a/pkgs/development/interpreters/expr/default.nix b/pkgs/development/interpreters/expr/default.nix
new file mode 100644
index 0000000000000..da0cc15b52f64
--- /dev/null
+++ b/pkgs/development/interpreters/expr/default.nix
@@ -0,0 +1,35 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+}:
+
+buildGoModule rec {
+  pname = "expr";
+  version = "1.15.5";
+
+  src = fetchFromGitHub {
+    owner = "antonmedv";
+    repo = "expr";
+    rev = "v${version}";
+    hash = "sha256-DIJBVL1HAZyD+K+vKnB1O2cZJkBu0R2xueDO1OUHq3I=";
+  };
+
+  sourceRoot = "${src.name}/repl";
+
+  vendorHash = "sha256-D4JdFY9OweTigT0NIKmBbxrHn5FoVsj/EU6c0y9aaDo=";
+
+  ldflags = [ "-s" "-w" ];
+
+  postInstall = ''
+    mv $out/bin/{repl,expr}
+  '';
+
+  meta = with lib; {
+    description = "Expression language and expression evaluation for Go";
+    homepage = "https://github.com/antonmedv/expr";
+    changelog = "https://github.com/antonmedv/expr/releases/tag/${src.rev}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ figsoda ];
+    mainProgram = "expr";
+  };
+}
diff --git a/pkgs/development/interpreters/femtolisp/default.nix b/pkgs/development/interpreters/femtolisp/default.nix
new file mode 100644
index 0000000000000..ecd3bc1f8fd72
--- /dev/null
+++ b/pkgs/development/interpreters/femtolisp/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, stdenv
+, fetchFromSourcehut
+, unstableGitUpdater
+}:
+
+stdenv.mkDerivation {
+  pname = "femtolisp";
+  version = "unstable-2023-07-12";
+
+  src = fetchFromSourcehut {
+    owner = "~ft";
+    repo = "femtolisp";
+    rev = "b3a21a0ff408e559639f6c31e1a2ab970787567f";
+    hash = "sha256-PE/xYhfhn0xv/kJWsS07fOF2n5sXP666vy7OVaNxc7Y=";
+  };
+
+  strictDeps = true;
+
+  enableParallelBuilding = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm755 -t $out/bin/ flisp
+
+    runHook postInstall
+  '';
+
+  passthru.updateScript = unstableGitUpdater { };
+
+  meta = {
+    description = "A compact interpreter for a minimal lisp/scheme dialect";
+    homepage = "https://git.sr.ht/~ft/femtolisp";
+    license = with lib.licenses; [ mit bsd3 ];
+    maintainers = with lib.maintainers; [ moody ];
+    broken = stdenv.isDarwin;
+    platforms = lib.platforms.unix;
+    mainProgram = "flisp";
+  };
+}
diff --git a/pkgs/development/interpreters/gauche/boot.nix b/pkgs/development/interpreters/gauche/boot.nix
index 7fbc66406e677..61c67b13f78fa 100644
--- a/pkgs/development/interpreters/gauche/boot.nix
+++ b/pkgs/development/interpreters/gauche/boot.nix
@@ -3,11 +3,11 @@
 
 stdenv.mkDerivation rec {
   pname = "gauche-bootstrap";
-  version = "0.9.9";
+  version = "0.9.12";
 
   src = fetchurl {
-    url = "mirror://sourceforge/gauche/Gauche-${version}.tgz";
-    sha256 = "1yzpszhw52vkpr65r5d4khf3489mnnvnw58dd2wsvvx7499k5aac";
+    url = "https://github.com/shirok/Gauche/releases/download/release${lib.replaceStrings ["."] ["_"] version}/Gauche-${version}.tgz";
+    hash = "sha256-tK5kkhsHqWZhaV69WqwN7IE9GmjlRqYWCRE9eEP1thc=";
   };
 
   nativeBuildInputs = [ pkg-config texinfo ];
diff --git a/pkgs/development/interpreters/gauche/default.nix b/pkgs/development/interpreters/gauche/default.nix
index baa679b6e00d8..301cd9db78301 100644
--- a/pkgs/development/interpreters/gauche/default.nix
+++ b/pkgs/development/interpreters/gauche/default.nix
@@ -1,20 +1,20 @@
 { stdenv, lib, fetchFromGitHub, autoreconfHook, gaucheBootstrap, pkg-config, texinfo
-, libiconv, gdbm, openssl, zlib, mbedtls, cacert }:
+, libiconv, gdbm, openssl, zlib, mbedtls, cacert, CoreServices }:
 
 stdenv.mkDerivation rec {
   pname = "gauche";
-  version = "0.9.10";
+  version = "0.9.13";
 
   src = fetchFromGitHub {
     owner = "shirok";
     repo = pname;
     rev = "release${lib.replaceStrings [ "." ] [ "_" ] version}";
-    sha256 = "0ki1w7sa10ivmg51sqjskby0gsznb0d3738nz80x589033km5hmb";
+    hash = "sha256-XD4zJzCktGi/E9sA6BVm9JVQBVrG5119EjZNbP1pVJU=";
   };
 
   nativeBuildInputs = [ gaucheBootstrap pkg-config texinfo autoreconfHook ];
 
-  buildInputs = [ libiconv gdbm openssl zlib mbedtls cacert ];
+  buildInputs = [ libiconv gdbm openssl zlib mbedtls cacert ] ++ lib.optionals stdenv.isDarwin [ CoreServices ];
 
   autoreconfPhase = ''
     ./DIST gen
diff --git a/pkgs/development/interpreters/gpython/default.nix b/pkgs/development/interpreters/gpython/default.nix
new file mode 100644
index 0000000000000..8bb432e839ea6
--- /dev/null
+++ b/pkgs/development/interpreters/gpython/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, testers
+, gpython
+}:
+
+buildGoModule rec {
+  pname = "gpython";
+  version = "0.2.0";
+
+  src = fetchFromGitHub {
+    owner = "go-python";
+    repo = "gpython";
+    rev = "v${version}";
+    hash = "sha256-xqwq27u41Jgoh7t9UDyatuBQswr+h3xio5AV/npncHc=";
+  };
+
+  vendorHash = "sha256-NXPllEhootdB8m5Wvfy8MW899oQnjWAQj7yCC2oDvqE=";
+
+  subPackages = [
+    "."
+  ];
+
+  ldflags = [
+    "-s"
+    "-w"
+    "-X=main.version=${version}"
+    "-X=main.commit=${src.rev}"
+    "-X=main.date=1970-01-01"
+  ];
+
+  passthru.tests = {
+    version = testers.testVersion {
+      package = gpython;
+      command = "gpython < /dev/null";
+    };
+  };
+
+  meta = with lib; {
+    description = "A Python interpreter written in Go";
+    homepage = "https://github.com/go-python/gpython";
+    changelog = "https://github.com/go-python/gpython/releases/tag/${src.rev}";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/pkgs/development/interpreters/guile/1.8.nix b/pkgs/development/interpreters/guile/1.8.nix
index f30270fcc83fb..51ac9ba3ed58f 100644
--- a/pkgs/development/interpreters/guile/1.8.nix
+++ b/pkgs/development/interpreters/guile/1.8.nix
@@ -86,6 +86,12 @@ stdenv.mkDerivation rec {
 
   setupHook = ./setup-hook-1.8.sh;
 
+  passthru = {
+    effectiveVersion = lib.versions.majorMinor version;
+    siteCcacheDir = "lib/guile/site-ccache";
+    siteDir = "share/guile/site";
+  };
+
   meta = with lib; {
     homepage = "https://www.gnu.org/software/guile/";
     description = "Embeddable Scheme implementation";
diff --git a/pkgs/development/interpreters/guile/2.0.nix b/pkgs/development/interpreters/guile/2.0.nix
index 9e2953aa2f9e2..18daad8005686 100644
--- a/pkgs/development/interpreters/guile/2.0.nix
+++ b/pkgs/development/interpreters/guile/2.0.nix
@@ -133,6 +133,12 @@ builder rec {
 
   setupHook = ./setup-hook-2.0.sh;
 
+  passthru = rec {
+    effectiveVersion = lib.versions.majorMinor version;
+    siteCcacheDir = "lib/guile/${effectiveVersion}/site-ccache";
+    siteDir = "share/guile/site/${effectiveVersion}";
+  };
+
   meta = with lib; {
     homepage = "https://www.gnu.org/software/guile/";
     description = "Embeddable Scheme implementation";
diff --git a/pkgs/development/interpreters/guile/2.2.nix b/pkgs/development/interpreters/guile/2.2.nix
index 91cb993fae06f..918735517ea34 100644
--- a/pkgs/development/interpreters/guile/2.2.nix
+++ b/pkgs/development/interpreters/guile/2.2.nix
@@ -124,6 +124,12 @@ builder rec {
 
   setupHook = ./setup-hook-2.2.sh;
 
+  passthru = rec {
+    effectiveVersion = lib.versions.majorMinor version;
+    siteCcacheDir = "lib/guile/${effectiveVersion}/site-ccache";
+    siteDir = "share/guile/site/${effectiveVersion}";
+  };
+
   meta = with lib; {
     homepage = "https://www.gnu.org/software/guile/";
     description = "Embeddable Scheme implementation";
diff --git a/pkgs/development/interpreters/guile/3.0.nix b/pkgs/development/interpreters/guile/3.0.nix
index de0b8479f1cad..fb788377107e1 100644
--- a/pkgs/development/interpreters/guile/3.0.nix
+++ b/pkgs/development/interpreters/guile/3.0.nix
@@ -10,6 +10,7 @@
 , libffi
 , libtool
 , libunistring
+, libxcrypt
 , makeWrapper
 , pkg-config
 , pkgsBuildBuild
@@ -48,6 +49,8 @@ builder rec {
     libtool
     libunistring
     readline
+  ] ++ lib.optionals stdenv.isLinux [
+    libxcrypt
   ];
   propagatedBuildInputs = [
     boehmgc
@@ -59,6 +62,8 @@ builder rec {
     # flags, see below.
     libtool
     libunistring
+  ] ++ lib.optionals stdenv.isLinux [
+    libxcrypt
   ];
 
   # According to
@@ -69,6 +74,7 @@ builder rec {
 
   patches = [
     ./eai_system.patch
+    ./guile-hurd-posix-spawn.patch
   ] ++ lib.optional (coverageAnalysis != null) ./gcov-file-name.patch
   ++ lib.optional stdenv.isDarwin
     (fetchpatch {
@@ -98,9 +104,6 @@ builder rec {
     # See below.
     "--without-threads"
   ]
-  # Disable JIT on Apple Silicon, as it is not yet supported
-  # https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44505";
-  ++ lib.optional (stdenv.isDarwin && stdenv.isAarch64) "--enable-jit=no"
   # At least on x86_64-darwin '-flto' autodetection is not correct:
   #  https://github.com/NixOS/nixpkgs/pull/160051#issuecomment-1046193028
   ++ lib.optional (stdenv.isDarwin) "--disable-lto";
@@ -114,8 +117,9 @@ builder rec {
   + ''
     sed -i "$out/lib/pkgconfig/guile"-*.pc    \
         -e "s|-lunistring|-L${libunistring}/lib -lunistring|g ;
-            s|^Cflags:\(.*\)$|Cflags: -I${libunistring.dev}/include \1|g ;
             s|-lltdl|-L${libtool.lib}/lib -lltdl|g ;
+            s|-lcrypt|-L${libxcrypt}/lib -lcrypt|g ;
+            s|^Cflags:\(.*\)$|Cflags: -I${libunistring.dev}/include \1|g ;
             s|includedir=$out|includedir=$dev|g
             "
     '';
@@ -125,9 +129,16 @@ builder rec {
   doCheck = false;
   doInstallCheck = doCheck;
 
+  # In procedure bytevector-u8-ref: Argument 2 out of range
+  dontStrip = stdenv.isDarwin;
+
   setupHook = ./setup-hook-3.0.sh;
 
-  passthru = {
+  passthru = rec {
+    effectiveVersion = lib.versions.majorMinor version;
+    siteCcacheDir = "lib/guile/${effectiveVersion}/site-ccache";
+    siteDir = "share/guile/site/${effectiveVersion}";
+
     updateScript = writeScript "update-guile-3" ''
       #!/usr/bin/env nix-shell
       #!nix-shell -i bash -p curl pcre common-updater-scripts
@@ -153,7 +164,7 @@ builder rec {
       foreign function call interface, and powerful string processing.
     '';
     license = licenses.lgpl3Plus;
-    maintainers = with maintainers; [ ludo lovek323 vrthra ];
+    maintainers = with maintainers; [ ];
     platforms = platforms.all;
   };
 }
diff --git a/pkgs/development/interpreters/guile/guile-hurd-posix-spawn.patch b/pkgs/development/interpreters/guile/guile-hurd-posix-spawn.patch
new file mode 100644
index 0000000000000..7cf600b4c2aa5
--- /dev/null
+++ b/pkgs/development/interpreters/guile/guile-hurd-posix-spawn.patch
@@ -0,0 +1,44 @@
+Fix <https://issues.guix.gnu.org/61095>, which affects GNU/Hurd.
+
+diff --git a/libguile/posix.c b/libguile/posix.c
+index 3a8be94e4..f5fdc544c 100644
+--- a/libguile/posix.c
++++ b/libguile/posix.c
+@@ -1326,7 +1326,14 @@ static void
+ close_inherited_fds_slow (posix_spawn_file_actions_t *actions, int max_fd)
+ {
+   while (--max_fd > 2)
+-    posix_spawn_file_actions_addclose (actions, max_fd);
++    {
++      /* Adding invalid file descriptors to an 'addclose' action leads
++         to 'posix_spawn' failures on some operating systems:
++         <https://bugs.gnu.org/61095>.  Hence the extra check.  */
++      int flags = fcntl (max_fd, F_GETFD, NULL);
++      if ((flags >= 0) && ((flags & FD_CLOEXEC) == 0))
++        posix_spawn_file_actions_addclose (actions, max_fd);
++    }
+ }
+ 
+ static void
+
+Fix <https://issues.guix.gnu.org/62501>.
+
+diff --git a/test-suite/tests/posix.test b/test-suite/tests/posix.test
+index f20e04453..d5cf47cda 100644
+--- a/test-suite/tests/posix.test
++++ b/test-suite/tests/posix.test
+@@ -431,7 +431,13 @@
+       (let ((str (get-string-all (car input+output))))
+         (close-port (car input+output))
+         (waitpid pid)
+-        str)))
++
++        ;; On GNU/Hurd, the exec server prepends 'LD_ORIGIN_PATH' for
++        ;; every program: <https://bugs.gnu.org/62501>.  Strip it.
++        (if (and (string=? "GNU" (utsname:sysname (uname)))
++                 (string-prefix? "LD_ORIGIN_PATH=" str))
++            (string-drop str (+ 1 (string-index str #\newline)))
++            str))))
+ 
+   (pass-if-equal "ls /proc/self/fd"
+       "0\n1\n2\n3\n"                     ;fourth FD is for /proc/self/fd
diff --git a/pkgs/development/interpreters/guile/setup-hook-1.8.sh b/pkgs/development/interpreters/guile/setup-hook-1.8.sh
index 946e595ac0bf5..9a6ffb793a78b 100644
--- a/pkgs/development/interpreters/guile/setup-hook-1.8.sh
+++ b/pkgs/development/interpreters/guile/setup-hook-1.8.sh
@@ -1,6 +1,6 @@
 addGuileLibPath () {
     if test -d "$1/share/guile/site"; then
-        export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site"
+        addToSearchPath GUILE_LOAD_PATH "$1/share/guile/site"
     fi
 }
 
diff --git a/pkgs/development/interpreters/guile/setup-hook-2.0.sh b/pkgs/development/interpreters/guile/setup-hook-2.0.sh
index d83f9c6470573..9ef0fae011b58 100644
--- a/pkgs/development/interpreters/guile/setup-hook-2.0.sh
+++ b/pkgs/development/interpreters/guile/setup-hook-2.0.sh
@@ -1,18 +1,18 @@
 addGuileLibPath () {
     if test -d "$1/share/guile/site/2.0"; then
-        export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site/2.0"
-        export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site/2.0"
+        addToSearchPath GUILE_LOAD_PATH "$1/share/guile/site/2.0"
+        addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/share/guile/site/2.0"
     elif test -d "$1/share/guile/site"; then
-        export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site"
-        export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site"
+        addToSearchPath GUILE_LOAD_PATH "$1/share/guile/site"
+        addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/share/guile/site"
     fi
 
     if test -d "$1/lib/guile/2.0/ccache"; then
-        export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/2.0/ccache"
+        addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/lib/guile/2.0/ccache"
     fi
 
     if test -d "$1/lib/guile/2.0/site-ccache"; then
-        export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/2.0/site-ccache"
+        addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/lib/guile/2.0/site-ccache"
     fi
 }
 
diff --git a/pkgs/development/interpreters/guile/setup-hook-2.2.sh b/pkgs/development/interpreters/guile/setup-hook-2.2.sh
index d6bb23e7949a5..932a5b6c41e64 100644
--- a/pkgs/development/interpreters/guile/setup-hook-2.2.sh
+++ b/pkgs/development/interpreters/guile/setup-hook-2.2.sh
@@ -1,18 +1,18 @@
 addGuileLibPath () {
     if test -d "$1/share/guile/site/2.2"; then
-        export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site/2.2"
-        export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site/2.2"
+        addToSearchPath GUILE_LOAD_PATH "$1/share/guile/site/2.2"
+        addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/share/guile/site/2.2"
     elif test -d "$1/share/guile/site"; then
-        export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site"
-        export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site"
+        addToSearchPath GUILE_LOAD_PATH "$1/share/guile/site"
+        addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/share/guile/site"
     fi
 
     if test -d "$1/lib/guile/2.2/ccache"; then
-        export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/2.2/ccache"
+        addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/lib/guile/2.2/ccache"
     fi
 
     if test -d "$1/lib/guile/2.2/site-ccache"; then
-        export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/2.2/site-ccache"
+        addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/lib/guile/2.2/site-ccache"
     fi
 }
 
diff --git a/pkgs/development/interpreters/guile/setup-hook-3.0.sh b/pkgs/development/interpreters/guile/setup-hook-3.0.sh
index e13ec2767fd49..1a71e82d13a22 100644
--- a/pkgs/development/interpreters/guile/setup-hook-3.0.sh
+++ b/pkgs/development/interpreters/guile/setup-hook-3.0.sh
@@ -1,18 +1,24 @@
 addGuileLibPath () {
     if test -d "$1/share/guile/site/3.0"; then
-        export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site/3.0"
-        export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site/3.0"
+        addToSearchPath GUILE_LOAD_PATH "$1/share/guile/site/3.0"
+        addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/share/guile/site/3.0"
+        addToSearchPath GUILE_EXTENSIONS_PATH "$1/share/guile/site/3.0"
     elif test -d "$1/share/guile/site"; then
-        export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site"
-        export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site"
+        addToSearchPath GUILE_LOAD_PATH "$1/share/guile/site"
+        addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/share/guile/site"
+        addToSearchPath GUILE_EXTENSIONS_PATH "$1/share/guile/site"
     fi
 
     if test -d "$1/lib/guile/3.0/ccache"; then
-        export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/3.0/ccache"
+        addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/lib/guile/3.0/ccache"
     fi
 
     if test -d "$1/lib/guile/3.0/site-ccache"; then
-        export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/3.0/site-ccache"
+        addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/lib/guile/3.0/site-ccache"
+    fi
+
+    if test -d "$1/lib/guile/3.0/extensions"; then
+        addToSearchPath GUILE_EXTENSIONS_PATH "$1/lib/guile/3.0/extensions"
     fi
 }
 
diff --git a/pkgs/development/interpreters/hugs/default.nix b/pkgs/development/interpreters/hugs/default.nix
index ed02b41b7668f..d8ee5726ef330 100644
--- a/pkgs/development/interpreters/hugs/default.nix
+++ b/pkgs/development/interpreters/hugs/default.nix
@@ -41,6 +41,7 @@ stdenv.mkDerivation rec {
 
   meta = with lib; {
     broken = stdenv.isDarwin;
+    mainProgram = "hugs";
     homepage = "https://www.haskell.org/hugs";
     description = "Haskell interpreter";
     maintainers = with maintainers; [ joachifm ];
diff --git a/pkgs/development/interpreters/ivy/default.nix b/pkgs/development/interpreters/ivy/default.nix
index 434b495277147..171b739bddff1 100644
--- a/pkgs/development/interpreters/ivy/default.nix
+++ b/pkgs/development/interpreters/ivy/default.nix
@@ -2,19 +2,21 @@
 
 buildGoModule rec {
   pname = "ivy";
-  version = "0.2.8";
+  version = "0.2.10";
 
   src = fetchFromGitHub {
     rev = "v${version}";
     owner = "robpike";
     repo = "ivy";
-    sha256 = "sha256-pb/dJfEXz13myT6XadCg0kKd+n9bcHNBc84ES+hDw2Y=";
+    hash = "sha256-6rZfBx6jKNOEnG+cmrzgvjUoCHQe+olPeX11qX8ep38=";
   };
 
-  vendorSha256 = null;
+  vendorHash = null;
 
   subPackages = [ "." ];
 
+  ldflags = [ "-s" "-w" ];
+
   meta = with lib; {
     homepage = "https://github.com/robpike/ivy";
     description = "ivy, an APL-like calculator";
diff --git a/pkgs/development/interpreters/janet/default.nix b/pkgs/development/interpreters/janet/default.nix
index 64edc0ca96ef8..f186021eb3d64 100644
--- a/pkgs/development/interpreters/janet/default.nix
+++ b/pkgs/development/interpreters/janet/default.nix
@@ -1,23 +1,35 @@
-{ lib, stdenv, fetchFromGitHub, meson, ninja }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, meson
+, ninja
+, nix-update-script
+, runCommand
+}:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "janet";
-  version = "1.27.0";
+  version = "1.32.1";
 
   src = fetchFromGitHub {
     owner = "janet-lang";
-    repo = pname;
-    rev = "v${version}";
-    sha256 = "sha256-UsM7J1LsiO5g3yxpO245Yr0oJQaCxs7LMNvxuHv6pTk=";
+    repo = "janet";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-24d9N59pTfQATWmAZN4dAFT8RTTlUlBPKokcQ/Fd2No=";
   };
 
   postPatch = ''
     substituteInPlace janet.1 \
       --replace /usr/local/ $out/
+  '' + lib.optionalString stdenv.isDarwin ''
+    # error: Socket is not connected
+    substituteInPlace meson.build \
+      --replace "'test/suite-ev.janet'," ""
   '';
 
   nativeBuildInputs = [ meson ninja ];
 
+  mesonBuildType = "release";
   mesonFlags = [ "-Dgit_hash=release" ];
 
   doCheck = true;
@@ -28,6 +40,21 @@ stdenv.mkDerivation rec {
     $out/bin/janet -e '(+ 1 2 3)'
   '';
 
+  passthru = {
+    tests.run = runCommand "janet-test-run" {
+      nativeBuildInputs = [finalAttrs.finalPackage];
+    } ''
+      echo "(+ 1 2 3)" | janet | tail -n 1 > arithmeticTest.txt;
+      diff -U3 --color=auto <(cat arithmeticTest.txt) <(echo "6");
+
+      echo "(print \"Hello, World!\")" | janet | tail -n 2 > ioTest.txt;
+      diff -U3 --color=auto <(cat ioTest.txt) <(echo -e "Hello, World!\nnil");
+
+      touch $out;
+    '';
+    updateScript = nix-update-script {};
+  };
+
   meta = with lib; {
     description = "Janet programming language";
     homepage = "https://janet-lang.org/";
@@ -35,4 +62,4 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; [ andrewchambers peterhoeg ];
     platforms = platforms.all;
   };
-}
+})
diff --git a/pkgs/development/interpreters/jimtcl/default.nix b/pkgs/development/interpreters/jimtcl/default.nix
index ed0ddc7da22fa..e478ff945472f 100644
--- a/pkgs/development/interpreters/jimtcl/default.nix
+++ b/pkgs/development/interpreters/jimtcl/default.nix
@@ -5,12 +5,15 @@
 , asciidoc
 , pkg-config
 , inetutils
+, tcl
 
 , sqlite
 , readline
 , SDL
 , SDL_gfx
 , openssl
+
+, SDLSupport ? true
 }:
 
 stdenv.mkDerivation rec {
@@ -27,15 +30,17 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     pkg-config
     asciidoc
+    tcl
   ];
 
   buildInputs = [
     sqlite
     readline
+    openssl
+  ] ++ (lib.optionals SDLSupport [
     SDL
     SDL_gfx
-    openssl
-  ];
+  ]);
 
   configureFlags = [
     "--shared"
@@ -44,11 +49,10 @@ stdenv.mkDerivation rec {
     "--with-ext=binary"
     "--with-ext=sqlite3"
     "--with-ext=readline"
-    "--with-ext=sdl"
     "--with-ext=json"
     "--enable-utf8"
     "--ipv6"
-  ];
+  ] ++ (lib.optional SDLSupport "--with-ext=sdl");
 
   enableParallelBuilding = true;
 
@@ -58,6 +62,9 @@ stdenv.mkDerivation rec {
     rm tests/exec2.test
     # requires internet access
     rm tests/ssl.test
+    # test fails due to timing in some environments
+    # https://github.com/msteveb/jimtcl/issues/282
+    rm tests/timer.test
   '';
 
   # test posix-1.6 needs the "hostname" command
diff --git a/pkgs/development/interpreters/joker/default.nix b/pkgs/development/interpreters/joker/default.nix
index ab2ac8057453c..1bafd6cb728e8 100644
--- a/pkgs/development/interpreters/joker/default.nix
+++ b/pkgs/development/interpreters/joker/default.nix
@@ -2,16 +2,16 @@
 
 buildGoModule rec {
   pname = "joker";
-  version = "1.1.0";
+  version = "1.3.1";
 
   src = fetchFromGitHub {
     rev = "v${version}";
     owner = "candid82";
     repo = "joker";
-    sha256 = "sha256-ERkK4T+nUTf18OoEctSugeK4i/f6k0naBKxzn+6pe38=";
+    sha256 = "sha256-9SsSXLZFwqsAeWFGsba8OG9bdmfQjn6qQHHQK6IdHK8=";
   };
 
-  vendorSha256 = "sha256-AYoespfzFLP/jIIxbw5K653wc7sSfLY8K7di8GZ64wA=";
+  vendorHash = "sha256-VRQUbGJTC2v8w/l4iaNn3vPX3AdV9Likp2nuG0PQieU=";
 
   doCheck = false;
 
diff --git a/pkgs/development/interpreters/jruby/default.nix b/pkgs/development/interpreters/jruby/default.nix
index e421f40824c0c..f1cc624b59e77 100644
--- a/pkgs/development/interpreters/jruby/default.nix
+++ b/pkgs/development/interpreters/jruby/default.nix
@@ -1,43 +1,44 @@
-{ lib, stdenv, callPackage, fetchurl, makeWrapper, jre }:
+{ lib, stdenv, callPackage, fetchurl, gitUpdater, mkRubyVersion, makeBinaryWrapper, jre }:
 
 let
-# The version number here is whatever is reported by the RUBY_VERSION string
-rubyVersion = callPackage ../ruby/ruby-version.nix {} "2" "5" "7" "";
-jruby = stdenv.mkDerivation rec {
+  # The version number here is whatever is reported by the RUBY_VERSION string
+  rubyVersion = mkRubyVersion "3" "1" "4" "";
+in
+stdenv.mkDerivation (finalAttrs: {
   pname = "jruby";
-
-  version = "9.3.9.0";
+  version = "9.4.5.0";
 
   src = fetchurl {
-    url = "https://s3.amazonaws.com/jruby.org/downloads/${version}/jruby-bin-${version}.tar.gz";
-    sha256 = "sha256-JR5t2NHS+CkiyMd414V+G++C/lyiz3e8CTVkIdCwWrg=";
+    url = "https://s3.amazonaws.com/jruby.org/downloads/${finalAttrs.version}/jruby-bin-${finalAttrs.version}.tar.gz";
+    hash = "sha256-pA94xGQczIZ1Lhay2iR/1ryfvPmkhkzxvjb3/3s1aEw=";
   };
 
-  nativeBuildInputs = [ makeWrapper ];
+  nativeBuildInputs = [ makeBinaryWrapper ];
 
   installPhase = ''
-     mkdir -pv $out/docs
-     mv * $out
-     rm $out/bin/*.{bat,dll,exe,sh}
-     mv $out/COPYING $out/LICENSE* $out/docs
+    mkdir -pv $out/share/jruby/docs
+    mv * $out
+    rm $out/bin/*.{bat,dll,exe,sh}
+    mv $out/samples $out/share/jruby/
+    mv $out/BSDL $out/COPYING $out/LEGAL $out/LICENSE* $out/share/jruby/docs/
 
-     for i in $out/bin/jruby{,.bash}; do
-       wrapProgram $i \
-         --set JAVA_HOME ${jre.home}
-     done
+    for i in $out/bin/jruby; do
+      wrapProgram $i \
+        --set JAVA_HOME ${jre.home}
+    done
 
-     ln -s $out/bin/jruby $out/bin/ruby
+    ln -s $out/bin/jruby $out/bin/ruby
 
-     # Bundler tries to create this directory
-     mkdir -pv $out/${passthru.gemPath}
-     mkdir -p $out/nix-support
-     cat > $out/nix-support/setup-hook <<EOF
-       addGemPath() {
-         addToSearchPath GEM_PATH \$1/${passthru.gemPath}
-       }
+    # Bundler tries to create this directory
+    mkdir -pv $out/${finalAttrs.passthru.gemPath}
+    mkdir -p $out/nix-support
+    cat > $out/nix-support/setup-hook <<EOF
+      addGemPath() {
+        addToSearchPath GEM_PATH \$1/${finalAttrs.passthru.gemPath}
+      }
 
-       addEnvHooks "$hostOffset" addGemPath
-     EOF
+      addEnvHooks "$hostOffset" addGemPath
+    EOF
   '';
 
   postFixup = ''
@@ -48,21 +49,21 @@ jruby = stdenv.mkDerivation rec {
     rubyEngine = "jruby";
     gemPath = "lib/${rubyEngine}/gems/${rubyVersion.libDir}";
     libPath = "lib/${rubyEngine}/${rubyVersion.libDir}";
+    devEnv = callPackage ../ruby/dev.nix {
+      ruby = finalAttrs.finalPackage;
+    };
+    updateScript = gitUpdater {
+      url = "https://github.com/jruby/jruby.git";
+    };
   };
 
   meta = with lib; {
     description = "Ruby interpreter written in Java";
-    homepage = "http://jruby.org/";
+    homepage = "https://www.jruby.org/";
+    changelog = "https://github.com/jruby/jruby/releases/tag/${finalAttrs.version}";
     license = with licenses; [ cpl10 gpl2 lgpl21 ];
-    platforms = platforms.unix;
+    platforms = jre.meta.platforms;
     maintainers = [ maintainers.fzakaria ];
     sourceProvenance = with sourceTypes; [ binaryBytecode ];
   };
-};
-in jruby.overrideAttrs (oldAttrs: {
-  passthru = oldAttrs.passthru // {
-    devEnv = callPackage ../ruby/dev.nix {
-      ruby = jruby;
-    };
-  };
 })
diff --git a/pkgs/development/interpreters/kamilalisp/default.nix b/pkgs/development/interpreters/kamilalisp/default.nix
new file mode 100644
index 0000000000000..e0554e10b4213
--- /dev/null
+++ b/pkgs/development/interpreters/kamilalisp/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, stdenv
+, fetchurl
+, jre
+, makeWrapper
+}:
+
+stdenv.mkDerivation rec {
+  name = "kamilalisp";
+  version = "0.3.0.1";
+
+  src = fetchurl {
+    url = "https://github.com/kspalaiologos/kamilalisp/releases/download/v${version}/kamilalisp-${version}.jar";
+    hash = "sha256-SW0U483eHptkYw+yJV/2cImfK3uEjkl8ma54yeagF6s=";
+  };
+
+  dontUnpack = true;
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    mkdir -pv $out/share/java $out/bin
+    cp ${src} $out/share/java/${name}-${version}.jar
+    makeWrapper ${jre}/bin/java $out/bin/kamilalisp \
+      --add-flags "-jar $out/share/java/${name}-${version}.jar" \
+      --set _JAVA_OPTIONS '-Dawt.useSystemAAFontSettings=on' \
+      --set _JAVA_AWT_WM_NONREPARENTING 1
+  '';
+
+  meta = {
+    homepage = "https://github.com/kspalaiologos/kamilalisp";
+    description = "A functional, flexible, and concise Lisp";
+    license = lib.licenses.gpl3Plus;
+    inherit (jre.meta) platforms;
+    maintainers = with lib.maintainers; [ cafkafk ];
+    sourceProvenance = [ lib.sourceTypes.binaryBytecode ];
+  };
+}
diff --git a/pkgs/development/interpreters/kerf/default.nix b/pkgs/development/interpreters/kerf/default.nix
index 0987205f59d91..99d9bb8710e45 100644
--- a/pkgs/development/interpreters/kerf/default.nix
+++ b/pkgs/development/interpreters/kerf/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     hash  = "sha256-0sU2zOk5I69lQyrn1g0qsae7S/IBT6eA/911qp0GNkk=";
   };
 
-  sourceRoot = "source/src";
+  sourceRoot = "${src.name}/src";
   buildInputs = [ libedit zlib ncurses ]
     ++ lib.optionals stdenv.isDarwin ([
       Accelerate
diff --git a/pkgs/development/interpreters/lambda-lisp/default.nix b/pkgs/development/interpreters/lambda-lisp/default.nix
new file mode 100644
index 0000000000000..f2979e7aa6795
--- /dev/null
+++ b/pkgs/development/interpreters/lambda-lisp/default.nix
@@ -0,0 +1,82 @@
+# Lambda Lisp has several backends, here we are using
+# the blc one. Ideally, this should be made into several
+# packages such as lambda-lisp-blc, lambda-lisp-lazyk,
+# lambda-lisp-clamb, etc.
+
+{ lib
+, gccStdenv
+, fetchFromGitHub
+, fetchurl
+, runtimeShell
+}:
+
+let
+  stdenv = gccStdenv;
+  s = import ./sources.nix { inherit fetchurl fetchFromGitHub; };
+in
+stdenv.mkDerivation rec {
+  pname = "lambda-lisp-blc";
+  version = s.lambdaLispVersion;
+  src = s.src;
+  flatSrc = s.flatSrc;
+  blcSrc = s.blcSrc;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p ./build
+    cp $blcSrc ./build/Blc.S
+    cp $flatSrc ./build/flat.lds
+    cd build;
+    cat Blc.S | sed -e 's/#define.*TERMS.*//' > Blc.ext.S;
+    $CC -c -DTERMS=50000000 -o Blc.o Blc.ext.S
+    ld.bfd -o Blc Blc.o -T flat.lds
+    cd ..;
+    mv build/Blc ./bin
+    install -D -t $out/bin bin/Blc
+    install -D -t $out/lib bin/lambdalisp.blc
+
+    cd build;
+    $CC ../tools/asc2bin.c -O2 -o asc2bin;
+    cd ..;
+    mv build/asc2bin ./bin;
+    chmod 755 ./bin/asc2bin;
+    install -D -t $out/bin bin/asc2bin
+
+    echo -e "#!${runtimeShell}\n( cat $out/lib/lambdalisp.blc | $out/bin/asc2bin; cat ) | $out/bin/Blc" > lambda-lisp-blc
+    chmod +x lambda-lisp-blc
+
+    install -D -t $out/bin lambda-lisp-blc
+    runHook postInstall
+  '';
+
+  doInstallCheck = true;
+
+  installCheckPhase = ''
+  runHook preInstallCheck
+
+  a=$(echo "(* (+ 1 2 3 4 5 6 7 8 9 10) 12020569 (- 2 5))" | $out/bin/lambda-lisp-blc | tr -d "> ");
+  test $a == -1983393885
+
+  runHook postInstallCheck
+  '';
+
+  meta = with lib; {
+    description = "A Lisp interpreter written in untyped lambda calculus";
+    homepage = "https://github.com/woodrush/lambdalisp";
+    longDescription = ''
+      LambdaLisp is a Lisp interpreter written as a closed untyped lambda calculus term.
+      It is written as a lambda calculus term LambdaLisp = λx. ... which takes a string
+      x as an input and returns a string as an output. The input x is the Lisp program
+      and the user's standard input, and the output is the standard output. Characters
+      are encoded into lambda term representations of natural numbers using the Church
+      encoding, and strings are encoded as a list of characters with lists expressed as
+      lambdas in the Mogensen-Scott encoding, so the entire computation process solely
+      consists of the beta-reduction of lambda terms, without introducing any
+      non-lambda-type object.
+    '';
+    license = licenses.mit;
+    maintainers = with maintainers; [ cafkafk ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/pkgs/development/interpreters/lambda-lisp/sources.nix b/pkgs/development/interpreters/lambda-lisp/sources.nix
new file mode 100644
index 0000000000000..8dbda01b4e27c
--- /dev/null
+++ b/pkgs/development/interpreters/lambda-lisp/sources.nix
@@ -0,0 +1,50 @@
+let
+  lambdaLispVersion = "2022-08-18";
+  blcVersion = "2";
+  # Archive of "https://justine.lol/lambda/";
+  justineLolArchive = "https://web.archive.org/web/20230614065521if_/https://justine.lol/lambda/";
+in
+{ fetchFromGitHub, fetchurl }: {
+  inherit blcVersion;
+  inherit lambdaLispVersion;
+
+  src = fetchFromGitHub {
+    owner = "woodrush";
+    repo = "lambdalisp";
+    rev = "2119cffed1ab2005f08ab3cfca92028270f08725";
+    hash = "sha256-ml2xQ8s8sux+6GwTw8mID3PEOcH6hn8tyc/UI5tFaO0=";
+  };
+
+  uniCSrc = fetchFromGitHub {
+    owner = "tromp";
+    repo = "tromp.github.io";
+    rev = "b4de12e566c1fb0fa3f3babe89bac885f4c966a4";
+    hash = "sha256-JmbqQp2kkkkkkkkSWQmG3uBxdgyIu4r2Ch8bBGyQ4H4=";
+  };
+
+  # needed later
+  clambSrc = fetchFromGitHub {
+    owner = "irori";
+    repo = "clamb";
+    rev = "44c1208697f394e22857195be5ea73bfdd48ebd1";
+    hash = "sha256-1lGg2NBoxAKDCSnnPn19r/hwBC5paAKUnlcsUv3dpNY=";
+  };
+
+  # needed later
+  lazykSrc = fetchFromGitHub {
+    owner = "irori";
+    repo = "lazyk";
+    rev = "5edb0b834d0af5f7413c484eb3795d47ec2e3894";
+    hash = "sha256-1lGg2NBoxAKDCSnnPn19r/hwBC5paAKUnlcsUv3dpNY=";
+  };
+
+  blcSrc = fetchurl {
+    url = "${justineLolArchive}Blc.S?v=${blcVersion}";
+    hash = "sha256-qt7vDtn9WvDoBaLESCyyscA0u74914e8ZKhLiUAN52A=";
+  };
+
+  flatSrc = fetchurl {
+    url = "${justineLolArchive}flat.lds";
+    hash = "sha256-HxX+10rV86zPv+UtF+n72obtz3DosWLMIab+uskxIjA=";
+  };
+}
diff --git a/pkgs/development/interpreters/love/0.7-gl-prototypes.patch b/pkgs/development/interpreters/love/0.7-gl-prototypes.patch
deleted file mode 100644
index 0b6778f6a90ba..0000000000000
--- a/pkgs/development/interpreters/love/0.7-gl-prototypes.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --unified --recursive --text love-HEAD.orig/src/modules/graphics/opengl/Framebuffer.cpp love-HEAD.new/src/modules/graphics/opengl/Framebuffer.cpp
---- love-HEAD.orig/src/modules/graphics/opengl/Framebuffer.cpp	2019-03-14 12:46:55.032982224 -0400
-+++ love-HEAD.new/src/modules/graphics/opengl/Framebuffer.cpp	2019-03-14 12:47:22.356175299 -0400
-@@ -1,3 +1,5 @@
-+#define GL_GLEXT_PROTOTYPES
-+
- #include "Framebuffer.h"
- #include <common/Matrix.h>
- 
-diff --unified --recursive --text love-HEAD.orig/src/modules/graphics/opengl/SpriteBatch.cpp love-HEAD.new/src/modules/graphics/opengl/SpriteBatch.cpp
---- love-HEAD.orig/src/modules/graphics/opengl/SpriteBatch.cpp	2019-03-14 12:46:55.032982224 -0400
-+++ love-HEAD.new/src/modules/graphics/opengl/SpriteBatch.cpp	2019-03-14 12:47:33.346119890 -0400
-@@ -18,6 +18,8 @@
- * 3. This notice may not be removed or altered from any source distribution.
- **/
- 
-+#define GL_GLEXT_PROTOTYPES
-+
- #include "SpriteBatch.h"
- 
- // STD
diff --git a/pkgs/development/interpreters/love/11.nix b/pkgs/development/interpreters/love/11.nix
index 768625e08cfa3..177c3f46086a6 100644
--- a/pkgs/development/interpreters/love/11.nix
+++ b/pkgs/development/interpreters/love/11.nix
@@ -6,13 +6,13 @@
 
 stdenv.mkDerivation rec {
   pname = "love";
-  version = "11.4";
+  version = "11.5";
 
   src = fetchFromGitHub {
     owner = "love2d";
     repo = "love";
     rev = version;
-    sha256 = "0kpdp6v8m8j0r7ppyy067shr0lfgrlh0dwb7ccws76d389vizwhb";
+    sha256 = "sha256-wZktNh4UB3QH2wAIIlnYUlNoXbjEDwUmPnT4vesZNm0=";
   };
 
   nativeBuildInputs = [ pkg-config autoconf automake ];
diff --git a/pkgs/development/interpreters/lua-5/build-lua-package.nix b/pkgs/development/interpreters/lua-5/build-luarocks-package.nix
index 0ae950216d8de..c388d0eef8c1d 100644
--- a/pkgs/development/interpreters/lua-5/build-lua-package.nix
+++ b/pkgs/development/interpreters/lua-5/build-luarocks-package.nix
@@ -3,6 +3,8 @@
 , lua
 , wrapLua
 , luarocks
+, writeTextFile
+
 # Whether the derivation provides a lua module or not.
 , luarocksCheckHook
 , luaLib
@@ -38,13 +40,7 @@
 
 # Skip wrapping of lua programs altogether
 , dontWrapLuaPrograms ? false
-
-, meta ? {}
-
-, passthru ? {}
 , doCheck ? false
-, doInstallCheck ? false
-
 # Non-Lua / system (e.g. C library) dependencies. Is a list of deps, where
 # each dep is either a derivation, or an attribute set like
 # { name = "rockspec external_dependencies key"; dep = derivation; }
@@ -73,7 +69,6 @@
 # Keep extra attributes from `attrs`, e.g., `patchPhase', etc.
 
 let
-  generatedRockspecFilename = "${rockspecDir}/${pname}-${rockspecVersion}.rockspec";
 
   # TODO fix warnings "Couldn't load rockspec for ..." during manifest
   # construction -- from initial investigation, appears it will require
@@ -82,43 +77,33 @@ let
   # configured trees)
   luarocks_config = "luarocks-config.lua";
 
-  # Filter out the lua derivation itself from the Lua module dependency
-  # closure, as it doesn't have a rock tree :)
-  requiredLuaRocks = lib.filter (d: d ? luaModule)
-    (lua.pkgs.requiredLuaModules (luarocksDrv.nativeBuildInputs ++ luarocksDrv.propagatedBuildInputs));
-
-  # example externalDeps': [ { name = "CRYPTO"; dep = pkgs.openssl; } ]
-  externalDepsGenerated = lib.unique (lib.filter (drv: !drv ? luaModule) (
-    luarocksDrv.nativeBuildInputs ++ luarocksDrv.propagatedBuildInputs ++ luarocksDrv.buildInputs)
-    );
-  externalDeps' = lib.filter (dep: !lib.isDerivation dep) externalDeps;
-
-  luarocksDrv = luaLib.toLuaModule ( lua.stdenv.mkDerivation (self: let
-
-    rocksSubdir = "${self.pname}-${self.version}-rocks";
-    luarocks_content = let
-      generatedConfig = luaLib.generateLuarocksConfig {
-        externalDeps = externalDeps ++ externalDepsGenerated;
-        inherit extraVariables rocksSubdir requiredLuaRocks;
-      };
-      in
-        ''
-        ${generatedConfig}
-        ${extraConfig}
-        '';
-    in builtins.removeAttrs attrs ["disabled" "externalDeps" "extraVariables"] // {
+  luarocksDrv = luaLib.toLuaModule ( lua.stdenv.mkDerivation (self: attrs // {
 
   name = namePrefix + pname + "-" + self.version;
   inherit rockspecVersion;
 
+  __structuredAttrs = true;
+  env = {
+    LUAROCKS_CONFIG = self.configFile;
+  } // attrs.env or {};
+
+  generatedRockspecFilename = "${rockspecDir}/${pname}-${rockspecVersion}.rockspec";
+
   nativeBuildInputs = [
     wrapLua
     luarocks
-  ] ++ lib.optionals doCheck ([ luarocksCheckHook ] ++ self.nativeCheckInputs);
+  ];
 
-  buildInputs = buildInputs
-    ++ (map (d: d.dep) externalDeps');
+  inherit doCheck extraVariables rockspecFilename knownRockspec externalDeps nativeCheckInputs;
 
+  buildInputs = let
+    # example externalDeps': [ { name = "CRYPTO"; dep = pkgs.openssl; } ]
+    externalDeps' = lib.filter (dep: !lib.isDerivation dep) self.externalDeps;
+    in [ lua.pkgs.luarocks ]
+      ++ buildInputs
+      ++ lib.optionals self.doCheck ([ luarocksCheckHook ] ++ self.nativeCheckInputs)
+      ++ (map (d: d.dep) externalDeps')
+    ;
 
   # propagate lua to active setup-hook in nix-shell
   propagatedBuildInputs = propagatedBuildInputs ++ [ lua ];
@@ -126,25 +111,42 @@ let
   # @-patterns do not capture formal argument default values, so we need to
   # explicitly inherit this for it to be available as a shell variable in the
   # builder
-  inherit rocksSubdir;
+  rocksSubdir = "${self.pname}-${self.version}-rocks";
+
+  configFile = writeTextFile {
+    name = pname + "-luarocks-config.lua";
+    text = self.luarocks_content;
+  };
+
+  luarocks_content = let
+      externalDepsGenerated = lib.filter (drv: !drv ? luaModule)
+        (self.nativeBuildInputs ++ self.propagatedBuildInputs ++ self.buildInputs);
+    generatedConfig = luaLib.generateLuarocksConfig {
+      externalDeps = lib.unique (self.externalDeps ++ externalDepsGenerated);
+      # Filter out the lua derivation itself from the Lua module dependency
+      # closure, as it doesn't have a rock tree :)
+      # luaLib.hasLuaModule
+      requiredLuaRocks = lib.filter luaLib.hasLuaModule
+        (lua.pkgs.requiredLuaModules (self.nativeBuildInputs ++ self.propagatedBuildInputs));
+      inherit (self) extraVariables rocksSubdir;
+    };
+    in
+      ''
+      ${generatedConfig}
+      ${extraConfig}
+      '';
 
   configurePhase = ''
     runHook preConfigure
-
-    cat > ${luarocks_config} <<EOF
-    ${luarocks_content}
-    EOF
-    export LUAROCKS_CONFIG="$PWD/${luarocks_config}";
   ''
-  + lib.optionalString (rockspecFilename == null) ''
-    rockspecFilename="${generatedRockspecFilename}"
+  + lib.optionalString (self.rockspecFilename == null) ''
+    rockspecFilename="${self.generatedRockspecFilename}"
   ''
-  + lib.optionalString (knownRockspec != null) ''
-
+  + lib.optionalString (self.knownRockspec != null) ''
     # prevents the following type of error:
     # Inconsistency between rockspec filename (42fm1b3d7iv6fcbhgm9674as3jh6y2sh-luv-1.22.0-1.rockspec) and its contents (luv-1.22.0-1.rockspec)
-    rockspecFilename="$TMP/$(stripHash ''${knownRockspec})"
-    cp ''${knownRockspec} "$rockspecFilename"
+    rockspecFilename="$TMP/$(stripHash ${self.knownRockspec})"
+    cp ${self.knownRockspec} "$rockspecFilename"
   ''
   + ''
     runHook postConfigure
@@ -155,9 +157,9 @@ let
 
     nix_debug "Using LUAROCKS_CONFIG=$LUAROCKS_CONFIG"
 
-    LUAROCKS=luarocks
+    LUAROCKS_EXTRA_ARGS=""
     if (( ''${NIX_DEBUG:-0} >= 1 )); then
-        LUAROCKS="$LUAROCKS --verbose"
+        LUAROCKS_EXTRA_ARGS=" --verbose"
     fi
 
     runHook postBuild
@@ -167,7 +169,7 @@ let
     wrapLuaPrograms
   '' + attrs.postFixup or "";
 
-  installPhase = attrs.installPhase or ''
+  installPhase = ''
     runHook preInstall
 
     # work around failing luarocks test for Write access
@@ -182,21 +184,17 @@ let
     # maybe we could reestablish dependency checking via passing --rock-trees
 
     nix_debug "ROCKSPEC $rockspecFilename"
-    nix_debug "cwd: $PWD"
-    $LUAROCKS make --deps-mode=all --tree=$out ''${rockspecFilename}
+    luarocks $LUAROCKS_EXTRA_ARGS make --deps-mode=all --tree=$out ''${rockspecFilename}
 
     runHook postInstall
   '';
 
-
-  checkPhase = attrs.checkPhase or ''
+  checkPhase = ''
     runHook preCheck
-    $LUAROCKS test
+    luarocks test
     runHook postCheck
   '';
 
-  LUAROCKS_CONFIG="$PWD/${luarocks_config}";
-
   shellHook = ''
     runHook preShell
     export LUAROCKS_CONFIG="$PWD/${luarocks_config}";
@@ -204,17 +202,15 @@ let
   '';
 
   passthru = {
-    inherit lua; # The lua interpreter
-    inherit externalDeps;
-    inherit luarocks_content;
-  } // passthru;
+    inherit lua;
+  } // attrs.passthru or { };
 
   meta = {
     platforms = lua.meta.platforms;
     # add extra maintainer(s) to every package
-    maintainers = (meta.maintainers or []) ++ [ ];
+    maintainers = (attrs.meta.maintainers or []) ++ [ ];
     broken = disabled;
-  } // meta;
+  } // attrs.meta or {};
 }));
 in
   luarocksDrv
diff --git a/pkgs/development/interpreters/lua-5/default.nix b/pkgs/development/interpreters/lua-5/default.nix
index 139dd09e72a33..2fda54bef530f 100644
--- a/pkgs/development/interpreters/lua-5/default.nix
+++ b/pkgs/development/interpreters/lua-5/default.nix
@@ -1,5 +1,5 @@
 # similar to interpreters/python/default.nix
-{ stdenv, lib, callPackage, fetchFromGitHub, fetchurl, fetchpatch, makeBinaryWrapper }:
+{ stdenv, config, lib, callPackage, fetchFromGitHub, fetchurl, fetchpatch, makeBinaryWrapper }:
 
 
 let
@@ -23,7 +23,7 @@ let
         # - imports lua-packages.nix
         # - adds spliced package sets to the package set
         # - applies overrides from `packageOverrides`
-        ({ lua, overrides, callPackage, makeScopeWithSplicing }: let
+        ({ lua, overrides, callPackage, makeScopeWithSplicing' }: let
           luaPackagesFun = callPackage ../../../top-level/lua-packages.nix {
             lua = self;
           };
@@ -39,18 +39,21 @@ let
             selfHostHost = luaOnHostForHost.pkgs;
             selfTargetTarget = luaOnTargetForTarget.pkgs or {};
           };
-          keep = self: { };
-          extra = spliced0: {};
+
+          aliases = final: prev:
+            lib.optionalAttrs config.allowAliases
+              (import ../../lua-modules/aliases.nix lib final prev);
+
           extensions = lib.composeManyExtensions [
+            aliases
             generatedPackages
             overriddenPackages
             overrides
           ];
-        in makeScopeWithSplicing
-          otherSplices
-          keep
-          extra
-          (lib.extends extensions luaPackagesFun))
+        in makeScopeWithSplicing' {
+          inherit otherSplices;
+          f = lib.extends extensions luaPackagesFun;
+        })
         {
           overrides = packageOverrides;
           lua = self;
@@ -77,29 +80,12 @@ in
 rec {
   lua5_4 = callPackage ./interpreter.nix {
     self = lua5_4;
-    version = "5.4.4";
-    hash = "sha256-Fkx4SWU7gK5nvsS3RzuIS/XMjS3KBWU0dewu0nuev2E=";
+    version = "5.4.6";
+    hash = "sha256-fV6huctqoLWco93hxq3LV++DobqOVDLA7NBr9DmzrYg=";
     makeWrapper = makeBinaryWrapper;
     inherit passthruFun;
 
-    patches = lib.optional stdenv.isDarwin ./5.4.darwin.patch
-      ++ [
-        (fetchpatch {
-          name = "CVE-2022-28805.patch";
-          url = "https://github.com/lua/lua/commit/1f3c6f4534c6411313361697d98d1145a1f030fa.patch";
-          sha256 = "sha256-YTwoolSnRNJIHFPVijSO6ZDw35BG5oWYralZ8qOb9y8=";
-          stripLen = 1;
-          extraPrefix = "src/";
-          excludes = [ "src/testes/*" ];
-        })
-        (fetchpatch {
-          name = "CVE-2022-33099.patch";
-          url = "https://github.com/lua/lua/commit/42d40581dd919fb134c07027ca1ce0844c670daf.patch";
-          sha256 = "sha256-qj1Dq1ojVoknALSa67jhgH3G3Kk4GtJP6ROFElVF+D0=";
-          stripLen = 1;
-          extraPrefix = "src/";
-        })
-      ];
+    patches = lib.optional stdenv.isDarwin ./5.4.darwin.patch;
   };
 
   lua5_4_compat = lua5_4.override({
diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix
index 0dfb5808eac31..4091fdd49e0e4 100644
--- a/pkgs/development/interpreters/lua-5/interpreter.nix
+++ b/pkgs/development/interpreters/lua-5/interpreter.nix
@@ -1,6 +1,5 @@
 { lib, stdenv, fetchurl, readline
 , compat ? false
-, callPackage
 , makeWrapper
 , self
 , packageOverrides ? (final: prev: {})
@@ -18,39 +17,43 @@
 , staticOnly ? stdenv.hostPlatform.isStatic
 , luaAttr ? "lua${lib.versions.major version}_${lib.versions.minor version}"
 } @ inputs:
-let
-  luaPackages = self.pkgs;
-
-  luaversion = lib.versions.majorMinor version;
-
-plat = if (stdenv.isLinux && lib.versionOlder self.luaversion "5.4") then "linux"
-       else if (stdenv.isLinux && lib.versionAtLeast self.luaversion "5.4") then "linux-readline"
-       else if stdenv.isDarwin then "macosx"
-       else if stdenv.hostPlatform.isMinGW then "mingw"
-       else if stdenv.isFreeBSD then "freebsd"
-       else if stdenv.isSunOS then "solaris"
-       else if stdenv.hostPlatform.isBSD then "bsd"
-       else if stdenv.hostPlatform.isUnix then "posix"
-       else "generic";
-
-compatFlags = if (lib.versionOlder self.luaversion "5.3") then " -DLUA_COMPAT_ALL"
-              else if (lib.versionOlder self.luaversion "5.4") then " -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2"
-              else " -DLUA_COMPAT_5_3";
-in
-
-stdenv.mkDerivation rec {
+
+stdenv.mkDerivation (finalAttrs:
+  let
+    luaPackages = self.pkgs;
+
+    luaversion = lib.versions.majorMinor version;
+
+    plat = if (stdenv.isLinux && lib.versionOlder self.luaversion "5.4") then "linux"
+          else if (stdenv.isLinux && lib.versionAtLeast self.luaversion "5.4") then "linux-readline"
+          else if stdenv.isDarwin then "macosx"
+          else if stdenv.hostPlatform.isMinGW then "mingw"
+          else if stdenv.isFreeBSD then "freebsd"
+          else if stdenv.isSunOS then "solaris"
+          else if stdenv.hostPlatform.isBSD then "bsd"
+          else if stdenv.hostPlatform.isUnix then "posix"
+          else "generic";
+
+    compatFlags = if (lib.versionOlder self.luaversion "5.3") then " -DLUA_COMPAT_ALL"
+                  else if (lib.versionOlder self.luaversion "5.4") then " -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2"
+                  else " -DLUA_COMPAT_5_3";
+  in
+
+  {
   pname = "lua";
   inherit version;
   outputs = [ "out" "doc" ];
 
   src = fetchurl {
-    url = "https://www.lua.org/ftp/${pname}-${version}.tar.gz";
+    url = "https://www.lua.org/ftp/${finalAttrs.pname}-${finalAttrs.version}.tar.gz";
     sha256 = hash;
   };
 
-  LuaPathSearchPaths    = luaPackages.luaLib.luaPathList;
-  LuaCPathSearchPaths   = luaPackages.luaLib.luaCPathList;
-  setupHook = luaPackages.lua-setup-hook LuaPathSearchPaths LuaCPathSearchPaths;
+  LuaPathSearchPaths  = luaPackages.luaLib.luaPathList;
+  LuaCPathSearchPaths = luaPackages.luaLib.luaCPathList;
+  setupHook = luaPackages.lua-setup-hook
+    finalAttrs.LuaPathSearchPaths
+    finalAttrs.LuaCPathSearchPaths;
 
   nativeBuildInputs = [ makeWrapper ];
   buildInputs = [ readline ];
@@ -150,7 +153,7 @@ stdenv.mkDerivation rec {
     luaOnBuildForHost = override pkgsBuildHost.${luaAttr};
     luaOnBuildForTarget = override pkgsBuildTarget.${luaAttr};
     luaOnHostForHost = override pkgsHostHost.${luaAttr};
-    luaOnTargetForTarget = if lib.hasAttr luaAttr pkgsTargetTarget then (override pkgsTargetTarget.${luaAttr}) else {};
+    luaOnTargetForTarget = lib.optionalAttrs (lib.hasAttr luaAttr pkgsTargetTarget) (override pkgsTargetTarget.${luaAttr});
   };
 
   meta = {
@@ -167,4 +170,4 @@ stdenv.mkDerivation rec {
     license = lib.licenses.mit;
     platforms = lib.platforms.unix;
   };
-}
+})
diff --git a/pkgs/development/interpreters/lua-5/wrap-lua.nix b/pkgs/development/interpreters/lua-5/wrap-lua.nix
index 43ececd1e794c..b6e24a44ee656 100644
--- a/pkgs/development/interpreters/lua-5/wrap-lua.nix
+++ b/pkgs/development/interpreters/lua-5/wrap-lua.nix
@@ -4,7 +4,7 @@
 , makeWrapper
 }:
 
-# defined in trivial-builders.nix
+# defined in trivial-builders
 # imported as wrapLua in lua-packages.nix and passed to build-lua-derivation to be used as buildInput
 makeSetupHook {
   name = "wrap-lua-hook";
diff --git a/pkgs/development/interpreters/luajit/2.0.nix b/pkgs/development/interpreters/luajit/2.0.nix
index 78abb742c407a..29ad88f0ec160 100644
--- a/pkgs/development/interpreters/luajit/2.0.nix
+++ b/pkgs/development/interpreters/luajit/2.0.nix
@@ -1,13 +1,15 @@
 { self, callPackage, fetchFromGitHub, lib, passthruFun }:
 
-callPackage ./default.nix {
-  version = "2.0.5-2022-09-13";
+callPackage ./default.nix rec {
+  # The patch version is the timestamp of the git commit,
+  # obtain via `cat $(nix-build -A luajit_2_0.src)/.relver`
+  version = "2.0.1693340858";
 
   src = fetchFromGitHub {
     owner = "LuaJIT";
     repo = "LuaJIT";
-    rev = "46e62cd963a426e83a60f691dcbbeb742c7b3ba2";
-    hash = "sha256-/XR9+6NjXs2TrUVKJNkH2h970BkDNFqMDJTWcy/bswU=";
+    rev = "c6ee7e19d107b4f9a140bb2ccf99162e26318c69";
+    hash = "sha256-3/7ASZRniytw5RkOy0F9arHkZevq6dxmya+Ba3A5IIA=";
   };
 
   extraMeta = { # this isn't precise but it at least stops the useless Hydra build
diff --git a/pkgs/development/interpreters/luajit/2.1.nix b/pkgs/development/interpreters/luajit/2.1.nix
index 8efb86ab01742..cf8531b7352d4 100644
--- a/pkgs/development/interpreters/luajit/2.1.nix
+++ b/pkgs/development/interpreters/luajit/2.1.nix
@@ -1,13 +1,15 @@
 { self, callPackage, fetchFromGitHub, passthruFun }:
 
-callPackage ./default.nix {
-  version = "2.1.0-2022-10-04";
+callPackage ./default.nix rec {
+  # The patch version is the timestamp of the git commit,
+  # obtain via `cat $(nix-build -A luajit_2_1.src)/.relver`
+  version = "2.1.1693350652";
 
   src = fetchFromGitHub {
     owner = "LuaJIT";
     repo = "LuaJIT";
-    rev = "6c4826f12c4d33b8b978004bc681eb1eef2be977";
-    hash = "sha256-GMgoSVHrfIuLdk8mW9XgdemNFsAkkQR4wiGGjaAXAKg=";
+    rev = "41fb94defa8f830ce69a8122b03f6ac3216d392a";
+    hash = "sha256-iY80CA97RqJ9gF1Kl7ms/lC6m6KScjxWmljh5Gy7Brg=";
   };
 
   inherit self passthruFun;
diff --git a/pkgs/development/interpreters/luajit/default.nix b/pkgs/development/interpreters/luajit/default.nix
index ddb49b40ff64d..211fa56e91197 100644
--- a/pkgs/development/interpreters/luajit/default.nix
+++ b/pkgs/development/interpreters/luajit/default.nix
@@ -1,11 +1,9 @@
 { lib
 , stdenv
-, fetchFromGitHub
 , buildPackages
 , version
 , src
 , extraMeta ? { }
-, callPackage
 , self
 , packageOverrides ? (final: prev: {})
 , pkgsBuildBuild
@@ -24,6 +22,7 @@
 , enableGDBJITSupport ? false
 , enableAPICheck ? false
 , enableVMAssertions ? false
+, enableRegisterAllocationRandomization ? false
 , useSystemMalloc ? false
 # Upstream generates randomized string id's by default for security reasons
 # https://github.com/LuaJIT/LuaJIT/issues/626. Deterministic string id's should
@@ -50,6 +49,7 @@ let
     ++ optional enableGDBJITSupport "-DLUAJIT_USE_GDBJIT"
     ++ optional enableAPICheck "-DLUAJIT_USE_APICHECK"
     ++ optional enableVMAssertions "-DLUAJIT_USE_ASSERT"
+    ++ optional enableRegisterAllocationRandomization "-DLUAJIT_RANDOM_RA"
     ++ optional deterministicStringIds "-DLUAJIT_SECURITY_STRID=0"
   ;
 
@@ -98,7 +98,8 @@ stdenv.mkDerivation rec {
     "DEFAULT_CC=cc"
     "CROSS=${stdenv.cc.targetPrefix}"
     "HOST_CC=${buildStdenv.cc}/bin/cc"
-  ] ++ lib.optional enableJITDebugModule "INSTALL_LJLIBD=$(INSTALL_LMOD)";
+  ] ++ lib.optional enableJITDebugModule "INSTALL_LJLIBD=$(INSTALL_LMOD)"
+    ++ lib.optional stdenv.hostPlatform.isStatic "BUILDMODE=static";
   enableParallelBuilding = true;
   env.NIX_CFLAGS_COMPILE = toString XCFLAGS;
 
@@ -127,7 +128,7 @@ stdenv.mkDerivation rec {
     luaOnBuildForHost = override pkgsBuildHost.${luaAttr};
     luaOnBuildForTarget = override pkgsBuildTarget.${luaAttr};
     luaOnHostForHost = override pkgsHostHost.${luaAttr};
-    luaOnTargetForTarget = if lib.hasAttr luaAttr pkgsTargetTarget then (override pkgsTargetTarget.${luaAttr}) else {};
+    luaOnTargetForTarget = lib.optionalAttrs (lib.hasAttr luaAttr pkgsTargetTarget) (override pkgsTargetTarget.${luaAttr});
   };
 
   meta = with lib; {
diff --git a/pkgs/development/interpreters/luau/default.nix b/pkgs/development/interpreters/luau/default.nix
index 27e9eaa0e10af..bf81832f464b1 100644
--- a/pkgs/development/interpreters/luau/default.nix
+++ b/pkgs/development/interpreters/luau/default.nix
@@ -1,18 +1,20 @@
-{ lib, stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake, llvmPackages }:
 
 stdenv.mkDerivation rec {
   pname = "luau";
-  version = "0.569";
+  version = "0.603";
 
   src = fetchFromGitHub {
-    owner = "Roblox";
+    owner = "luau-lang";
     repo = "luau";
     rev = version;
-    hash = "sha256-SvHwFsyM3Oe4k2Flx1XhTSkHOIDe9PKjlyJ+OyHFcQE=";
+    hash = "sha256-8jm58F2AQcmjy19fydGLOD5fehaaNHGqXtDPu121jmw=";
   };
 
   nativeBuildInputs = [ cmake ];
 
+  buildInputs = lib.optionals stdenv.cc.isClang [ llvmPackages.libunwind ];
+
   installPhase = ''
     runHook preInstall
 
@@ -34,8 +36,9 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with lib; {
-    homepage = "https://luau-lang.org/";
     description = "A fast, small, safe, gradually typed embeddable scripting language derived from Lua";
+    homepage = "https://luau-lang.org/";
+    changelog = "https://github.com/luau-lang/luau/releases/tag/${version}";
     license = licenses.mit;
     platforms = platforms.all;
     maintainers = [ maintainers.marsam ];
diff --git a/pkgs/development/interpreters/lunatic/default.nix b/pkgs/development/interpreters/lunatic/default.nix
index b056b7a133b4f..637c7710975e4 100644
--- a/pkgs/development/interpreters/lunatic/default.nix
+++ b/pkgs/development/interpreters/lunatic/default.nix
@@ -1,19 +1,34 @@
-{ lib, rustPlatform, fetchFromGitHub, stdenv, Security }:
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, pkg-config
+, openssl
+, stdenv
+, darwin
+}:
 
 rustPlatform.buildRustPackage rec {
   pname = "lunatic";
-  version = "0.12.0";
+  version = "0.13.2";
 
   src = fetchFromGitHub {
     owner = "lunatic-solutions";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-7fxccufM5tunbutABEtsa6++OLTsS72oA219zvf+KN8=";
+    hash = "sha256-uMMssZaPDZn3bOtQIho+GvUCPmzRllv7eJ+SJuKaYtg=";
   };
 
-  cargoSha256 = "sha256-sHSQUvHTwyqMrGmwpblqpS4HfFiWGb+70a1uloDu2wY=";
+  cargoHash = "sha256-ALjlQsxmZVREyi3ZGMJMv/38kkMjYh+hTSr/0avYJVs=";
 
-  buildInputs = lib.optional stdenv.isDarwin Security;
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  buildInputs = [
+    openssl
+  ] ++ lib.optionals stdenv.isDarwin [
+    darwin.apple_sdk.frameworks.Security
+  ];
 
   checkFlags = [
     # requires simd support which is not always available on hydra
@@ -23,7 +38,7 @@ rustPlatform.buildRustPackage rec {
   meta = with lib; {
     description = "An Erlang inspired runtime for WebAssembly";
     homepage = "https://lunatic.solutions";
-    changelog = "https://github.com/lunatic-solutions/lunatic/blob/v${version}/RELEASES.md";
+    changelog = "https://github.com/lunatic-solutions/lunatic/blob/v${version}/CHANGELOG.md";
     license = with licenses; [ mit /* or */ asl20 ];
     maintainers = with maintainers; [ figsoda ];
   };
diff --git a/pkgs/development/interpreters/lune/default.nix b/pkgs/development/interpreters/lune/default.nix
new file mode 100644
index 0000000000000..cb6f532e2bc96
--- /dev/null
+++ b/pkgs/development/interpreters/lune/default.nix
@@ -0,0 +1,54 @@
+{ lib
+, stdenv
+, rustPlatform
+, fetchFromGitHub
+, pkg-config
+, darwin
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "lune";
+  version = "0.7.11";
+
+  src = fetchFromGitHub {
+    owner = "filiptibell";
+    repo = "lune";
+    rev = "v${version}";
+    hash = "sha256-5agoAXeO16/CihsgvUHt+pgA+/ph6PualTY6xqDQbeU=";
+    fetchSubmodules = true;
+  };
+
+  cargoHash = "sha256-kPBPxlsicoFDyOsuJWhvQHDC2uwYQqpd7S+kQPRd8DY=";
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  buildInputs = lib.optionals stdenv.isDarwin [
+    darwin.apple_sdk.frameworks.Security
+  ];
+
+  checkFlags = [
+    # these all require internet access
+    "--skip=tests::net_request_codes"
+    "--skip=tests::net_request_compression"
+    "--skip=tests::net_request_methods"
+    "--skip=tests::net_request_query"
+    "--skip=tests::net_request_redirect"
+    "--skip=tests::net_socket_wss"
+    "--skip=tests::net_socket_wss_rw"
+    "--skip=tests::roblox_instance_custom_async"
+    "--skip=tests::serde_json_decode"
+
+    # this tries to use the root directory as the CWD
+    "--skip=tests::process_spawn_cwd"
+  ];
+
+  meta = with lib; {
+    description = "A standalone Luau script runtime";
+    homepage = "https://github.com/filiptibell/lune";
+    changelog = "https://github.com/filiptibell/lune/blob/${src.rev}/CHANGELOG.md";
+    license = licenses.mpl20;
+    maintainers = with maintainers; [ lammermann ];
+  };
+}
diff --git a/pkgs/development/interpreters/maude/default.nix b/pkgs/development/interpreters/maude/default.nix
index da4df0fb79a29..7c08b795d6a51 100644
--- a/pkgs/development/interpreters/maude/default.nix
+++ b/pkgs/development/interpreters/maude/default.nix
@@ -1,16 +1,11 @@
 { lib, stdenv, fetchurl, unzip, makeWrapper, flex, bison, ncurses, buddy, tecla
 , libsigsegv, gmpxx, cln, yices
+# passthru.tests
+, tamarin-prover
 }:
 
 let
-
-  version = "3.1";
-
-  fullMaude = fetchurl {
-    url = "http://maude.cs.illinois.edu/w/images/0/0a/Full-Maude-${version}.zip";
-    sha256 = "8b13af02c6243116c2ef9592622ecaa06d05dbe1dd6b1e595551ff33855948f2";
-  };
-
+  version = "3.3.1";
 in
 
 stdenv.mkDerivation {
@@ -18,8 +13,8 @@ stdenv.mkDerivation {
   inherit version;
 
   src = fetchurl {
-    url = "http://maude.cs.illinois.edu/w/images/d/d3/Maude-${version}.tar.gz";
-    sha256 = "b112d7843f65217e3b5a9d40461698ef8dab7cbbe830af21216dfb924dc88a2f";
+    url = "https://github.com/SRI-CSL/Maude/archive/refs/tags/Maude${version}.tar.gz";
+    sha256 = "ueM8qi3fLogWT8bA+ZyBnd9Zr9oOKuoiu2YpG6o5J1E=";
   };
 
   nativeBuildInputs = [ flex bison unzip makeWrapper ];
@@ -34,7 +29,10 @@ stdenv.mkDerivation {
   # https://gitweb.gentoo.org/repo/gentoo.git/commit/dev-lang/maude/maude-3.1-r1.ebuild?id=f021cc6cfa1e35eb9c59955830f1fd89bfcb26b4
   configureFlags = [ "--without-libsigsegv" ];
 
+  # Certain tests (in particular, Misc/fileTest) expect us to build in a subdirectory
+  # We'll use the directory Opt/ as suggested in INSTALL
   preConfigure = ''
+    mkdir Opt; cd Opt
     configureFlagsArray=(
       --datadir="$out/share/maude"
       TECLA_LIBS="-ltecla -lncursesw"
@@ -42,19 +40,20 @@ stdenv.mkDerivation {
       CFLAGS="-O3" CXXFLAGS="-O3"
     )
   '';
+  configureScript = "../configure";
 
   doCheck = true;
 
   postInstall = ''
     for n in "$out/bin/"*; do wrapProgram "$n" --suffix MAUDE_LIB ':' "$out/share/maude"; done
-    unzip ${fullMaude}
-    install -D -m 444 full-maude31.maude $out/share/maude/full-maude.maude
   '';
 
-  # bison -dv surface.yy -o surface.c
-  # mv surface.c surface.cc
-  # mv: cannot stat 'surface.c': No such file or directory
-  enableParallelBuilding = false;
+  passthru.tests = {
+    # tamarin-prover only supports specific versions of maude explicitly
+    inherit tamarin-prover;
+  };
+
+  enableParallelBuilding = true;
 
   meta = {
     broken = stdenv.isDarwin;
diff --git a/pkgs/development/interpreters/micropython/default.nix b/pkgs/development/interpreters/micropython/default.nix
index 52be0a412078e..e97afb643c11d 100644
--- a/pkgs/development/interpreters/micropython/default.nix
+++ b/pkgs/development/interpreters/micropython/default.nix
@@ -9,13 +9,13 @@
 
 stdenv.mkDerivation rec {
   pname = "micropython";
-  version = "1.19.1";
+  version = "1.21.0";
 
   src = fetchFromGitHub {
     owner = "micropython";
     repo = "micropython";
     rev = "v${version}";
-    sha256 = "sha256-BoX3Z3Zr/AQqkgRrq+UVgdoDqNESDTNsY9AtrElpzfA=";
+    sha256 = "sha256-nUQSj2grq4fNyqOZyYZfYvLwoEXI4PZCYdVXvxLGmPk=";
     fetchSubmodules = true;
   };
 
@@ -33,7 +33,6 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   skippedTests = ""
-    + lib.optionalString (stdenv.isDarwin) " -e uasyncio_basic -e uasyncio_heaplock -e uasyncio_wait_task"
     + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) " -e ffi_callback"
     + lib.optionalString (stdenv.isLinux && stdenv.isAarch64) " -e float_parse"
   ;
@@ -49,7 +48,7 @@ stdenv.mkDerivation rec {
   installPhase = ''
     runHook preInstall
     mkdir -p $out/bin
-    install -Dm755 ports/unix/micropython -t $out/bin
+    install -Dm755 ports/unix/build-standard/micropython -t $out/bin
     runHook postInstall
   '';
 
diff --git a/pkgs/development/interpreters/mujs/default.nix b/pkgs/development/interpreters/mujs/default.nix
index 1c0db241c1c84..a7b53bb8d4658 100644
--- a/pkgs/development/interpreters/mujs/default.nix
+++ b/pkgs/development/interpreters/mujs/default.nix
@@ -1,28 +1,33 @@
-{ lib, stdenv, fetchurl, fetchpatch, readline }:
+{ lib
+, stdenv
+, fetchurl
+, fixDarwinDylibNames
+, readline
+, gitUpdater
+}:
 
 stdenv.mkDerivation rec {
   pname = "mujs";
-  version = "1.3.2";
+  version = "1.3.4";
 
   src = fetchurl {
-    url = "https://mujs.com/downloads/mujs-${version}.tar.xz";
-    sha256 = "sha256-SIZZP8aIsM3M0x5ey+Wv560b7iOqaeZnuHGv1d/GQMM=";
+    url = "https://mujs.com/downloads/mujs-${version}.tar.gz";
+    hash = "sha256-wBVHWID2o4LnBhaclDcafdbMIgeIMvbghlr4KJwu9Cs=";
   };
 
-  patches = lib.optionals stdenv.isDarwin [
-    (fetchpatch {
-      # ld: library not found for -l:libmujs.a
-      name = "darwin-failures.patch";
-      url = "https://git.ghostscript.com/?p=mujs.git;a=patch;h=d592c785c0b2f9fea982ac3fe7b88fdd7c4817fc";
-      sha256 = "sha256-/57A7S65LWZFyQIGe+LtqDMu85K1N/hbztXB+/nCDJk=";
-      revert = true;
-    })
-  ];
-
   buildInputs = [ readline ];
 
+  nativeBuildInputs = lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
+
   makeFlags = [ "prefix=$(out)" ];
 
+  installFlags = [ "install-shared" ];
+
+  passthru.updateScript = gitUpdater {
+    # No nicer place to track releases
+    url = "git://git.ghostscript.com/mujs.git";
+  };
+
   meta = with lib; {
     homepage = "https://mujs.com/";
     description = "A lightweight, embeddable Javascript interpreter";
diff --git a/pkgs/development/interpreters/nelua/default.nix b/pkgs/development/interpreters/nelua/default.nix
index 8030980b77886..5871d166c7db8 100644
--- a/pkgs/development/interpreters/nelua/default.nix
+++ b/pkgs/development/interpreters/nelua/default.nix
@@ -1,22 +1,30 @@
-{ lib, stdenv, fetchFromGitHub, luaPackages }:
+{ lib, stdenv, fetchFromGitHub, luaPackages, unstableGitUpdater }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   pname = "nelua";
-  version = "unstable-2023-01-21";
+  version = "unstable-2023-11-19";
 
   src = fetchFromGitHub {
     owner = "edubart";
     repo = "nelua-lang";
-    rev = "d10cc61bc54050b07874a8597f8df20534885105";
-    hash = "sha256-HyNYqhPCQVBJqEcAUUXfvycXE8tWIMIUJJMTIV48ne8=";
+    rev = "e82695abf0a68a30a593cefb0bf1143cf9e14b6b";
+    hash = "sha256-Srgoq07JQirxmZcDvw4UdfoYZ5HFT0PbYPoHY99BW/c=";
   };
 
+  postPatch = ''
+    substituteInPlace lualib/nelua/version.lua \
+      --replace "NELUA_GIT_HASH = nil" "NELUA_GIT_HASH = '${src.rev}'" \
+      --replace "NELUA_GIT_DATE = nil" "NELUA_GIT_DATE = '${lib.removePrefix "unstable-" version}'"
+  '';
+
   makeFlags = [ "PREFIX=$(out)" ];
 
   nativeCheckInputs = [ luaPackages.luacheck ];
 
   doCheck = true;
 
+  passthru.updateScript = unstableGitUpdater { };
+
   meta = with lib; {
     description = "Minimal, efficient, statically-typed and meta-programmable systems programming language heavily inspired by Lua, which compiles to C and native code";
     homepage = "https://nelua.io/";
diff --git a/pkgs/development/interpreters/nextflow/default.nix b/pkgs/development/interpreters/nextflow/default.nix
index 1d3d1070fc719..e4885f985abaa 100644
--- a/pkgs/development/interpreters/nextflow/default.nix
+++ b/pkgs/development/interpreters/nextflow/default.nix
@@ -8,7 +8,7 @@
 , gnused
 , gawk
 , coreutils
-, buildFHSUserEnv
+, buildFHSEnv
 }:
 
 let
@@ -68,7 +68,7 @@ stdenv.mkDerivation rec {
 };
 in
 if stdenv.isLinux then
-  buildFHSUserEnv
+  buildFHSEnv
   {
     name = "nextflow";
     targetPkgs = pkgs: [ nextflow ];
diff --git a/pkgs/development/interpreters/nickel/default.nix b/pkgs/development/interpreters/nickel/default.nix
deleted file mode 100644
index 91200030f6315..0000000000000
--- a/pkgs/development/interpreters/nickel/default.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{ lib
-, rustPlatform
-, fetchFromGitHub
-}:
-
-rustPlatform.buildRustPackage rec {
-  pname = "nickel";
-  version = "0.3.1";
-
-  src  = fetchFromGitHub {
-    owner = "tweag";
-    repo = pname;
-    rev = "refs/tags/${version}"; # because pure ${version} doesn't work
-    hash = "sha256-bUUQP7ze0j8d+VEckexDOferAgAHdKZbdKR3q0TNOeE=";
-  };
-
-  cargoSha256 = "sha256-E8eIUASjCIVsZhptbU41VfK8bFmA4FTT3LVagLrgUso=";
-
-  meta = with lib; {
-    homepage = "https://nickel-lang.org/";
-    description = "Better configuration for less";
-    longDescription = ''
-      Nickel is the cheap configuration language.
-
-      Its purpose is to automate the generation of static configuration files -
-      think JSON, YAML, XML, or your favorite data representation language -
-      that are then fed to another system. It is designed to have a simple,
-      well-understood core: it is in essence JSON with functions.
-    '';
-    changelog = "https://github.com/tweag/nickel/blob/${version}/RELEASES.md";
-    license = licenses.mit;
-    maintainers = with maintainers; [ AndersonTorres ];
-  };
-}
diff --git a/pkgs/development/interpreters/oak/default.nix b/pkgs/development/interpreters/oak/default.nix
index eda0450be4280..734576d862b0b 100644
--- a/pkgs/development/interpreters/oak/default.nix
+++ b/pkgs/development/interpreters/oak/default.nix
@@ -14,7 +14,7 @@ buildGoModule rec {
     sha256 = "sha256-DK5n8xK57CQiukyBt9+CFK1j8+nphP//T2jTXq64VH8=";
   };
 
-  vendorSha256 = "sha256-iQtb3zNa57nB6x4InVPw7FCmW7XPw5yuz0OcfASXPD8=";
+  vendorHash = "sha256-iQtb3zNa57nB6x4InVPw7FCmW7XPw5yuz0OcfASXPD8=";
 
   meta = with lib; {
     description = "Expressive, simple, dynamic programming language";
diff --git a/pkgs/development/interpreters/octave/default.nix b/pkgs/development/interpreters/octave/default.nix
index 45d35d027b88a..ab9128772d3cf 100644
--- a/pkgs/development/interpreters/octave/default.nix
+++ b/pkgs/development/interpreters/octave/default.nix
@@ -1,9 +1,6 @@
 { stdenv
 , pkgs
 , lib
-# Note: either stdenv.mkDerivation or, for octaveFull, the qt-5 mkDerivation
-# with wrapQtAppsHook (comes from libsForQt5.callPackage)
-, mkDerivation
 , fetchurl
 , gfortran
 , ncurses
@@ -27,26 +24,25 @@
 , curl
 , rapidjson
 , blas, lapack
-# These two should use the same lapack and blas as the above
-, qrupdate, arpack, suitesparse ? null
+# These 3 should use the same lapack and blas as the above, see code prepending
+, qrupdate, arpack, suitesparse
 # If set to true, the above 5 deps are overridden to use the blas and lapack
 # with 64 bit indexes support. If all are not compatible, the build will fail.
 , use64BitIdx ? false
 , libwebp
 , gl2ps
-, ghostscript ? null
-, hdf5 ? null
-, glpk ? null
-, gnuplot ? null
+, ghostscript
+, hdf5
+, glpk
+, gnuplot
 # - Include support for GNU readline:
 , enableReadline ? true
-, readline ? null
+, readline
 # - Build Java interface:
 , enableJava ? true
-, jdk ? null
-, python ? null
-, overridePlatforms ? null
-, sundials ? null
+, jdk
+, python3
+, sundials
 # - Packages required for building extra packages.
 , newScope
 , callPackage
@@ -54,17 +50,12 @@
 , makeWrapper
 # - Build Octave Qt GUI:
 , enableQt ? false
-, qtbase ? null
-, qtsvg ? null
-, qtscript ? null
-, qscintilla ? null
-, qttools ? null
+, libsForQt5
 , libiconv
 , darwin
 }:
 
 let
-
   # Not always evaluated
   blas' = if use64BitIdx then
     blas.override {
@@ -90,7 +81,7 @@ let
     blas = blas';
     lapack = lapack';
   };
-  # Not always suitesparse is required at all
+  # We keep the option to not enable suitesparse support by putting it null
   suitesparse' = if suitesparse != null then
     suitesparse.override {
       blas = blas';
@@ -99,25 +90,15 @@ let
   else
     null
   ;
-
-  octavePackages = import ../../../top-level/octave-packages.nix {
-    inherit pkgs;
-    inherit lib stdenv fetchurl newScope;
-    octave = self;
-  };
-
-  wrapOctave = callPackage ./wrap-octave.nix {
-    octave = self;
-    inherit (pkgs) makeSetupHook makeWrapper;
-  };
-
-  self = mkDerivation rec {
-    version = "8.1.0";
+  # To avoid confusion later in passthru
+  allPkgs = pkgs;
+in stdenv.mkDerivation (finalAttrs: {
+    version = "8.4.0";
     pname = "octave";
 
     src = fetchurl {
-      url = "mirror://gnu/octave/${pname}-${version}.tar.gz";
-      sha256 = "sha256-gFIHTRew72Q9A33oqziWcsdSuyAe6c6k36aYWPtqIT8=";
+      url = "mirror://gnu/octave/octave-${finalAttrs.version}.tar.gz";
+      sha256 = "sha256-azjdl1FnhCSus6nWZkMrHzeOs5caISkKkM09NRGdVq0=";
     };
 
     buildInputs = [
@@ -142,41 +123,35 @@ let
       arpack'
       libwebp
       gl2ps
-    ]
-    ++ lib.optionals enableQt [
-      qtbase
-      qtsvg
-      qscintilla
-    ]
-    ++ lib.optionals (ghostscript != null) [ ghostscript ]
-    ++ lib.optionals (hdf5 != null) [ hdf5 ]
-    ++ lib.optionals (glpk != null) [ glpk ]
-    ++ lib.optionals (suitesparse != null) [ suitesparse' ]
-    ++ lib.optionals (enableJava) [ jdk ]
-    ++ lib.optionals (sundials != null) [ sundials ]
-    ++ lib.optionals (gnuplot != null) [ gnuplot ]
-    ++ lib.optionals (python != null) [ python ]
-    ++ lib.optionals (!stdenv.isDarwin) [ libGL libGLU libX11 ]
-    ++ lib.optionals stdenv.isDarwin [
+      ghostscript
+      hdf5
+      glpk
+      suitesparse'
+      sundials
+      gnuplot
+      python3
+    ] ++ lib.optionals enableQt [
+      libsForQt5.qtbase
+      libsForQt5.qtsvg
+      libsForQt5.qscintilla
+    ] ++ lib.optionals (enableJava) [
+      jdk
+    ] ++ lib.optionals (!stdenv.isDarwin) [
+      libGL libGLU libX11
+    ] ++ lib.optionals stdenv.isDarwin [
       libiconv
       darwin.apple_sdk.frameworks.Accelerate
       darwin.apple_sdk.frameworks.Cocoa
-    ]
-    ;
+    ];
     nativeBuildInputs = [
       pkg-config
       gfortran
-      # Listed here as well because it's outputs are split
-      fftw
-      fftwSinglePrec
       texinfo
-    ]
-    ++ lib.optionals (sundials != null) [ sundials ]
-    ++ lib.optionals enableQt [
-      qtscript
-      qttools
-    ]
-    ;
+    ] ++ lib.optionals enableQt [
+      libsForQt5.wrapQtAppsHook
+      libsForQt5.qtscript
+      libsForQt5.qttools
+    ];
 
     doCheck = !stdenv.isDarwin;
 
@@ -202,30 +177,39 @@ let
     # Keep a copy of the octave tests detailed results in the output
     # derivation, because someone may care
     postInstall = ''
-      cp test/fntests.log $out/share/octave/${pname}-${version}-fntests.log || true
+      cp test/fntests.log $out/share/octave/octave-${finalAttrs.version}-fntests.log || true
     '';
 
     passthru = rec {
-      sitePath = "share/octave/${version}/site";
+      sitePath = "share/octave/${finalAttrs.version}/site";
       octPkgsPath = "share/octave/octave_packages";
       blas = blas';
       lapack = lapack';
       qrupdate = qrupdate';
       arpack = arpack';
       suitesparse = suitesparse';
+      octavePackages = import ../../../top-level/octave-packages.nix {
+        pkgs = allPkgs;
+        inherit lib stdenv fetchurl newScope;
+        octave = finalAttrs.finalPackage;
+      };
+      wrapOctave = callPackage ./wrap-octave.nix {
+        octave = finalAttrs.finalPackage;
+        inherit (allPkgs) makeSetupHook makeWrapper;
+      };
       inherit fftw fftwSinglePrec;
       inherit portaudio;
       inherit jdk;
-      inherit python;
+      python = python3;
       inherit enableQt enableReadline enableJava;
       buildEnv = callPackage ./build-env.nix {
-        octave = self;
+        octave = finalAttrs.finalPackage;
         inherit octavePackages wrapOctave;
         inherit (octavePackages) computeRequiredOctavePackages;
       };
       withPackages = import ./with-packages.nix { inherit buildEnv octavePackages; };
       pkgs = octavePackages;
-      interpreter = "${self}/bin/octave";
+      interpreter = "${finalAttrs.finalPackage}/bin/octave";
     };
 
     meta = {
@@ -233,10 +217,5 @@ let
       license = lib.licenses.gpl3Plus;
       maintainers = with lib.maintainers; [ raskin doronbehar ];
       description = "Scientific Programming Language";
-      platforms = if overridePlatforms == null then
-        (lib.platforms.linux ++ lib.platforms.darwin)
-      else overridePlatforms;
     };
-  };
-
-in self
+  })
diff --git a/pkgs/development/interpreters/octave/patches/bug62436.patch b/pkgs/development/interpreters/octave/patches/bug62436.patch
deleted file mode 100644
index d9d7cfc30408f..0000000000000
--- a/pkgs/development/interpreters/octave/patches/bug62436.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-# HG changeset patch
-# User John Donoghue <john.donoghue@ieee.org>
-# Date 1652358904 14400
-#      Thu May 12 08:35:04 2022 -0400
-# Branch stable
-# Node ID 8c940cfcce257369677c09154da2aab2c56eaa79
-# Parent  63710f3bd9811c2d206ac9e7b4f47cf06c47e153
-* scripts/pkg/private/build.m: check configure and Makefile exist before trying to unlink them (Bug #62436)
-
-diff -r 63710f3bd981 -r 8c940cfcce25 scripts/pkg/private/build.m
---- a/scripts/pkg/private/build.m	Wed May 11 09:44:55 2022 -0700
-+++ b/scripts/pkg/private/build.m	Thu May 12 08:35:04 2022 -0400
-@@ -77,8 +77,12 @@
-     else
-       arch_abi = getarch ();
-       configure_make (desc, build_root, verbose);
--      unlink (fullfile (build_root, "src", "configure"));
--      unlink (fullfile (build_root, "src", "Makefile"));
-+      if exist (fullfile (build_root, "src", "configure"), "file")
-+        unlink (fullfile (build_root, "src", "configure"));
-+      endif
-+      if exist (fullfile (build_root, "src", "Makefile"), "file")
-+        unlink (fullfile (build_root, "src", "Makefile"));
-+      endif
-     endif
-     tar_name = [desc.name "-" desc.version "-" arch_abi ".tar"];
-     tar_path = fullfile (builddir, tar_name);
diff --git a/pkgs/development/interpreters/octave/wrap-octave.nix b/pkgs/development/interpreters/octave/wrap-octave.nix
index 2317a479f0e20..1959ba6c49251 100644
--- a/pkgs/development/interpreters/octave/wrap-octave.nix
+++ b/pkgs/development/interpreters/octave/wrap-octave.nix
@@ -4,7 +4,7 @@
 , makeWrapper
 }:
 
-# Defined in trivial-builders.nix
+# Defined in trivial-builders
 # Imported as wrapOctave in octave/default.nix and passed to octave's buildEnv
 # as nativeBuildInput
 # Each of the substitutions is available in the wrap.sh script as @thingSubstituted@
diff --git a/pkgs/development/interpreters/perl/MakeMaker-cross.patch b/pkgs/development/interpreters/perl/MakeMaker-cross.patch
deleted file mode 100644
index 40626c51f9bd1..0000000000000
--- a/pkgs/development/interpreters/perl/MakeMaker-cross.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff -Naur a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
---- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm	2017-06-30 17:03:20.000000000 -0400
-+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm	2018-02-28 10:06:37.031237946 -0500
-@@ -1267,7 +1267,12 @@
-     my $value = shift;
-     return $value if $UNDER_CORE;
-     my $tvalue = '';
--    require B;
-+    eval {
-+        require B;
-+    };
-+    if ($@) {
-+        return $tvalue;
-+    }
-     my $sv = B::svref_2object(\$value);
-     my $magic = ref($sv) eq 'B::PVMG' ? $sv->MAGIC : undef;
-     while ( $magic ) {
diff --git a/pkgs/development/interpreters/perl/cross.patch b/pkgs/development/interpreters/perl/cross.patch
new file mode 100644
index 0000000000000..e0f05ede90d02
--- /dev/null
+++ b/pkgs/development/interpreters/perl/cross.patch
@@ -0,0 +1,250 @@
+From: =?UTF-8?q?Christian=20K=C3=B6gler?= <ck3d@gmx.de>
+Date: Mon, 10 Apr 2023 22:12:24 +0200
+Subject: [PATCH] miniperl compatible modules
+
+CPAN::Meta
+ExtUtils::MakeMaker
+JSON::PP
+Data::Dumper
+
+Updated for perl v5.38.0 by stig@stig.io
+
+---
+
+diff --git a/cpan/CPAN-Meta-Requirements/lib/CPAN/Meta/Requirements.pm b/cpan/CPAN-Meta-Requirements/lib/CPAN/Meta/Requirements.pm
+index b0e83b0d2d..dab4907704 100644
+--- a/cpan/CPAN-Meta-Requirements/lib/CPAN/Meta/Requirements.pm
++++ b/cpan/CPAN-Meta-Requirements/lib/CPAN/Meta/Requirements.pm
+@@ -86,21 +86,7 @@ sub new {
+ # from version::vpp
+ sub _find_magic_vstring {
+   my $value = shift;
+-  my $tvalue = '';
+-  require B;
+-  my $sv = B::svref_2object(\$value);
+-  my $magic = ref($sv) eq 'B::PVMG' ? $sv->MAGIC : undef;
+-  while ( $magic ) {
+-    if ( $magic->TYPE eq 'V' ) {
+-      $tvalue = $magic->PTR;
+-      $tvalue =~ s/^v?(.+)$/v$1/;
+-      last;
+-    }
+-    else {
+-      $magic = $magic->MOREMAGIC;
+-    }
+-  }
+-  return $tvalue;
++  return version::->parse($value)->stringify;
+ }
+ 
+ # safe if given an unblessed reference
+diff --git a/cpan/CPAN-Meta-YAML/lib/CPAN/Meta/YAML.pm b/cpan/CPAN-Meta-YAML/lib/CPAN/Meta/YAML.pm
+index 746abd63bc..c55d7cd2d0 100644
+--- a/cpan/CPAN-Meta-YAML/lib/CPAN/Meta/YAML.pm
++++ b/cpan/CPAN-Meta-YAML/lib/CPAN/Meta/YAML.pm
+@@ -1,6 +1,7 @@
+ use 5.008001; # sane UTF-8 support
+ use strict;
+ use warnings;
++no warnings 'experimental::builtin';
+ package CPAN::Meta::YAML; # git description: v1.68-2-gcc5324e
+ # XXX-INGY is 5.8.1 too old/broken for utf8?
+ # XXX-XDG Lancaster consensus was that it was sufficient until
+@@ -650,27 +651,29 @@ sub _dump_string {
+     join '', map { "$_\n" } @lines;
+ }
+ 
+-sub _has_internal_string_value {
++# taken from cpan/JSON-PP/lib/JSON/PP.pm
++sub _looks_like_number {
+     my $value = shift;
+-    my $b_obj = B::svref_2object(\$value);  # for round trip problem
+-    return $b_obj->FLAGS & B::SVf_POK();
++    no warnings 'numeric';
++    # if the utf8 flag is on, it almost certainly started as a string
++    return if utf8::is_utf8($value);
++    # detect numbers
++    # string & "" -> ""
++    # number & "" -> 0 (with warning)
++    # nan and inf can detect as numbers, so check with * 0
++    return unless length((my $dummy = "") & $value);
++    return unless 0 + $value eq $value;
++    return 1 if $value * 0 == 0;
++    return -1; # inf/nan
+ }
+ 
+ sub _dump_scalar {
+     my $string = $_[1];
+     my $is_key = $_[2];
+-    # Check this before checking length or it winds up looking like a string!
+-    my $has_string_flag = _has_internal_string_value($string);
+     return '~'  unless defined $string;
+     return "''" unless length  $string;
+-    if (Scalar::Util::looks_like_number($string)) {
+-        # keys and values that have been used as strings get quoted
+-        if ( $is_key || $has_string_flag ) {
+-            return qq['$string'];
+-        }
+-        else {
+-            return $string;
+-        }
++    if (_looks_like_number($string)) {
++        return qq['$string'];
+     }
+     if ( $string =~ /[\x00-\x09\x0b-\x0d\x0e-\x1f\x7f-\x9f\'\n]/ ) {
+         $string =~ s/\\/\\\\/g;
+@@ -800,9 +803,6 @@ sub errstr {
+ # Helper functions. Possibly not needed.
+ 
+ 
+-# Use to detect nv or iv
+-use B;
+-
+ # XXX-INGY Is flock CPAN::Meta::YAML's responsibility?
+ # Some platforms can't flock :-(
+ # XXX-XDG I think it is.  When reading and writing files, we ought
+@@ -822,35 +822,8 @@ sub _can_flock {
+     }
+ }
+ 
+-
+-# XXX-INGY Is this core in 5.8.1? Can we remove this?
+-# XXX-XDG Scalar::Util 1.18 didn't land until 5.8.8, so we need this
+-#####################################################################
+-# Use Scalar::Util if possible, otherwise emulate it
+-
+-use Scalar::Util ();
+ BEGIN {
+-    local $@;
+-    if ( eval { Scalar::Util->VERSION(1.18); } ) {
+-        *refaddr = *Scalar::Util::refaddr;
+-    }
+-    else {
+-        eval <<'END_PERL';
+-# Scalar::Util failed to load or too old
+-sub refaddr {
+-    my $pkg = ref($_[0]) or return undef;
+-    if ( !! UNIVERSAL::can($_[0], 'can') ) {
+-        bless $_[0], 'Scalar::Util::Fake';
+-    } else {
+-        $pkg = undef;
+-    }
+-    "$_[0]" =~ /0x(\w+)/;
+-    my $i = do { no warnings 'portable'; hex $1 };
+-    bless $_[0], $pkg if defined $pkg;
+-    $i;
+-}
+-END_PERL
+-    }
++    *refaddr = *builtin::refaddr;
+ }
+ 
+ delete $CPAN::Meta::YAML::{refaddr};
+diff --git a/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm b/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm
+index 3604eae402..991f69d275 100644
+--- a/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm
++++ b/cpan/CPAN-Meta/lib/CPAN/Meta/Merge.pm
+@@ -1,12 +1,13 @@
+ use strict;
+ use warnings;
++no warnings 'experimental::builtin';
+ 
+ package CPAN::Meta::Merge;
+ 
+ our $VERSION = '2.150010';
+ 
+ use Carp qw/croak/;
+-use Scalar::Util qw/blessed/;
++use builtin qw/blessed/;
+ use CPAN::Meta::Converter 2.141170;
+ 
+ sub _is_identical {
+diff --git a/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm b/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm
+index d4e93fd8a5..809da68d02 100644
+--- a/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm
++++ b/cpan/CPAN-Meta/lib/CPAN/Meta/Prereqs.pm
+@@ -1,6 +1,7 @@
+ use 5.006;
+ use strict;
+ use warnings;
++no warnings 'experimental::builtin';
+ package CPAN::Meta::Prereqs;
+ 
+ our $VERSION = '2.150010';
+@@ -14,7 +15,6 @@ our $VERSION = '2.150010';
+ #pod =cut
+ 
+ use Carp qw(confess);
+-use Scalar::Util qw(blessed);
+ use CPAN::Meta::Requirements 2.121;
+ 
+ #pod =method new
+@@ -168,7 +168,12 @@ sub types_in {
+ sub with_merged_prereqs {
+   my ($self, $other) = @_;
+ 
+-  my @other = blessed($other) ? $other : @$other;
++  eval 'require Scalar::Util';
++  my @other = unless($@){
++    Scalar::Util::blessed($other) ? $other : @$other;
++  }else{
++    builtin::blessed($other) ? $other : @$other;
++  }
+ 
+   my @prereq_objs = ($self, @other);
+ 
+diff --git a/cpan/JSON-PP/lib/JSON/PP.pm b/cpan/JSON-PP/lib/JSON/PP.pm
+index fc8fcbc8f0..cda7b90c65 100644
+--- a/cpan/JSON-PP/lib/JSON/PP.pm
++++ b/cpan/JSON-PP/lib/JSON/PP.pm
+@@ -4,6 +4,7 @@ package JSON::PP;
+ 
+ use 5.008;
+ use strict;
++no warnings 'experimental::builtin';
+ 
+ use Exporter ();
+ BEGIN { our @ISA = ('Exporter') }
+diff --git a/dist/Data-Dumper/Dumper.pm b/dist/Data-Dumper/Dumper.pm
+index bb6d3caedb..0c2fde4743 100644
+--- a/dist/Data-Dumper/Dumper.pm
++++ b/dist/Data-Dumper/Dumper.pm
+@@ -11,6 +11,7 @@ package Data::Dumper;
+ 
+ use strict;
+ use warnings;
++no warnings 'experimental::builtin';
+ 
+ #$| = 1;
+ 
+@@ -125,8 +126,7 @@ sub new {
+ # Packed numeric addresses take less memory. Plus pack is faster than sprintf
+ 
+ sub format_refaddr {
+-    require Scalar::Util;
+-    pack "J", Scalar::Util::refaddr(shift);
++    pack "J", builtin::refaddr(shift);
+ };
+ 
+ #
+@@ -282,9 +282,8 @@ sub _dump {
+       warn "WARNING(Freezer method call failed): $@" if $@;
+     }
+ 
+-    require Scalar::Util;
+-    my $realpack = Scalar::Util::blessed($val);
+-    my $realtype = $realpack ? Scalar::Util::reftype($val) : ref $val;
++    my $realpack = builtin::blessed($val);
++    my $realtype = $realpack ? builtin::reftype($val) : ref $val;
+     $id = format_refaddr($val);
+ 
+     # Note: By this point $name is always defined and of non-zero length.
+@@ -576,7 +575,7 @@ sub _dump {
+     # here generates a different result. So there are actually "three" different
+     # implementations of Data::Dumper (kind of sort of) but we only test two.
+     elsif (!defined &_vstring
+-       and ref $ref eq 'VSTRING' || eval{Scalar::Util::isvstring($val)}) {
++       and ref $ref eq 'VSTRING') {
+       $out .= sprintf "v%vd", $val;
+     }
+     # \d here would treat "1\x{660}" as a safe decimal number
diff --git a/pkgs/development/interpreters/perl/default.nix b/pkgs/development/interpreters/perl/default.nix
index e8db13a6474b0..50189a6213ba7 100644
--- a/pkgs/development/interpreters/perl/default.nix
+++ b/pkgs/development/interpreters/perl/default.nix
@@ -1,264 +1,72 @@
-{ config, lib, stdenv, fetchurl, fetchFromGitHub, pkgs, buildPackages
-, callPackage
-, enableThreading ? true, coreutils, makeWrapper
-, enableCrypt ? true, libxcrypt ? null
-, zlib
-}:
-
-assert (enableCrypt -> (libxcrypt != null));
-
-# Note: this package is used for bootstrapping fetchurl, and thus
-# cannot use fetchpatch! All mutable patches (generated by GitHub or
-# cgit) that are needed here should be included directly in Nixpkgs as
-# files.
+{ callPackage }:
 
 let
-
-  libc = if stdenv.cc.libc or null != null then stdenv.cc.libc else "/usr";
-  libcInc = lib.getDev libc;
-  libcLib = lib.getLib libc;
-  crossCompiling = stdenv.buildPlatform != stdenv.hostPlatform;
-
-  common = { perl, buildPerl, version, sha256 }: stdenv.mkDerivation (rec {
-    inherit version;
-    pname = "perl";
-
-    src = fetchurl {
-      url = "mirror://cpan/src/5.0/perl-${version}.tar.gz";
-      inherit sha256;
-    };
-
-    strictDeps = true;
-    # TODO: Add a "dev" output containing the header files.
-    outputs = [ "out" "man" "devdoc" ] ++
-      lib.optional crossCompiling "mini";
-    setOutputFlags = false;
-
-    # On FreeBSD, if Perl is built with threads support, having
-    # libxcrypt available will result in a build failure, because
-    # perl.h will get conflicting definitions of struct crypt_data
-    # from libc's unistd.h and libxcrypt's crypt.h.
-    #
-    # FreeBSD Ports has the same issue building the perl port if
-    # the libxcrypt port has been installed.
-    #
-    # Without libxcrypt, Perl will still find FreeBSD's crypt functions.
-    propagatedBuildInputs = lib.optional (enableCrypt && !stdenv.isFreeBSD) libxcrypt;
-
-    disallowedReferences = [ stdenv.cc ];
-
-    patches =
-      [
-        # Do not look in /usr etc. for dependencies.
-        ./no-sys-dirs-5.31.patch
-
-        # Enable TLS/SSL verification in HTTP::Tiny by default
-        ./http-tiny-verify-ssl-by-default.patch
-      ]
-      ++ lib.optional stdenv.isSunOS ./ld-shared.patch
-      ++ lib.optionals stdenv.isDarwin [ ./cpp-precomp.patch ./sw_vers.patch ]
-      ++ lib.optional crossCompiling ./MakeMaker-cross.patch;
-
-    # This is not done for native builds because pwd may need to come from
-    # bootstrap tools when building bootstrap perl.
-    postPatch = (if crossCompiling then ''
-      substituteInPlace dist/PathTools/Cwd.pm \
-        --replace "/bin/pwd" '${coreutils}/bin/pwd'
-      substituteInPlace cnf/configure_tool.sh --replace "cc -E -P" "cc -E"
-    '' else ''
-      substituteInPlace dist/PathTools/Cwd.pm \
-        --replace "/bin/pwd" "$(type -P pwd)"
-    '') +
-    # Perl's build system uses the src variable, and its value may end up in
-    # the output in some cases (when cross-compiling)
-    ''
-      unset src
-    '';
-
-    # Build a thread-safe Perl with a dynamic libperl.so.  We need the
-    # "installstyle" option to ensure that modules are put under
-    # $out/lib/perl5 - this is the general default, but because $out
-    # contains the string "perl", Configure would select $out/lib.
-    # Miniperl needs -lm. perl needs -lrt.
-    configureFlags =
-      (if crossCompiling
-       then [ "-Dlibpth=\"\"" "-Dglibpth=\"\"" "-Ddefault_inc_excludes_dot" ]
-       else [ "-de" "-Dcc=cc" ])
-      ++ [
-        "-Uinstallusrbinperl"
-        "-Dinstallstyle=lib/perl5"
-      ] ++ lib.optional (!crossCompiling) "-Duseshrplib" ++ [
-        "-Dlocincpth=${libcInc}/include"
-        "-Dloclibpth=${libcLib}/lib"
-      ]
-      ++ lib.optionals ((builtins.match ''5\.[0-9]*[13579]\..+'' version) != null) [ "-Dusedevel" "-Uversiononly" ]
-      ++ lib.optional stdenv.isSunOS "-Dcc=gcc"
-      ++ lib.optional enableThreading "-Dusethreads"
-      ++ lib.optional (!enableCrypt) "-A clear:d_crypt_r"
-      ++ lib.optional stdenv.hostPlatform.isStatic "--all-static"
-      ++ lib.optionals (!crossCompiling) [
-        "-Dprefix=${placeholder "out"}"
-        "-Dman1dir=${placeholder "out"}/share/man/man1"
-        "-Dman3dir=${placeholder "out"}/share/man/man3"
-      ];
-
-    configureScript = lib.optionalString (!crossCompiling) "${stdenv.shell} ./Configure";
-
-    dontAddStaticConfigureFlags = true;
-
-    dontAddPrefix = !crossCompiling;
-
-    enableParallelBuilding = !crossCompiling;
-
-    # perl includes the build date, the uname of the build system and the
-    # username of the build user in some files.
-    # We override these to make it build deterministically.
-    # other distro solutions
-    # https://github.com/bmwiedemann/openSUSE/blob/master/packages/p/perl/perl-reproducible.patch
-    # https://github.com/archlinux/svntogit-packages/blob/packages/perl/trunk/config.over
-    # https://salsa.debian.org/perl-team/interpreter/perl/blob/debian-5.26/debian/config.over
-    # A ticket has been opened upstream to possibly clean some of this up: https://rt.perl.org/Public/Bug/Display.html?id=133452
-    preConfigure = ''
-        cat > config.over <<EOF
-        ${lib.optionalString (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isGnu) ''osvers="gnulinux"''}
-        myuname="nixpkgs"
-        myhostname="nixpkgs"
-        cf_by="nixpkgs"
-        cf_time="$(date -d "@$SOURCE_DATE_EPOCH")"
-        EOF
-
-        # Compress::Raw::Zlib should use our zlib package instead of the one
-        # included with the distribution
-        cat > ./cpan/Compress-Raw-Zlib/config.in <<EOF
-        BUILD_ZLIB   = False
-        INCLUDE      = ${zlib.dev}/include
-        LIB          = ${zlib.out}/lib
-        OLD_ZLIB     = False
-        GZIP_OS_CODE = AUTO_DETECT
-        EOF
-      '' + lib.optionalString stdenv.isDarwin ''
-        substituteInPlace hints/darwin.sh --replace "env MACOSX_DEPLOYMENT_TARGET=10.3" ""
-      '' + lib.optionalString (!enableThreading) ''
-        # We need to do this because the bootstrap doesn't have a static libpthread
-        sed -i 's,\(libswanted.*\)pthread,\1,g' Configure
-      '';
-
-    # Default perl does not support --host= & co.
-    configurePlatforms = [];
-
-    setupHook = ./setup-hook.sh;
-
-    passthru = rec {
-      interpreter = "${perl}/bin/perl";
-      libPrefix = "lib/perl5/site_perl";
-      pkgs = callPackage ../../../top-level/perl-packages.nix {
-        inherit perl buildPerl;
-        overrides = config.perlPackageOverrides or (p: {}); # TODO: (self: super: {}) like in python
-      };
-      buildEnv = callPackage ./wrapper.nix {
-        inherit perl;
-        inherit (pkgs) requiredPerlModules;
-      };
-      withPackages = f: buildEnv.override { extraLibs = f pkgs; };
-    };
-
-    doCheck = false; # some tests fail, expensive
-
-    # TODO: it seems like absolute paths to some coreutils is required.
-    postInstall =
-      ''
-        # Remove dependency between "out" and "man" outputs.
-        rm "$out"/lib/perl5/*/*/.packlist
-
-        # Remove dependencies on glibc and gcc
-        sed "/ *libpth =>/c    libpth => ' '," \
-          -i "$out"/lib/perl5/*/*/Config.pm
-        # TODO: removing those paths would be cleaner than overwriting with nonsense.
-        substituteInPlace "$out"/lib/perl5/*/*/Config_heavy.pl \
-          --replace "${libcInc}" /no-such-path \
-          --replace "${
-              if stdenv.hasCC then stdenv.cc.cc else "/no-such-path"
-            }" /no-such-path \
-          --replace "${stdenv.cc}" /no-such-path \
-          --replace "$man" /no-such-path
-      '' + lib.optionalString crossCompiling
-      ''
-        mkdir -p $mini/lib/perl5/cross_perl/${version}
-        for dir in cnf/{stub,cpan}; do
-          cp -r $dir/* $mini/lib/perl5/cross_perl/${version}
-        done
-
-        mkdir -p $mini/bin
-        install -m755 miniperl $mini/bin/perl
-
-        export runtimeArch="$(ls $out/lib/perl5/site_perl/${version})"
-        # wrapProgram should use a runtime-native SHELL by default, but
-        # it actually uses a buildtime-native one. If we ever fix that,
-        # we'll need to fix this to use a buildtime-native one.
-        #
-        # Adding the arch-specific directory is morally incorrect, as
-        # miniperl can't load the native modules there. However, it can
-        # (and sometimes needs to) load and run some of the pure perl
-        # code there, so we add it anyway. When needed, stubs can be put
-        # into $mini/lib/perl5/cross_perl/${version}.
-        wrapProgram $mini/bin/perl --prefix PERL5LIB : \
-          "$mini/lib/perl5/cross_perl/${version}:$out/lib/perl5/${version}:$out/lib/perl5/${version}/$runtimeArch"
-      ''; # */
-
-    meta = with lib; {
-      homepage = "https://www.perl.org/";
-      description = "The standard implementation of the Perl 5 programmming language";
-      license = licenses.artistic1;
-      maintainers = [ maintainers.eelco ];
-      platforms = platforms.all;
-      priority = 6; # in `buildEnv' (including the one inside `perl.withPackages') the library files will have priority over files in `perl`
-    };
-  } // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) rec {
-    crossVersion = "c876045741f5159318085d2737b0090f35a842ca"; # June 5, 2022
-
-    perl-cross-src = fetchFromGitHub {
-      name = "perl-cross-unstable-${crossVersion}";
-      owner = "arsv";
-      repo = "perl-cross";
-      rev = crossVersion;
-      sha256 = "sha256-m9UCoTQgXBxSgk9Q1Zv6wl3Qnd0aZm/jEPXkcMKti8U=";
-    };
-
-    depsBuildBuild = [ buildPackages.stdenv.cc makeWrapper ];
-
-    postUnpack = ''
-      unpackFile ${perl-cross-src}
-      chmod -R u+w ${perl-cross-src.name}
-      cp -R ${perl-cross-src.name}/* perl-${version}/
-    '';
-
-    configurePlatforms = [ "build" "host" "target" ];
-
-    # TODO merge setup hooks
-    setupHook = ./setup-hook-cross.sh;
-  });
-in {
-  # Maint version
-  perl534 = common {
-    perl = pkgs.perl534;
-    buildPerl = buildPackages.perl534;
-    version = "5.34.1";
-    sha256 = "sha256-NXlRpJGwuhzjYRJjki/ux4zNWB3dwkpEawM+JazyQqE=";
+  # Common passthru for all perl interpreters.
+  # copied from lua
+  passthruFun =
+    { overrides
+    , perlOnBuildForBuild
+    , perlOnBuildForHost
+    , perlOnBuildForTarget
+    , perlOnHostForHost
+    , perlOnTargetForTarget
+    , perlAttr ? null
+    , self # is perlOnHostForTarget
+    }: let
+      perlPackages = callPackage
+        # Function that when called
+        # - imports perl-packages.nix
+        # - adds spliced package sets to the package set
+        ({ stdenv, pkgs, perl, callPackage, makeScopeWithSplicing' }: let
+          perlPackagesFun = callPackage ../../../top-level/perl-packages.nix {
+            # allow 'perlPackages.override { pkgs = pkgs // { imagemagick = imagemagickBig; }; }' like in python3Packages
+            # most perl packages aren't called with callPackage so it's not possible to override their arguments individually
+            # the conditional is because the // above won't be applied to __splicedPackages and hopefully no one is doing that when cross-compiling
+            pkgs = if stdenv.buildPlatform != stdenv.hostPlatform then pkgs.__splicedPackages else pkgs;
+            inherit stdenv;
+            perl = self;
+          };
+
+          otherSplices = {
+            selfBuildBuild = perlOnBuildForBuild.pkgs;
+            selfBuildHost = perlOnBuildForHost.pkgs;
+            selfBuildTarget = perlOnBuildForTarget.pkgs;
+            selfHostHost = perlOnHostForHost.pkgs;
+            selfTargetTarget = perlOnTargetForTarget.pkgs or {};
+          };
+        in makeScopeWithSplicing' {
+          inherit otherSplices;
+          f = perlPackagesFun;
+        })
+        {
+          perl = self;
+        };
+    in rec {
+        buildEnv = callPackage ./wrapper.nix {
+          perl = self;
+          inherit (pkgs) requiredPerlModules;
+        };
+        withPackages = f: buildEnv.override { extraLibs = f pkgs; };
+        pkgs = perlPackages // (overrides pkgs);
+        interpreter = "${self}/bin/perl";
+        libPrefix = "lib/perl5/site_perl";
+        perlOnBuild = perlOnBuildForHost.override { inherit overrides; self = perlOnBuild; };
   };
 
+in rec {
   # Maint version
-  perl536 = common {
-    perl = pkgs.perl536;
-    buildPerl = buildPackages.perl536;
-    version = "5.36.0";
-    sha256 = "sha256-4mCFr4rDlvYq3YpTPDoOqMhJfYNvBok0esWr17ek4Ao=";
+  perl536 = callPackage ./intepreter.nix {
+    self = perl536;
+    version = "5.36.3";
+    sha256 = "sha256-8qGtiBFjkaF2Ji3ULfxS7yKvtA9MDpgQ8V1WHm8ccmo=";
+    inherit passthruFun;
   };
 
-  # the latest Devel version
-  perldevel = common {
-    perl = pkgs.perldevel;
-    buildPerl = buildPackages.perldevel;
-    version = "5.37.0";
-    sha256 = "sha256-8RQO6gtH+WmghqzRafbqAH1MhKv/vJCcvysi7/+T9XI=";
+  # Maint version
+  perl538 = callPackage ./intepreter.nix {
+    self = perl538;
+    version = "5.38.2";
+    sha256 = "sha256-oKMVNEUet7g8fWWUpJdUOlTUiLyQygD140diV39AZV4=";
+    inherit passthruFun;
   };
 }
diff --git a/pkgs/development/interpreters/perl/intepreter.nix b/pkgs/development/interpreters/perl/intepreter.nix
new file mode 100644
index 0000000000000..8861a0ed0456f
--- /dev/null
+++ b/pkgs/development/interpreters/perl/intepreter.nix
@@ -0,0 +1,261 @@
+{ stdenv
+, fetchurl
+, fetchFromGitHub
+, buildPackages
+, lib
+, self
+, version
+, sha256
+, pkgsBuildBuild
+, pkgsBuildHost
+, pkgsBuildTarget
+, pkgsHostHost
+, pkgsTargetTarget
+, zlib
+, config
+, passthruFun
+, perlAttr ? "perl${lib.versions.major version}${lib.versions.minor version}"
+, enableThreading ? true, coreutils, makeWrapper
+, enableCrypt ? true, libxcrypt ? null
+, overrides ? config.perlPackageOverrides or (p: {}) # TODO: (self: super: {}) like in python
+} @ inputs:
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+assert (enableCrypt -> (libxcrypt != null));
+
+let
+  crossCompiling = stdenv.buildPlatform != stdenv.hostPlatform;
+  libc = if stdenv.cc.libc or null != null then stdenv.cc.libc else "/usr";
+  libcInc = lib.getDev libc;
+  libcLib = lib.getLib libc;
+in
+
+stdenv.mkDerivation (rec {
+  inherit version;
+  pname = "perl";
+
+  src = fetchurl {
+    url = "mirror://cpan/src/5.0/perl-${version}.tar.gz";
+    inherit sha256;
+  };
+
+  strictDeps = true;
+  # TODO: Add a "dev" output containing the header files.
+  outputs = [ "out" "man" "devdoc" ] ++
+    lib.optional crossCompiling "mini";
+  setOutputFlags = false;
+
+  # On FreeBSD, if Perl is built with threads support, having
+  # libxcrypt available will result in a build failure, because
+  # perl.h will get conflicting definitions of struct crypt_data
+  # from libc's unistd.h and libxcrypt's crypt.h.
+  #
+  # FreeBSD Ports has the same issue building the perl port if
+  # the libxcrypt port has been installed.
+  #
+  # Without libxcrypt, Perl will still find FreeBSD's crypt functions.
+  propagatedBuildInputs = lib.optional (enableCrypt && !stdenv.isFreeBSD) libxcrypt;
+
+  disallowedReferences = [ stdenv.cc ];
+
+  patches =
+    # Enable TLS/SSL verification in HTTP::Tiny by default
+    lib.optional (lib.versionOlder version "5.38.0") ./http-tiny-verify-ssl-by-default.patch
+
+    # Do not look in /usr etc. for dependencies.
+    ++ lib.optional (lib.versionOlder version "5.38.0") ./no-sys-dirs-5.31.patch
+    ++ lib.optional (lib.versionAtLeast version "5.38.0") ./no-sys-dirs-5.38.0.patch
+
+    ++ lib.optional stdenv.isSunOS ./ld-shared.patch
+    ++ lib.optionals stdenv.isDarwin [ ./cpp-precomp.patch ./sw_vers.patch ]
+    ++ lib.optional crossCompiling ./cross.patch;
+
+  # This is not done for native builds because pwd may need to come from
+  # bootstrap tools when building bootstrap perl.
+  postPatch = (if crossCompiling then ''
+    substituteInPlace dist/PathTools/Cwd.pm \
+      --replace "/bin/pwd" '${coreutils}/bin/pwd'
+    substituteInPlace cnf/configure_tool.sh --replace "cc -E -P" "cc -E"
+  '' else ''
+    substituteInPlace dist/PathTools/Cwd.pm \
+      --replace "/bin/pwd" "$(type -P pwd)"
+  '') +
+  # Perl's build system uses the src variable, and its value may end up in
+  # the output in some cases (when cross-compiling)
+  ''
+    unset src
+  '';
+
+  # Build a thread-safe Perl with a dynamic libperl.so.  We need the
+  # "installstyle" option to ensure that modules are put under
+  # $out/lib/perl5 - this is the general default, but because $out
+  # contains the string "perl", Configure would select $out/lib.
+  # Miniperl needs -lm. perl needs -lrt.
+  configureFlags =
+    (if crossCompiling
+    then [ "-Dlibpth=\"\"" "-Dglibpth=\"\"" "-Ddefault_inc_excludes_dot" ]
+    else [ "-de" "-Dcc=cc" ])
+    ++ [
+      "-Uinstallusrbinperl"
+      "-Dinstallstyle=lib/perl5"
+    ] ++ lib.optional (!crossCompiling) "-Duseshrplib" ++ [
+      "-Dlocincpth=${libcInc}/include"
+      "-Dloclibpth=${libcLib}/lib"
+    ]
+    ++ lib.optionals ((builtins.match ''5\.[0-9]*[13579]\..+'' version) != null) [ "-Dusedevel" "-Uversiononly" ]
+    ++ lib.optional stdenv.isSunOS "-Dcc=gcc"
+    ++ lib.optional enableThreading "-Dusethreads"
+    ++ lib.optional (!enableCrypt) "-A clear:d_crypt_r"
+    ++ lib.optional stdenv.hostPlatform.isStatic "--all-static"
+    ++ lib.optionals (!crossCompiling) [
+      "-Dprefix=${placeholder "out"}"
+      "-Dman1dir=${placeholder "out"}/share/man/man1"
+      "-Dman3dir=${placeholder "out"}/share/man/man3"
+    ];
+
+  configureScript = lib.optionalString (!crossCompiling) "${stdenv.shell} ./Configure";
+
+  dontAddStaticConfigureFlags = true;
+
+  dontAddPrefix = !crossCompiling;
+
+  enableParallelBuilding = false;
+
+  # perl includes the build date, the uname of the build system and the
+  # username of the build user in some files.
+  # We override these to make it build deterministically.
+  # other distro solutions
+  # https://github.com/bmwiedemann/openSUSE/blob/master/packages/p/perl/perl-reproducible.patch
+  # https://github.com/archlinux/svntogit-packages/blob/packages/perl/trunk/config.over
+  # https://salsa.debian.org/perl-team/interpreter/perl/blob/debian-5.26/debian/config.over
+  # A ticket has been opened upstream to possibly clean some of this up: https://rt.perl.org/Public/Bug/Display.html?id=133452
+  preConfigure = ''
+    cat > config.over <<EOF
+    ${lib.optionalString (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isGnu) ''osvers="gnulinux"''}
+    myuname="nixpkgs"
+    myhostname="nixpkgs"
+    cf_by="nixpkgs"
+    cf_time="$(date -d "@$SOURCE_DATE_EPOCH")"
+    EOF
+
+    # Compress::Raw::Zlib should use our zlib package instead of the one
+    # included with the distribution
+    cat > ./cpan/Compress-Raw-Zlib/config.in <<EOF
+    BUILD_ZLIB   = False
+    INCLUDE      = ${zlib.dev}/include
+    LIB          = ${zlib.out}/lib
+    OLD_ZLIB     = False
+    GZIP_OS_CODE = AUTO_DETECT
+    USE_ZLIB_NG  = False
+    EOF
+  '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace hints/darwin.sh --replace "env MACOSX_DEPLOYMENT_TARGET=10.3" ""
+  '' + lib.optionalString (!enableThreading) ''
+    # We need to do this because the bootstrap doesn't have a static libpthread
+    sed -i 's,\(libswanted.*\)pthread,\1,g' Configure
+  '';
+
+  # Default perl does not support --host= & co.
+  configurePlatforms = [ ];
+
+  setupHook = ./setup-hook.sh;
+
+  # copied from python
+  passthru =
+    let
+      # When we override the interpreter we also need to override the spliced versions of the interpreter
+      inputs' = lib.filterAttrs (n: v: ! lib.isDerivation v && n != "passthruFun") inputs;
+      override = attr: let perl = attr.override (inputs' // { self = perl; }); in perl;
+    in
+    passthruFun rec {
+      inherit self perlAttr;
+      inherit overrides;
+      perlOnBuildForBuild = override pkgsBuildBuild.${perlAttr};
+      perlOnBuildForHost = override pkgsBuildHost.${perlAttr};
+      perlOnBuildForTarget = override pkgsBuildTarget.${perlAttr};
+      perlOnHostForHost = override pkgsHostHost.${perlAttr};
+      perlOnTargetForTarget = if lib.hasAttr perlAttr pkgsTargetTarget then (override pkgsTargetTarget.${perlAttr}) else { };
+    };
+
+  doCheck = false; # some tests fail, expensive
+
+  # TODO: it seems like absolute paths to some coreutils is required.
+  postInstall =
+    ''
+      # Remove dependency between "out" and "man" outputs.
+      rm "$out"/lib/perl5/*/*/.packlist
+
+      # Remove dependencies on glibc and gcc
+      sed "/ *libpth =>/c    libpth => ' '," \
+        -i "$out"/lib/perl5/*/*/Config.pm
+      # TODO: removing those paths would be cleaner than overwriting with nonsense.
+      substituteInPlace "$out"/lib/perl5/*/*/Config_heavy.pl \
+        --replace "${libcInc}" /no-such-path \
+        --replace "${
+            if stdenv.hasCC then stdenv.cc else "/no-such-path"
+          }" /no-such-path \
+        --replace "${
+            if stdenv.hasCC && stdenv.cc.cc != null then stdenv.cc.cc else "/no-such-path"
+        }" /no-such-path \
+        --replace "$man" /no-such-path
+    '' + lib.optionalString crossCompiling
+      ''
+        mkdir -p $mini/lib/perl5/cross_perl/${version}
+        for dir in cnf/{stub,cpan}; do
+          cp -r $dir/* $mini/lib/perl5/cross_perl/${version}
+        done
+
+        mkdir -p $mini/bin
+        install -m755 miniperl $mini/bin/perl
+
+        export runtimeArch="$(ls $out/lib/perl5/site_perl/${version})"
+        # wrapProgram should use a runtime-native SHELL by default, but
+        # it actually uses a buildtime-native one. If we ever fix that,
+        # we'll need to fix this to use a buildtime-native one.
+        #
+        # Adding the arch-specific directory is morally incorrect, as
+        # miniperl can't load the native modules there. However, it can
+        # (and sometimes needs to) load and run some of the pure perl
+        # code there, so we add it anyway. When needed, stubs can be put
+        # into $mini/lib/perl5/cross_perl/${version}.
+        wrapProgram $mini/bin/perl --prefix PERL5LIB : \
+          "$mini/lib/perl5/cross_perl/${version}:$out/lib/perl5/${version}:$out/lib/perl5/${version}/$runtimeArch"
+      ''; # */
+
+  meta = with lib; {
+    homepage = "https://www.perl.org/";
+    description = "The standard implementation of the Perl 5 programming language";
+    license = licenses.artistic1;
+    maintainers = [ maintainers.eelco ];
+    platforms = platforms.all;
+    priority = 6; # in `buildEnv' (including the one inside `perl.withPackages') the library files will have priority over files in `perl`
+    mainProgram = "perl";
+  };
+} // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) rec {
+  crossVersion = "84db4c71ae3d3b01fb2966cd15a060a7be334710"; # Nov 29, 2023
+
+  perl-cross-src = fetchFromGitHub {
+    name = "perl-cross-${crossVersion}";
+    owner = "arsv";
+    repo = "perl-cross";
+    rev = crossVersion;
+    sha256 = "sha256-1Zqw4sy/lD2nah0Z8rAE11tSpq1Ym9nBbatDczR+mxs=";
+  };
+
+  depsBuildBuild = [ buildPackages.stdenv.cc makeWrapper ];
+
+  postUnpack = ''
+    unpackFile ${perl-cross-src}
+    chmod -R u+w ${perl-cross-src.name}
+    cp -R ${perl-cross-src.name}/* perl-${version}/
+  '';
+
+  configurePlatforms = [ "build" "host" "target" ];
+
+  # TODO merge setup hooks
+  setupHook = ./setup-hook-cross.sh;
+})
diff --git a/pkgs/development/interpreters/perl/no-sys-dirs-5.38.0.patch b/pkgs/development/interpreters/perl/no-sys-dirs-5.38.0.patch
new file mode 100644
index 0000000000000..c959730d14208
--- /dev/null
+++ b/pkgs/development/interpreters/perl/no-sys-dirs-5.38.0.patch
@@ -0,0 +1,256 @@
+diff --git a/Configure b/Configure
+index e261cb9548..3bbbc4b9df 100755
+--- a/Configure
++++ b/Configure
+@@ -108,15 +108,7 @@ if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; th
+ fi
+ 
+ : Proper PATH setting
+-paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
+-paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
+-paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
+-paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
+-paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
+-paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
+-paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
+-paths="$paths /sbin /usr/sbin /usr/libexec"
+-paths="$paths /system/gnu_library/bin"
++paths=''
+ 
+ for p in $paths
+ do
+@@ -1455,8 +1447,7 @@ groupstype=''
+ i_whoami=''
+ : Possible local include directories to search.
+ : Set locincpth to "" in a hint file to defeat local include searches.
+-locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
+-locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
++locincpth=""
+ :
+ : no include file wanted by default
+ inclwanted=''
+@@ -1470,17 +1461,12 @@ DEBUGGING=''
+ archobjs=''
+ libnames=''
+ : change the next line if compiling for Xenix/286 on Xenix/386
+-xlibpth='/usr/lib/386 /lib/386'
++xlibpth=''
+ : Possible local library directories to search.
+-loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
+-loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
++loclibpth=""
+ 
+ : general looking path for locating libraries
+-glibpth="/lib /usr/lib $xlibpth"
+-glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
+-test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
+-test -f /shlib/libc.so     && glibpth="/shlib $glibpth"
+-test -d /usr/lib64         && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
++glibpth=""
+ 
+ : Private path used by Configure to find libraries.  Its value
+ : is prepended to libpth. This variable takes care of special
+@@ -1515,8 +1501,6 @@ libswanted="cl pthread socket bind inet ndbm gdbm dbm db malloc dl ld"
+ libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
+ : We probably want to search /usr/shlib before most other libraries.
+ : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
+-glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
+-glibpth="/usr/shlib $glibpth"
+ : Do not use vfork unless overridden by a hint file.
+ usevfork=false
+ 
+@@ -2581,7 +2565,6 @@ uname
+ zip
+ "
+ pth=`echo $PATH | sed -e "s/$p_/ /g"`
+-pth="$pth $sysroot/lib $sysroot/usr/lib"
+ for file in $loclist; do
+ 	eval xxx=\$$file
+ 	case "$xxx" in
+@@ -5023,7 +5006,7 @@ esac
+ : Set private lib path
+ case "$plibpth" in
+ '') if ./mips; then
+-	plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
++	plibpth="$incpath/usr/lib"
+     fi;;
+ esac
+ case "$libpth" in
+@@ -8860,13 +8843,8 @@ esac
+ echo " "
+ case "$sysman" in
+ '')
+-	syspath='/usr/share/man/man1 /usr/man/man1'
+-	syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
+-	syspath="$syspath /usr/man/u_man/man1"
+-	syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
+-	syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
+-	syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
+-	sysman=`./loc . /usr/man/man1 $syspath`
++	syspath=''
++	sysman=''
+ 	;;
+ esac
+ if $test -d "$sysman"; then
+@@ -21500,9 +21478,10 @@ $rm_try tryp
+ case "$full_ar" in
+ '') full_ar=$ar ;;
+ esac
++full_ar=ar
+ 
+ : Store the full pathname to the sed program for use in the C program
+-full_sed=$sed
++full_sed=sed
+ 
+ : see what type gids are declared as in the kernel
+ echo " "
+diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
+index ae647d5f06..9a05d66592 100644
+--- a/ext/Errno/Errno_pm.PL
++++ b/ext/Errno/Errno_pm.PL
+@@ -135,12 +135,7 @@ sub get_files {
+ 	if ($dep =~ /(\S+errno\.h)/) {
+ 	     push(@file, $1);
+ 	}
+-    } elsif ($^O eq 'linux' &&
+-	      $Config{gccversion} ne '' && 
+-	      $Config{gccversion} !~ /intel/i &&
+-	      # might be using, say, Intel's icc
+-	      $linux_errno_h
+-	     ) {
++    } elsif (0) {
+ 	push(@file, $linux_errno_h);
+     } elsif ($^O eq 'haiku') {
+ 	# hidden in a special place
+diff --git a/hints/freebsd.sh b/hints/freebsd.sh
+index 4d26835e99..c6d365d84d 100644
+--- a/hints/freebsd.sh
++++ b/hints/freebsd.sh
+@@ -127,21 +127,21 @@ case "$osvers" in
+         objformat=`/usr/bin/objformat`
+         if [ x$objformat = xaout ]; then
+             if [ -e /usr/lib/aout ]; then
+-                libpth="/usr/lib/aout /usr/local/lib /usr/lib"
+-                glibpth="/usr/lib/aout /usr/local/lib /usr/lib"
++                libpth=""
++                glibpth=""
+             fi
+             lddlflags='-Bshareable'
+         else
+-            libpth="/usr/lib /usr/local/lib"
+-            glibpth="/usr/lib /usr/local/lib"
++            libpth=""
++            glibpth=""
+             ldflags="-Wl,-E "
+             lddlflags="-shared "
+         fi
+         cccdlflags='-DPIC -fPIC'
+         ;;
+ *)
+-       libpth="/usr/lib /usr/local/lib"
+-       glibpth="/usr/lib /usr/local/lib"
++       libpth=""
++       glibpth=""
+        ldflags="-Wl,-E "
+         lddlflags="-shared "
+         cccdlflags='-DPIC -fPIC'
+diff --git a/hints/linux.sh b/hints/linux.sh
+index e1508c7509..5a187c583a 100644
+--- a/hints/linux.sh
++++ b/hints/linux.sh
+@@ -150,28 +150,6 @@ case "$optimize" in
+     ;;
+ esac
+ 
+-# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries
+-# (such as -lm) in /lib or /usr/lib.  So we have to ask gcc to tell us
+-# where to look.  We don't want gcc's own libraries, however, so we
+-# filter those out.
+-# This could be conditional on Ubuntu, but other distributions may
+-# follow suit, and this scheme seems to work even on rather old gcc's.
+-# This unconditionally uses gcc because even if the user is using another
+-# compiler, we still need to find the math library and friends, and I don't
+-# know how other compilers will cope with that situation.
+-# Morever, if the user has their own gcc earlier in $PATH than the system gcc,
+-# we don't want its libraries. So we try to prefer the system gcc
+-# Still, as an escape hatch, allow Configure command line overrides to
+-# plibpth to bypass this check.
+-if [ -x /usr/bin/gcc ] ; then
+-    gcc=/usr/bin/gcc
+-# clang also provides -print-search-dirs
+-elif ${cc:-cc} --version 2>/dev/null | grep -q '^clang ' ; then
+-    gcc=${cc:-cc}
+-else
+-    gcc=gcc
+-fi
+-
+ case "$plibpth" in
+ '') plibpth=`LANG=C LC_ALL=C $gcc $ccflags $ldflags -print-search-dirs | grep libraries |
+ 	cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'`
+@@ -208,32 +186,6 @@ case "$usequadmath" in
+   ;;
+ esac
+ 
+-case "$libc" in
+-'')
+-# If you have glibc, then report the version for ./myconfig bug reporting.
+-# (Configure doesn't need to know the specific version since it just uses
+-# gcc to load the library for all tests.)
+-# We don't use __GLIBC__ and  __GLIBC_MINOR__ because they
+-# are insufficiently precise to distinguish things like
+-# libc-2.0.6 and libc-2.0.7.
+-    for p in $plibpth
+-    do
+-        for trylib in libc.so.6 libc.so
+-        do
+-            if $test -e $p/$trylib; then
+-                libc=`ls -l $p/$trylib | awk '{print $NF}'`
+-                if $test "X$libc" != X; then
+-                    break
+-                fi
+-            fi
+-        done
+-        if $test "X$libc" != X; then
+-            break
+-        fi
+-    done
+-    ;;
+-esac
+-
+ if ${sh:-/bin/sh} -c exit; then
+   echo ''
+   echo 'You appear to have a working bash.  Good.'
+@@ -311,33 +263,6 @@ sparc*)
+ 	;;
+ esac
+ 
+-# SuSE8.2 has /usr/lib/libndbm* which are ld scripts rather than
+-# true libraries. The scripts cause binding against static
+-# version of -lgdbm which is a bad idea. So if we have 'nm'
+-# make sure it can read the file
+-# NI-S 2003/08/07
+-case "$nm" in
+-    '') ;;
+-    *)
+-    for p in $plibpth
+-    do
+-        if $test -r $p/libndbm.so; then
+-            if $nm $p/libndbm.so >/dev/null 2>&1 ; then
+-                echo 'Your shared -lndbm seems to be a real library.'
+-                _libndbm_real=1
+-                break
+-            fi
+-        fi
+-    done
+-    if $test "X$_libndbm_real" = X; then
+-        echo 'Your shared -lndbm is not a real library.'
+-        set `echo X "$libswanted "| sed -e 's/ ndbm / /'`
+-        shift
+-        libswanted="$*"
+-    fi
+-    ;;
+-esac
+-
+ # Linux on Synology.
+ if [ -f /etc/synoinfo.conf -a -d /usr/syno ]; then
+     # Tested on Synology DS213 and DS413
diff --git a/pkgs/development/interpreters/perl/wrapper.nix b/pkgs/development/interpreters/perl/wrapper.nix
index e1909a15e059f..8e4630b48e76d 100644
--- a/pkgs/development/interpreters/perl/wrapper.nix
+++ b/pkgs/development/interpreters/perl/wrapper.nix
@@ -1,4 +1,4 @@
-{ lib, perl, buildEnv, makeWrapper
+{ lib, perl, buildEnv, makeBinaryWrapper
 , extraLibs ? []
 , extraOutputsToInstall ? []
 , postBuild ? ""
@@ -17,7 +17,7 @@ let
     inherit ignoreCollisions;
     extraOutputsToInstall = [ "out" ] ++ extraOutputsToInstall;
 
-    nativeBuildInputs = [ makeWrapper ];
+    nativeBuildInputs = [ makeBinaryWrapper ];
 
     # we create wrapper for the binaries in the different packages
     postBuild = ''
diff --git a/pkgs/development/interpreters/php/8.1.nix b/pkgs/development/interpreters/php/8.1.nix
index 95edce456c9b0..5f5be6b3d1d83 100644
--- a/pkgs/development/interpreters/php/8.1.nix
+++ b/pkgs/development/interpreters/php/8.1.nix
@@ -1,9 +1,9 @@
-{ callPackage, lib, stdenv, ... }@_args:
+{ callPackage, ... }@_args:
 
 let
   base = callPackage ./generic.nix (_args // {
-    version = "8.1.17";
-    hash = "sha256-9Pspig6wkflE7OusV7dtqudoqXDC9RYQpask802MDK8=";
+    version = "8.1.26";
+    hash = "sha256-g73iSchKoaBDqMjQ7qCTRcLK5puXhM3wIin8kW+7nqA=";
   });
 
 in
diff --git a/pkgs/development/interpreters/php/8.2.nix b/pkgs/development/interpreters/php/8.2.nix
index 3b990e61bf5ba..20aa6aaa0bc08 100644
--- a/pkgs/development/interpreters/php/8.2.nix
+++ b/pkgs/development/interpreters/php/8.2.nix
@@ -1,9 +1,9 @@
-{ callPackage, lib, stdenv, fetchurl, ... }@_args:
+{ callPackage, ... }@_args:
 
 let
   base = callPackage ./generic.nix (_args // {
-    version = "8.2.4";
-    hash = "sha256-eRhvlL1RDbhuMeU13USCd6Hrkqh4eDA6Hq1EYC2LEZc=";
+    version = "8.2.13";
+    hash = "sha256-ZlKfQ7ITEx5rJTxWAr7wXwSUWNISknMPzNY7SKBtZ7o=";
   });
 
 in
diff --git a/pkgs/development/interpreters/php/8.0.nix b/pkgs/development/interpreters/php/8.3.nix
index ddc4ed17acbd2..6327e23504a8f 100644
--- a/pkgs/development/interpreters/php/8.0.nix
+++ b/pkgs/development/interpreters/php/8.3.nix
@@ -1,11 +1,10 @@
-{ callPackage, lib, stdenv, ... }@_args:
+{ callPackage, fetchurl, ... }@_args:
 
 let
   base = callPackage ./generic.nix (_args // {
-    version = "8.0.28";
-    hash = "sha256-nV50k1yQDjuce2vHQFlrcZM2MOufY3F8DEkj2MeIxi4=";
+    version = "8.3.0";
+    hash = "sha256-3mfQgz1CsZblpm+hozL0Xilsvo6UcuklayoHHDTcXtY=";
   });
-
 in
 base.withExtensions ({ all, ... }: with all; ([
   bcmath
diff --git a/pkgs/development/interpreters/php/generic.nix b/pkgs/development/interpreters/php/generic.nix
index 74dedcfe2d18a..3bea507ad0a9e 100644
--- a/pkgs/development/interpreters/php/generic.nix
+++ b/pkgs/development/interpreters/php/generic.nix
@@ -9,7 +9,7 @@ let
     , nixosTests
     , tests
     , fetchurl
-    , makeWrapper
+    , makeBinaryWrapper
     , symlinkJoin
     , writeText
     , autoconf
@@ -33,10 +33,12 @@ let
     , jq
 
     , version
-    , hash
+    , phpSrc ? null
+    , hash ? null
     , extraPatches ? [ ]
     , packageOverrides ? (final: prev: { })
     , phpAttrsOverrides ? (attrs: { })
+    , pearInstallPhar ? (callPackage ./install-pear-nozlib-phar.nix { })
 
       # Sapi flags
     , cgiSupport ? true
@@ -51,7 +53,10 @@ let
     , argon2Support ? true
     , cgotoSupport ? false
     , embedSupport ? false
+    , staticSupport ? false
     , ipv6Support ? true
+    , zendSignalsSupport ? true
+    , zendMaxExecutionTimersSupport ? false
     , systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd
     , valgrindSupport ? !stdenv.isDarwin && lib.meta.availableOn stdenv.hostPlatform valgrind
     , ztsSupport ? apxs2Support
@@ -85,7 +90,7 @@ let
 
           php-packages = (callPackage ../../../top-level/php-packages.nix {
             phpPackage = phpWithExtensions;
-          }).overrideScope' packageOverrides;
+          }).overrideScope packageOverrides;
 
           allExtensionFunctions = prevExtensionFunctions ++ [ extensions ];
           enabledExtensions =
@@ -141,7 +146,7 @@ let
           phpWithExtensions = symlinkJoin {
             name = "php-with-extensions-${version}";
             inherit (php) version;
-            nativeBuildInputs = [ makeWrapper ];
+            nativeBuildInputs = [ makeBinaryWrapper ];
             passthru = php.passthru // {
               buildEnv = mkBuildEnv allArgs allExtensionFunctions;
               withExtensions = mkWithExtensions allArgs allExtensionFunctions;
@@ -159,7 +164,7 @@ let
                 nixos = lib.recurseIntoAttrs nixosTests."php${lib.strings.replaceStrings [ "." ] [ "" ] (lib.versions.majorMinor php.version)}";
                 package = tests.php;
               };
-              inherit (php-packages) extensions buildPecl mkExtension;
+              inherit (php-packages) extensions buildPecl mkComposerRepository buildComposerProject composerHooks mkExtension;
               packages = php-packages.tools;
               meta = php.meta // {
                 outputsToInstall = [ "out" ];
@@ -170,19 +175,19 @@ let
               ln -s ${extraInit} $out/lib/php.ini
 
               if test -e $out/bin/php; then
-                wrapProgram $out/bin/php --set PHP_INI_SCAN_DIR $out/lib
+                wrapProgram $out/bin/php --set-default PHP_INI_SCAN_DIR $out/lib
               fi
 
               if test -e $out/bin/php-fpm; then
-                wrapProgram $out/bin/php-fpm --set PHP_INI_SCAN_DIR $out/lib
+                wrapProgram $out/bin/php-fpm --set-default PHP_INI_SCAN_DIR $out/lib
               fi
 
               if test -e $out/bin/phpdbg; then
-                wrapProgram $out/bin/phpdbg --set PHP_INI_SCAN_DIR $out/lib
+                wrapProgram $out/bin/phpdbg --set-default PHP_INI_SCAN_DIR $out/lib
               fi
 
               if test -e $out/bin/php-cgi; then
-                wrapProgram $out/bin/php-cgi --set PHP_INI_SCAN_DIR $out/lib
+                wrapProgram $out/bin/php-cgi --set-default PHP_INI_SCAN_DIR $out/lib
               fi
             '';
           };
@@ -192,6 +197,11 @@ let
 
       mkWithExtensions = prevArgs: prevExtensionFunctions: extensions:
         mkBuildEnv prevArgs prevExtensionFunctions { inherit extensions; };
+
+      defaultPhpSrc = fetchurl {
+        url = "https://www.php.net/distributions/php-${version}.tar.bz2";
+        inherit hash;
+      };
     in
     stdenv.mkDerivation (
       let
@@ -229,7 +239,6 @@ let
             # PCRE
             ++ [ "--with-external-pcre=${pcre2.dev}" ]
 
-
             # Enable sapis
             ++ lib.optional (!cgiSupport) "--disable-cgi"
             ++ lib.optional (!cliSupport) "--disable-cli"
@@ -243,12 +252,14 @@ let
             ++ lib.optional apxs2Support "--with-apxs2=${apacheHttpd.dev}/bin/apxs"
             ++ lib.optional argon2Support "--with-password-argon2=${libargon2}"
             ++ lib.optional cgotoSupport "--enable-re2c-cgoto"
-            ++ lib.optional embedSupport "--enable-embed"
+            ++ lib.optional embedSupport "--enable-embed${lib.optionalString staticSupport "=static"}"
             ++ lib.optional (!ipv6Support) "--disable-ipv6"
             ++ lib.optional systemdSupport "--with-fpm-systemd"
             ++ lib.optional valgrindSupport "--with-valgrind=${valgrind.dev}"
-            ++ lib.optional (ztsSupport && (lib.versionOlder version "8.0")) "--enable-maintainer-zts"
-            ++ lib.optional (ztsSupport && (lib.versionAtLeast version "8.0")) "--enable-zts"
+            ++ lib.optional ztsSupport "--enable-zts"
+            ++ lib.optional staticSupport "--enable-static"
+            ++ lib.optional (!zendSignalsSupport) ["--disable-zend-signals"]
+            ++ lib.optional zendMaxExecutionTimersSupport "--enable-zend-max-execution-timers"
 
 
             # Sendmail
@@ -272,13 +283,22 @@ let
 
               ./buildconf --copy --force
 
-              if test -f $src/genfiles; then
-                ./genfiles
+              if [ -f "scripts/dev/genfiles" ]; then
+                ./scripts/dev/genfiles
               fi
             '' + lib.optionalString stdenv.isDarwin ''
               substituteInPlace configure --replace "-lstdc++" "-lc++"
             '';
 
+          # When compiling PHP sources from Github, this file is missing and we
+          # need to install it ourselves.
+          # On the other hand, a distribution includes this file by default.
+          preInstall = ''
+            if [[ ! -f ./pear/install-pear-nozlib.phar ]]; then
+              cp ${pearInstallPhar} ./pear/install-pear-nozlib.phar
+            fi
+          '';
+
           postInstall = ''
             test -d $out/etc || mkdir $out/etc
             cp php.ini-production $out/etc/php.ini
@@ -292,10 +312,7 @@ let
                $dev/share/man/man1/
           '';
 
-          src = fetchurl {
-            url = "https://www.php.net/distributions/php-${version}.tar.bz2";
-            inherit hash;
-          };
+          src = if phpSrc == null then defaultPhpSrc else phpSrc;
 
           patches = [ ./fix-paths-php7.patch ] ++ extraPatches;
 
diff --git a/pkgs/development/interpreters/php/install-pear-nozlib-phar.nix b/pkgs/development/interpreters/php/install-pear-nozlib-phar.nix
new file mode 100644
index 0000000000000..9de0ec4418628
--- /dev/null
+++ b/pkgs/development/interpreters/php/install-pear-nozlib-phar.nix
@@ -0,0 +1,8 @@
+{
+  fetchurl
+}:
+
+fetchurl {
+  url = "https://github.com/pear/pearweb_phars/raw/v1.10.21/install-pear-nozlib.phar";
+  hash = "sha256-UblKVcsm030tNSA6mdeab+h7ZhANNz7MkFf4Z1iigjs=";
+}
diff --git a/pkgs/development/interpreters/php/skip-sqlite3_bind_bug68849.phpt.patch b/pkgs/development/interpreters/php/skip-sqlite3_bind_bug68849.phpt.patch
new file mode 100644
index 0000000000000..8e208e52dbabd
--- /dev/null
+++ b/pkgs/development/interpreters/php/skip-sqlite3_bind_bug68849.phpt.patch
@@ -0,0 +1,75 @@
+diff --git a/ext/sqlite3/tests/sqlite3_bind_bug68849.phpt b/ext/sqlite3/tests/sqlite3_bind_bug68849.phpt
+deleted file mode 100644
+index 6324d079..00000000
+--- a/ext/sqlite3/tests/sqlite3_bind_bug68849.phpt
++++ /dev/null
+@@ -1,69 +0,0 @@
+---TEST--
+-Bug #68849 bindValue is not using the right data type
+---EXTENSIONS--
+-sqlite3
+---FILE--
+-<?php
+-
+-$db = new SQLite3(':memory:');
+-
+-$db->exec("CREATE TABLE test (a INTEGER, b TEXT, c REAL);" .
+-        "INSERT INTO test VALUES (1, 'hello', 3.14);" .
+-        "INSERT INTO test VALUES (3, 'world', 3.15);" .
+-        "INSERT INTO test VALUES (0, '42', 0.42);"
+-);
+-
+-$s = $db->prepare('SELECT * FROM test WHERE (a+2) = ?;');
+-$s->bindValue(1, 3);
+-$r = $s->execute();
+-var_dump($r->fetchArray(SQLITE3_ASSOC));
+-
+-$s = $db->prepare('SELECT * FROM test WHERE a = ?;');
+-$s->bindValue(1, true);
+-$r = $s->execute();
+-var_dump($r->fetchArray(SQLITE3_ASSOC));
+-
+-$s = $db->prepare('SELECT * FROM test WHERE a = ?;');
+-$s->bindValue(1, false);
+-$r = $s->execute();
+-var_dump($r->fetchArray(SQLITE3_ASSOC));
+-
+-$s = $db->prepare('SELECT * FROM test WHERE c = ?;');
+-$s->bindValue(1, 3.15);
+-$r = $s->execute();
+-var_dump($r->fetchArray(SQLITE3_ASSOC));
+-
+-?>
+---EXPECT--
+-array(3) {
+-  ["a"]=>
+-  int(1)
+-  ["b"]=>
+-  string(5) "hello"
+-  ["c"]=>
+-  float(3.14)
+-}
+-array(3) {
+-  ["a"]=>
+-  int(1)
+-  ["b"]=>
+-  string(5) "hello"
+-  ["c"]=>
+-  float(3.14)
+-}
+-array(3) {
+-  ["a"]=>
+-  int(0)
+-  ["b"]=>
+-  string(2) "42"
+-  ["c"]=>
+-  float(0.42)
+-}
+-array(3) {
+-  ["a"]=>
+-  int(3)
+-  ["b"]=>
+-  string(5) "world"
+-  ["c"]=>
+-  float(3.15)
+-}
diff --git a/pkgs/development/interpreters/picolisp/default.nix b/pkgs/development/interpreters/picolisp/default.nix
index b85f99a7b52d9..4e589cb722e18 100644
--- a/pkgs/development/interpreters/picolisp/default.nix
+++ b/pkgs/development/interpreters/picolisp/default.nix
@@ -60,7 +60,7 @@ stdenv.mkDerivation rec {
 
   passthru = {
     updateInfo = {
-      downloadPage = "http://www.software-lab.de/down.html";
+      downloadPage = "https://www.software-lab.de/down.html";
     };
   };
 }
diff --git a/pkgs/development/interpreters/python/catch_conflicts/catch_conflicts.py b/pkgs/development/interpreters/python/catch_conflicts/catch_conflicts.py
index bb82900c65a92..d5c99e64751c7 100644
--- a/pkgs/development/interpreters/python/catch_conflicts/catch_conflicts.py
+++ b/pkgs/development/interpreters/python/catch_conflicts/catch_conflicts.py
@@ -1,30 +1,34 @@
-import pkg_resources
+from importlib.metadata import PathDistribution
+from pathlib import Path
 import collections
 import sys
 
+
 do_abort = False
 packages = collections.defaultdict(list)
 
-for f in sys.path:
-    for req in pkg_resources.find_distributions(f):
-        if req not in packages[req.project_name]:
-            # some exceptions inside buildPythonPackage
-            if req.project_name in ['setuptools', 'pip', 'wheel']:
-                continue
-            packages[req.project_name].append(req)
+
+for path in sys.path:
+    for dist_info in Path(path).glob("*.dist-info"):
+        dist = PathDistribution(dist_info)
+
+        packages[dist._normalized_name].append(
+            f"{dist._normalized_name} {dist.version} ({dist._path})"
+        )
 
 
 for name, duplicates in packages.items():
     if len(duplicates) > 1:
         do_abort = True
         print("Found duplicated packages in closure for dependency '{}': ".format(name))
-        for dup in duplicates:
-            print("  " + repr(dup))
+        for duplicate in duplicates:
+            print(f"\t{duplicate}")
 
 if do_abort:
     print("")
     print(
-        'Package duplicates found in closure, see above. Usually this '
-        'happens if two packages depend on different version '
-        'of the same dependency.')
+        "Package duplicates found in closure, see above. Usually this "
+        "happens if two packages depend on different version "
+        "of the same dependency."
+    )
     sys.exit(1)
diff --git a/pkgs/development/interpreters/python/catch_conflicts/catch_conflicts_py2.py b/pkgs/development/interpreters/python/catch_conflicts/catch_conflicts_py2.py
new file mode 100644
index 0000000000000..bb82900c65a92
--- /dev/null
+++ b/pkgs/development/interpreters/python/catch_conflicts/catch_conflicts_py2.py
@@ -0,0 +1,30 @@
+import pkg_resources
+import collections
+import sys
+
+do_abort = False
+packages = collections.defaultdict(list)
+
+for f in sys.path:
+    for req in pkg_resources.find_distributions(f):
+        if req not in packages[req.project_name]:
+            # some exceptions inside buildPythonPackage
+            if req.project_name in ['setuptools', 'pip', 'wheel']:
+                continue
+            packages[req.project_name].append(req)
+
+
+for name, duplicates in packages.items():
+    if len(duplicates) > 1:
+        do_abort = True
+        print("Found duplicated packages in closure for dependency '{}': ".format(name))
+        for dup in duplicates:
+            print("  " + repr(dup))
+
+if do_abort:
+    print("")
+    print(
+        'Package duplicates found in closure, see above. Usually this '
+        'happens if two packages depend on different version '
+        'of the same dependency.')
+    sys.exit(1)
diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix
index 9cd806c052333..5cdd307e70fe6 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;
@@ -133,6 +133,11 @@ let
 
     ] ++ lib.optionals (x11Support && stdenv.isDarwin) [
       ./use-correct-tcl-tk-on-darwin.patch
+
+    ] ++ lib.optionals stdenv.isDarwin [
+      # Fix darwin build https://bugs.python.org/issue34027
+      ../3.7/darwin-libutil.patch
+
     ] ++ lib.optionals stdenv.isLinux [
 
       # Disable the use of ldconfig in ctypes.util.find_library (since
@@ -297,9 +302,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/3.13/no-ldconfig.patch b/pkgs/development/interpreters/python/cpython/3.13/no-ldconfig.patch
new file mode 100644
index 0000000000000..ca6a76d0ffd98
--- /dev/null
+++ b/pkgs/development/interpreters/python/cpython/3.13/no-ldconfig.patch
@@ -0,0 +1,107 @@
+From 5330b6af9f832af59aa5c61d9ef6971053a8e709 Mon Sep 17 00:00:00 2001
+From: Jonathan Ringer <jonringer117@gmail.com>
+Date: Mon, 9 Nov 2020 10:24:35 -0800
+Subject: [PATCH] CPython: Don't use ldconfig
+
+---
+ Lib/ctypes/util.py | 77 ++--------------------------------------------
+ 1 file changed, 2 insertions(+), 75 deletions(-)
+
+diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
+index 0c2510e161..7fb98af308 100644
+--- a/Lib/ctypes/util.py
++++ b/Lib/ctypes/util.py
+@@ -100,53 +100,7 @@ def _is_elf(filename):
+             return thefile.read(4) == elf_header
+ 
+     def _findLib_gcc(name):
+-        # Run GCC's linker with the -t (aka --trace) option and examine the
+-        # library name it prints out. The GCC command will fail because we
+-        # haven't supplied a proper program with main(), but that does not
+-        # matter.
+-        expr = os.fsencode(r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name))
+-
+-        c_compiler = shutil.which('gcc')
+-        if not c_compiler:
+-            c_compiler = shutil.which('cc')
+-        if not c_compiler:
+-            # No C compiler available, give up
+-            return None
+-
+-        temp = tempfile.NamedTemporaryFile()
+-        try:
+-            args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l' + name]
+-
+-            env = dict(os.environ)
+-            env['LC_ALL'] = 'C'
+-            env['LANG'] = 'C'
+-            try:
+-                proc = subprocess.Popen(args,
+-                                        stdout=subprocess.PIPE,
+-                                        stderr=subprocess.STDOUT,
+-                                        env=env)
+-            except OSError:  # E.g. bad executable
+-                return None
+-            with proc:
+-                trace = proc.stdout.read()
+-        finally:
+-            try:
+-                temp.close()
+-            except FileNotFoundError:
+-                # Raised if the file was already removed, which is the normal
+-                # behaviour of GCC if linking fails
+-                pass
+-        res = re.findall(expr, trace)
+-        if not res:
+-            return None
+-
+-        for file in res:
+-            # Check if the given file is an elf file: gcc can report
+-            # some files that are linker scripts and not actual
+-            # shared objects. See bpo-41976 for more details
+-            if not _is_elf(file):
+-                continue
+-            return os.fsdecode(file)
++        return None
+ 
+ 
+     if sys.platform == "sunos5":
+@@ -268,34 +222,7 @@ def find_library(name, is64 = False):
+     else:
+ 
+         def _findSoname_ldconfig(name):
+-            import struct
+-            if struct.calcsize('l') == 4:
+-                machine = os.uname().machine + '-32'
+-            else:
+-                machine = os.uname().machine + '-64'
+-            mach_map = {
+-                'x86_64-64': 'libc6,x86-64',
+-                'ppc64-64': 'libc6,64bit',
+-                'sparc64-64': 'libc6,64bit',
+-                's390x-64': 'libc6,64bit',
+-                'ia64-64': 'libc6,IA-64',
+-                }
+-            abi_type = mach_map.get(machine, 'libc6')
+-
+-            # XXX assuming GLIBC's ldconfig (with option -p)
+-            regex = r'\s+(lib%s\.[^\s]+)\s+\(%s'
+-            regex = os.fsencode(regex % (re.escape(name), abi_type))
+-            try:
+-                with subprocess.Popen(['/sbin/ldconfig', '-p'],
+-                                      stdin=subprocess.DEVNULL,
+-                                      stderr=subprocess.DEVNULL,
+-                                      stdout=subprocess.PIPE,
+-                                      env={'LC_ALL': 'C', 'LANG': 'C'}) as p:
+-                    res = re.search(regex, p.stdout.read())
+-                    if res:
+-                        return os.fsdecode(res.group(1))
+-            except OSError:
+-                pass
++            return None
+ 
+         def _findLib_ld(name):
+             # See issue #9998 for why this is needed
+-- 
+2.33.1
+
diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix
index 0afdba9983e02..8e13ed51bc741 100644
--- a/pkgs/development/interpreters/python/cpython/default.nix
+++ b/pkgs/development/interpreters/python/cpython/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, fetchpatch
+{ lib, stdenv, fetchurl, fetchpatch, fetchgit
 , bzip2
 , expat
 , libffi
@@ -18,6 +18,7 @@
 , self
 , configd
 , darwin
+, windows
 , autoreconfHook
 , autoconf-archive
 , pkg-config
@@ -44,6 +45,9 @@
 , static ? stdenv.hostPlatform.isStatic
 , enableFramework ? false
 , enableOptimizations ? false
+# these dont build for windows
+, withGdbm ? !stdenv.hostPlatform.isWindows
+, withReadline ? !stdenv.hostPlatform.isWindows
 # enableNoSemanticInterposition is a subset of the enableOptimizations flag that doesn't harm reproducibility.
 # clang starts supporting `-fno-sematic-interposition` with version 10
 , enableNoSemanticInterposition ? (!stdenv.cc.isClang || (stdenv.cc.isClang && lib.versionAtLeast stdenv.cc.version "10"))
@@ -53,6 +57,8 @@
 , enableLTO ? stdenv.is64bit && stdenv.isLinux
 , reproducibleBuild ? false
 , pythonAttr ? "python${sourceVersion.major}${sourceVersion.minor}"
+, noldconfigPatch ? ./. + "/${sourceVersion.major}.${sourceVersion.minor}/no-ldconfig.patch"
+, testers
 } @ inputs:
 
 # Note: this package is used for bootstrapping fetchurl, and thus
@@ -86,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;
 
@@ -108,7 +114,7 @@ let
     pythonOnBuildForHost = override pkgsBuildHost.${pythonAttr};
     pythonOnBuildForTarget = override pkgsBuildTarget.${pythonAttr};
     pythonOnHostForHost = override pkgsHostHost.${pythonAttr};
-    pythonOnTargetForTarget = if lib.hasAttr pythonAttr pkgsTargetTarget then (override pkgsTargetTarget.${pythonAttr}) else {};
+    pythonOnTargetForTarget = lib.optionalAttrs (lib.hasAttr pythonAttr pkgsTargetTarget) (override pkgsTargetTarget.${pythonAttr});
   };
 
   version = with sourceVersion; "${major}.${minor}.${patch}${suffix}";
@@ -121,25 +127,35 @@ 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
   ];
 
   buildInputs = filter (p: p != null) ([
-    zlib bzip2 expat xz libffi libxcrypt gdbm sqlite readline ncurses openssl' ]
+    zlib bzip2 expat xz libffi libxcrypt ]
+    ++ optional withGdbm gdbm
+    ++ [ sqlite ]
+    ++ optional withReadline readline
+    ++ [ ncurses openssl' ]
     ++ optionals x11Support [ tcl tk libX11 xorgproto ]
     ++ optionals (bluezSupport && stdenv.isLinux) [ bluez ]
     ++ optionals stdenv.isDarwin [ configd ])
 
     ++ optionals enableFramework [ Cocoa ]
+    ++ optionals stdenv.hostPlatform.isMinGW [ windows.mingw_w64_pthreads windows.dlfcn ]
     ++ optionals tzdataSupport [ tzdata ];  # `zoneinfo` module
 
   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";
+    inherit hash;
+  };
 
   # The CPython interpreter contains a _sysconfigdata_<platform specific suffix>
   # module that is imported by the sysconfig and distutils.sysconfig modules.
@@ -154,6 +170,8 @@ let
   # are not documented, and must be derived from the configure script (see links
   # below).
   sysconfigdataHook = with stdenv.hostPlatform; with passthru; let
+    machdep = if isWindows then "win32" else parsed.kernel.name; # win32 is added by Fedora’s patch
+
     # https://github.com/python/cpython/blob/e488e300f5c01289c10906c2e53a8e43d6de32d8/configure.ac#L428
     # The configure script uses "arm" as the CPU name for all 32-bit ARM
     # variants when cross-compiling, but native builds include the version
@@ -170,7 +188,7 @@ let
         powerpc64 = "ppc64";
         powerpc64le = "ppc64le";
       }.${parsed.cpu.name} or parsed.cpu.name;
-    in "${parsed.kernel.name}-${cpu}";
+    in "${machdep}-${cpu}";
 
     # https://github.com/python/cpython/blob/e488e300f5c01289c10906c2e53a8e43d6de32d8/configure.ac#L724
     multiarchCpu =
@@ -178,31 +196,31 @@ let
         if parsed.cpu.significantByte.name == "littleEndian" then "arm" else "armeb"
       else if isx86_32 then "i386"
       else parsed.cpu.name;
-    pythonAbiName =
-      # python's build doesn't support every gnu<extension>, and doesn't
-      # differentiate between musl and glibc, so we list those supported in
-      # here:
+
+    pythonAbiName = let
+      # python's build doesn't match the nixpkgs abi in some cases.
       # https://github.com/python/cpython/blob/e488e300f5c01289c10906c2e53a8e43d6de32d8/configure.ac#L724
-      # Note: this is an approximation, as it doesn't take into account the CPU
-      # family, or the nixpkgs abi naming conventions.
-      if elem parsed.abi.name [
-        "gnux32"
-        "gnueabihf"
-        "gnueabi"
-        "gnuabin32"
-        "gnuabi64"
-        "gnuspe"
-      ]
-      then parsed.abi.name
-      else "gnu";
+      nixpkgsPythonAbiMappings = {
+        "gnuabielfv2" = "gnu";
+        "muslabielfv2" = "musl";
+      };
+      pythonAbi = nixpkgsPythonAbiMappings.${parsed.abi.name} or parsed.abi.name;
+    in
+      # Python <3.11 doesn't distinguish musl and glibc and always prefixes with "gnu"
+      if lib.versionOlder version "3.11" then
+        replaceStrings [ "musl" ] [ "gnu" ] pythonAbi
+      else
+        pythonAbi;
+
     multiarch =
       if isDarwin then "darwin"
-      else "${multiarchCpu}-${parsed.kernel.name}-${pythonAbiName}";
+      else if isWindows then ""
+      else "${multiarchCpu}-${machdep}-${pythonAbiName}";
 
     abiFlags = optionalString isPy37 "m";
 
     # https://github.com/python/cpython/blob/e488e300f5c01289c10906c2e53a8e43d6de32d8/configure.ac#L78
-    pythonSysconfigdataName = "_sysconfigdata_${abiFlags}_${parsed.kernel.name}_${multiarch}";
+    pythonSysconfigdataName = "_sysconfigdata_${abiFlags}_${machdep}_${multiarch}";
   in ''
     sysconfigdataHook() {
       if [ "$1" = '${placeholder "out"}' ]; then
@@ -214,17 +232,14 @@ let
     addEnvHooks "$hostOffset" sysconfigdataHook
   '';
 
-in with passthru; stdenv.mkDerivation {
+  execSuffix = stdenv.hostPlatform.extensions.executable;
+in with passthru; stdenv.mkDerivation (finalAttrs: {
   pname = "python3";
-  inherit version;
+  inherit src version;
 
   inherit nativeBuildInputs;
-  buildInputs = [ bash ] ++ buildInputs; # bash is only for patchShebangs
+  buildInputs = lib.optionals (!stdenv.hostPlatform.isWindows) [ bash ] ++ buildInputs; # bash is only used for patchShebangs
 
-  src = fetchurl {
-    url = with sourceVersion; "https://www.python.org/ftp/python/${major}.${minor}.${patch}/Python-${version}.tar.xz";
-    inherit hash;
-  };
 
   prePatch = optionalString stdenv.isDarwin ''
     substituteInPlace configure --replace '`/usr/bin/arch`' '"i386"'
@@ -251,7 +266,7 @@ in with passthru; stdenv.mkDerivation {
     # ctypes.util.find_library during the loading of the uuid module
     # (since it will do a futile invocation of gcc (!) to find
     # libuuid, slowing down program startup a lot).
-    (./. + "/${sourceVersion.major}.${sourceVersion.minor}/no-ldconfig.patch")
+    noldconfigPatch
     # Make sure that the virtualenv activation scripts are
     # owner-writable, so venvs can be recreated without permission
     # errors.
@@ -283,20 +298,36 @@ in with passthru; stdenv.mkDerivation {
           sha256 = "1h18lnpx539h5lfxyk379dxwr8m2raigcjixkf133l4xy3f4bzi2";
         }
     )
-  ] ++ optionals (pythonOlder "3.12") [
+  ] ++ optionals (pythonAtLeast "3.7" && pythonOlder "3.12") [
     # LDSHARED now uses $CC instead of gcc. Fixes cross-compilation of extension modules.
     ./3.8/0001-On-all-posix-systems-not-just-Darwin-set-LDSHARED-if.patch
     # Use sysconfigdata to find headers. Fixes cross-compilation of extension modules.
     ./3.7/fix-finding-headers-when-cross-compiling.patch
-  ];
-
-  postPatch = ''
+  ] ++ optionals (pythonOlder "3.12") [
+    # https://github.com/python/cpython/issues/90656
+    ./loongarch-support.patch
+  ] ++ optionals (pythonAtLeast "3.11" && pythonOlder "3.13") [
+    # backport fix for https://github.com/python/cpython/issues/95855
+    ./platform-triplet-detection.patch
+  ] ++ optionals (stdenv.hostPlatform.isMinGW) (let
+    # https://src.fedoraproject.org/rpms/mingw-python3
+    mingw-patch = fetchgit {
+      name = "mingw-python-patches";
+      url = "https://src.fedoraproject.org/rpms/mingw-python3.git";
+      rev = "45c45833ab9e5480ad0ae00778a05ebf35812ed4"; # for python 3.11.5 at the time of writing.
+      sha256 = "sha256-KIyNvO6MlYTrmSy9V/DbzXm5OsIuyT/BEpuo7Umm9DI=";
+    };
+  in [
+    "${mingw-patch}/*.patch"
+  ]);
+
+  postPatch = optionalString (!stdenv.hostPlatform.isWindows) ''
     substituteInPlace Lib/subprocess.py \
       --replace "'/bin/sh'" "'${bash}/bin/sh'"
   '' + optionalString mimetypesSupport ''
     substituteInPlace Lib/mimetypes.py \
       --replace "@mime-types@" "${mailcap}"
-  '' + optionalString (x11Support && (tix != null)) ''
+  '' + optionalString (pythonOlder "3.13" && x11Support && (tix != null)) ''
     substituteInPlace "Lib/tkinter/tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'"
   '';
 
@@ -353,17 +384,19 @@ in with passthru; stdenv.mkDerivation {
     "ac_cv_have_long_long_format=yes"
     "ac_cv_have_size_t_format=yes"
     "ac_cv_computed_gotos=yes"
-    "ac_cv_file__dev_ptmx=yes"
-    "ac_cv_file__dev_ptc=yes"
+    # Both fail when building for windows, normally configure checks this by itself but on other platforms this is set to yes always.
+    "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.
     "ac_cv_func_lchmod=no"
   ] ++ optionals tzdataSupport [
     "--with-tzpath=${tzdata}/share/zoneinfo"
-  ] ++ optional static "LDFLAGS=-static";
+  ] ++ optional static "LDFLAGS=-static"
+  ++ optional (execSuffix != "") "--with-suffix=${execSuffix}";
 
   preConfigure = optionalString (pythonOlder "3.12") ''
     for i in /usr /sw /opt /pkg; do	# improve purity
@@ -372,6 +405,9 @@ in with passthru; stdenv.mkDerivation {
   '' + optionalString stdenv.isDarwin ''
     # Override the auto-detection in setup.py, which assumes a universal build
     export PYTHON_DECIMAL_WITH_MACHINE=${if stdenv.isAarch64 then "uint128" else "x64"}
+  '' + optionalString (stdenv.isDarwin && x11Support && pythonAtLeast "3.11") ''
+    export TCLTK_LIBS="-L${tcl}/lib -L${tk}/lib -l${tcl.libPrefix} -l${tk.libPrefix}"
+    export TCLTK_CFLAGS="-I${tcl}/include -I${tk}/include"
   '' + optionalString (isPy3k && pythonOlder "3.7") ''
     # Determinism: The interpreter is patched to write null timestamps when compiling Python files
     #   so Python doesn't try to update the bytecode when seeing frozen timestamps in Nix's store.
@@ -419,8 +455,6 @@ in with passthru; stdenv.mkDerivation {
     done
     touch $out/lib/${libPrefix}/test/__init__.py
 
-    ln -s "$out/include/${executable}m" "$out/include/${executable}"
-
     # Determinism: Windows installers were not deterministic.
     # We're also not interested in building Windows installers.
     find "$out" -name 'wininst*.exe' | xargs -r rm -f
@@ -428,9 +462,10 @@ in with passthru; stdenv.mkDerivation {
     # Use Python3 as default python
     ln -s "$out/bin/idle3" "$out/bin/idle"
     ln -s "$out/bin/pydoc3" "$out/bin/pydoc"
-    ln -s "$out/bin/python3" "$out/bin/python"
+    ln -s "$out/bin/python3${execSuffix}" "$out/bin/python${execSuffix}"
     ln -s "$out/bin/python3-config" "$out/bin/python-config"
     ln -s "$out/lib/pkgconfig/python3.pc" "$out/lib/pkgconfig/python.pc"
+    ln -sL "$out/share/man/man1/python3.1.gz" "$out/share/man/man1/python.1.gz"
 
     # Get rid of retained dependencies on -dev packages, and remove
     # some $TMPDIR references to improve binary reproducibility.
@@ -447,6 +482,9 @@ in with passthru; stdenv.mkDerivation {
     # This allows build Python to import host Python's sysconfigdata
     mkdir -p "$out/${sitePackages}"
     ln -s "$out/lib/${libPrefix}/"_sysconfigdata*.py "$out/${sitePackages}/"
+    '' + lib.optionalString (pythonOlder "3.8") ''
+    # This is gone in Python >= 3.8
+    ln -s "$out/include/${executable}m" "$out/include/${executable}"
     '' + optionalString stripConfig ''
     rm -R $out/bin/python*-config $out/lib/python*/config-*
     '' + optionalString stripIdlelib ''
@@ -473,9 +511,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 -
     '' + ''
     # *strip* shebang from libpython gdb script - it should be dual-syntax and
     # interpretable by whatever python the gdb in question is using, which may
@@ -483,6 +521,24 @@ in with passthru; stdenv.mkDerivation {
     # bytecode compilations for the same reason - we don't want bytecode generated.
     mkdir -p $out/share/gdb
     sed '/^#!/d' Tools/gdb/libpython.py > $out/share/gdb/libpython.py
+
+    # Disable system-wide pip installation. See https://peps.python.org/pep-0668/.
+    cat <<'EXTERNALLY_MANAGED' > $out/lib/${libPrefix}/EXTERNALLY-MANAGED
+    [externally-managed]
+    Error=This command has been disabled as it tries to modify the immutable
+     `/nix/store` filesystem.
+
+     To use Python with Nix and nixpkgs, have a look at the online documentation:
+     <https://nixos.org/manual/nixpkgs/stable/#python>.
+    EXTERNALLY_MANAGED
+  '' + optionalString stdenv.hostPlatform.isWindows ''
+    # Shebang files that link against the build python. Shebang don’t work on windows
+    rm $out/bin/2to3*
+    rm $out/bin/idle*
+    rm $out/bin/pydoc*
+
+    echo linking DLLs for python’s compiled librairies
+    linkDLLsInfolder $out/lib/python*/lib-dynload/
   '';
 
   preFixup = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
@@ -505,12 +561,33 @@ in with passthru; stdenv.mkDerivation {
     ++ 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;
 
-  inherit passthru;
+  passthru = passthru // {
+    doc = stdenv.mkDerivation {
+      inherit src;
+      name = "python${pythonVersion}-${version}-doc";
+
+      dontConfigure = true;
+
+      dontBuild = true;
+
+      sphinxRoot = "Doc";
+
+      postInstallSphinx = ''
+        mv $out/share/doc/* $out/share/doc/python${pythonVersion}-${version}
+      '';
+
+      nativeBuildInputs = with pkgsBuildBuild.python3.pkgs; [ sphinxHook python-docs-theme ];
+    };
+
+    tests = passthru.tests // {
+      pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
+    };
+  };
 
   enableParallelBuilding = true;
 
@@ -535,7 +612,9 @@ in with passthru; stdenv.mkDerivation {
       high level dynamic data types.
     '';
     license = licenses.psfl;
-    platforms = platforms.linux ++ platforms.darwin;
+    pkgConfigModules = [ "python3" ];
+    platforms = platforms.linux ++ platforms.darwin ++ platforms.windows;
     maintainers = with maintainers; [ fridh ];
+    mainProgram = executable;
   };
-}
+})
diff --git a/pkgs/development/interpreters/python/cpython/loongarch-support.patch b/pkgs/development/interpreters/python/cpython/loongarch-support.patch
new file mode 100644
index 0000000000000..44348c5fe32a1
--- /dev/null
+++ b/pkgs/development/interpreters/python/cpython/loongarch-support.patch
@@ -0,0 +1,50 @@
+diff --git a/configure b/configure
+index 8133d47f61..334c98e208 100755
+--- a/configure
++++ b/configure
+@@ -6215,6 +6215,20 @@ cat > conftest.c <<EOF
+ #  else
+ #   error unknown platform triplet
+ #  endif
++# elif defined(__loongarch__)
++#  if defined(__loongarch_lp64)
++#   if defined(__loongarch_soft_float)
++        loongarch64-linux-gnusf
++#   elif defined(__loongarch_single_float)
++        loongarch64-linux-gnuf32
++#   elif defined(__loongarch_double_float)
++        loongarch64-linux-gnu
++#   else
++#     error unknown platform triplet
++#   endif 
++#  else
++#    error unknown platform triplet
++#  endif
+ # else
+ #   error unknown platform triplet
+ # endif
+diff --git a/configure.ac b/configure.ac
+index 3f20d8980d..acde94a181 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -959,6 +959,20 @@ cat > conftest.c <<EOF
+         hppa-linux-gnu
+ # elif defined(__ia64__)
+         ia64-linux-gnu
++# elif defined(__loongarch__)
++#  if defined(__loongarch_lp64)
++#   if defined(__loongarch_soft_float)
++        loongarch64-linux-gnusf
++#   elif defined(__loongarch_single_float)
++        loongarch64-linux-gnuf32
++#   elif defined(__loongarch_double_float)
++        loongarch64-linux-gnu
++#   else
++#    error unknown platform triplet
++#   endif
++#  else
++#   error unknown platform triplet
++#  endif
+ # elif defined(__m68k__) && !defined(__mcoldfire__)
+         m68k-linux-gnu
+ # elif defined(__mips_hard_float) && defined(__mips_isa_rev) && (__mips_isa_rev >=6) && defined(_MIPSEL)
diff --git a/pkgs/development/interpreters/python/cpython/platform-triplet-detection.patch b/pkgs/development/interpreters/python/cpython/platform-triplet-detection.patch
new file mode 100644
index 0000000000000..ec76546f54ee8
--- /dev/null
+++ b/pkgs/development/interpreters/python/cpython/platform-triplet-detection.patch
@@ -0,0 +1,295 @@
+diff --git a/configure.ac b/configure.ac
+index ba768aea93..621ac166bd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -936,125 +936,192 @@ cat > conftest.c <<EOF
+ #if defined(__ANDROID__)
+     # Android is not a multiarch system.
+ #elif defined(__linux__)
++# include <features.h>
++# if defined(__UCLIBC__)
++#  error uclibc not supported
++# elif defined(__dietlibc__)
++#  error dietlibc not supported
++# elif defined(__GLIBC__)
++#  define LIBC gnu
++#  define LIBC_X32 gnux32
++#  if defined(__ARM_PCS_VFP)
++#   define LIBC_ARM gnueabihf
++#  else
++#   define LIBC_ARM gnueabi
++#  endif
++#  if defined(__loongarch__)
++#   if defined(__loongarch_soft_float)
++#    define LIBC_LA gnusf
++#   elif defined(__loongarch_single_float)
++#    define LIBC_LA gnuf32
++#   elif defined(__loongarch_double_float)
++#    define LIBC_LA gnu
++#   else
++#    error unknown loongarch floating-point base abi
++#   endif
++#  endif
++#  if defined(_MIPS_SIM)
++#   if defined(__mips_hard_float)
++#    if _MIPS_SIM == _ABIO32
++#     define LIBC_MIPS gnu
++#    elif _MIPS_SIM == _ABIN32
++#     define LIBC_MIPS gnuabin32
++#    elif _MIPS_SIM == _ABI64
++#     define LIBC_MIPS gnuabi64
++#    else
++#     error unknown mips sim value
++#    endif
++#   else
++#    if _MIPS_SIM == _ABIO32
++#     define LIBC_MIPS gnusf
++#    elif _MIPS_SIM == _ABIN32
++#     define LIBC_MIPS gnuabin32sf
++#    elif _MIPS_SIM == _ABI64
++#     define LIBC_MIPS gnuabi64sf
++#    else
++#     error unknown mips sim value
++#    endif
++#   endif
++#  endif
++#  if defined(__SPE__)
++#   define LIBC_PPC gnuspe
++#  else
++#   define LIBC_PPC gnu
++#  endif
++# else
++#  include <stdarg.h>
++#  ifdef __DEFINED_va_list
++#   define LIBC musl
++#   define LIBC_X32 muslx32
++#   if defined(__ARM_PCS_VFP)
++#    define LIBC_ARM musleabihf
++#   else
++#    define LIBC_ARM musleabi
++#   endif
++#   if defined(__loongarch__)
++#    if defined(__loongarch_soft_float)
++#     define LIBC_LA muslsf
++#    elif defined(__loongarch_single_float)
++#     define LIBC_LA muslf32
++#    elif defined(__loongarch_double_float)
++#     define LIBC_LA musl
++#    else
++#     error unknown loongarch floating-point base abi
++#    endif
++#   endif
++#   if defined(_MIPS_SIM)
++#    if defined(__mips_hard_float)
++#     if _MIPS_SIM == _ABIO32
++#      define LIBC_MIPS musl
++#     elif _MIPS_SIM == _ABIN32
++#      define LIBC_MIPS musln32
++#     elif _MIPS_SIM == _ABI64
++#      define LIBC_MIPS musl
++#     else
++#      error unknown mips sim value
++#     endif
++#    else
++#     if _MIPS_SIM == _ABIO32
++#      define LIBC_MIPS muslsf
++#     elif _MIPS_SIM == _ABIN32
++#      define LIBC_MIPS musln32sf
++#     elif _MIPS_SIM == _ABI64
++#      define LIBC_MIPS muslsf
++#     else
++#      error unknown mips sim value
++#     endif
++#    endif
++#   endif
++#   if defined(_SOFT_FLOAT) || defined(__NO_FPRS__)
++#    define LIBC_PPC muslsf
++#   else
++#    define LIBC_PPC musl
++#   endif
++#  else
++#   error unknown libc
++#  endif
++# endif
+ # if defined(__x86_64__) && defined(__LP64__)
+-        x86_64-linux-gnu
++        x86_64-linux-LIBC
+ # elif defined(__x86_64__) && defined(__ILP32__)
+-        x86_64-linux-gnux32
++        x86_64-linux-LIBC_X32
+ # elif defined(__i386__)
+-        i386-linux-gnu
++        i386-linux-LIBC
+ # elif defined(__aarch64__) && defined(__AARCH64EL__)
+ #  if defined(__ILP32__)
+-        aarch64_ilp32-linux-gnu
++        aarch64_ilp32-linux-LIBC
+ #  else
+-        aarch64-linux-gnu
++        aarch64-linux-LIBC
+ #  endif
+ # elif defined(__aarch64__) && defined(__AARCH64EB__)
+ #  if defined(__ILP32__)
+-        aarch64_be_ilp32-linux-gnu
++        aarch64_be_ilp32-linux-LIBC
+ #  else
+-        aarch64_be-linux-gnu
++        aarch64_be-linux-LIBC
+ #  endif
+ # elif defined(__alpha__)
+-        alpha-linux-gnu
+-# elif defined(__ARM_EABI__) && defined(__ARM_PCS_VFP)
++        alpha-linux-LIBC
++# elif defined(__ARM_EABI__)
+ #  if defined(__ARMEL__)
+-        arm-linux-gnueabihf
++        arm-linux-LIBC_ARM
+ #  else
+-        armeb-linux-gnueabihf
+-#  endif
+-# elif defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP)
+-#  if defined(__ARMEL__)
+-        arm-linux-gnueabi
+-#  else
+-        armeb-linux-gnueabi
++        armeb-linux-LIBC_ARM
+ #  endif
+ # elif defined(__hppa__)
+-        hppa-linux-gnu
++        hppa-linux-LIBC
+ # elif defined(__ia64__)
+-        ia64-linux-gnu
+-# elif defined(__loongarch__)
+-#  if defined(__loongarch_lp64)
+-#   if defined(__loongarch_soft_float)
+-        loongarch64-linux-gnusf
+-#   elif defined(__loongarch_single_float)
+-        loongarch64-linux-gnuf32
+-#   elif defined(__loongarch_double_float)
+-        loongarch64-linux-gnu
++        ia64-linux-LIBC
++# elif defined(__loongarch__) && defined(__loongarch_lp64)
++        loongarch64-linux-LIBC_LA
++# elif defined(__m68k__) && !defined(__mcoldfire__)
++        m68k-linux-LIBC
++# elif defined(__mips__)
++#  if defined(__mips_isa_rev) && (__mips_isa_rev >=6)
++#   if defined(_MIPSEL) && defined(__mips64)
++        mipsisa64r6el-linux-LIBC_MIPS
++#   elif defined(_MIPSEL)
++        mipsisa32r6el-linux-LIBC_MIPS
++#   elif defined(__mips64)
++        mipsisa64r6-linux-LIBC_MIPS
+ #   else
+-#    error unknown platform triplet
++        mipsisa32r6-linux-LIBC_MIPS
+ #   endif
+ #  else
+-#   error unknown platform triplet
+-#  endif
+-# elif defined(__m68k__) && !defined(__mcoldfire__)
+-        m68k-linux-gnu
+-# elif defined(__mips_hard_float) && defined(__mips_isa_rev) && (__mips_isa_rev >=6) && defined(_MIPSEL)
+-#  if _MIPS_SIM == _ABIO32
+-        mipsisa32r6el-linux-gnu
+-#  elif _MIPS_SIM == _ABIN32
+-        mipsisa64r6el-linux-gnuabin32
+-#  elif _MIPS_SIM == _ABI64
+-        mipsisa64r6el-linux-gnuabi64
+-#  else
+-#   error unknown platform triplet
+-#  endif
+-# elif defined(__mips_hard_float) && defined(__mips_isa_rev) && (__mips_isa_rev >=6)
+-#  if _MIPS_SIM == _ABIO32
+-        mipsisa32r6-linux-gnu
+-#  elif _MIPS_SIM == _ABIN32
+-        mipsisa64r6-linux-gnuabin32
+-#  elif _MIPS_SIM == _ABI64
+-        mipsisa64r6-linux-gnuabi64
+-#  else
+-#   error unknown platform triplet
+-#  endif
+-# elif defined(__mips_hard_float) && defined(_MIPSEL)
+-#  if _MIPS_SIM == _ABIO32
+-        mipsel-linux-gnu
+-#  elif _MIPS_SIM == _ABIN32
+-        mips64el-linux-gnuabin32
+-#  elif _MIPS_SIM == _ABI64
+-        mips64el-linux-gnuabi64
+-#  else
+-#   error unknown platform triplet
+-#  endif
+-# elif defined(__mips_hard_float)
+-#  if _MIPS_SIM == _ABIO32
+-        mips-linux-gnu
+-#  elif _MIPS_SIM == _ABIN32
+-        mips64-linux-gnuabin32
+-#  elif _MIPS_SIM == _ABI64
+-        mips64-linux-gnuabi64
+-#  else
+-#   error unknown platform triplet
++#   if defined(_MIPSEL) && defined(__mips64)
++        mips64el-linux-LIBC_MIPS
++#   elif defined(_MIPSEL)
++        mipsel-linux-LIBC_MIPS
++#   elif defined(__mips64)
++        mips64-linux-LIBC_MIPS
++#   else
++        mips-linux-LIBC_MIPS
++#   endif
+ #  endif
+ # elif defined(__or1k__)
+-        or1k-linux-gnu
+-# elif defined(__powerpc__) && defined(__SPE__)
+-        powerpc-linux-gnuspe
++        or1k-linux-LIBC
+ # elif defined(__powerpc64__)
+ #  if defined(__LITTLE_ENDIAN__)
+-        powerpc64le-linux-gnu
++        powerpc64le-linux-LIBC
+ #  else
+-        powerpc64-linux-gnu
++        powerpc64-linux-LIBC
+ #  endif
+ # elif defined(__powerpc__)
+-        powerpc-linux-gnu
++        powerpc-linux-LIBC_PPC
+ # elif defined(__s390x__)
+-        s390x-linux-gnu
++        s390x-linux-LIBC
+ # elif defined(__s390__)
+-        s390-linux-gnu
++        s390-linux-LIBC
+ # elif defined(__sh__) && defined(__LITTLE_ENDIAN__)
+-        sh4-linux-gnu
++        sh4-linux-LIBC
+ # elif defined(__sparc__) && defined(__arch64__)
+-        sparc64-linux-gnu
++        sparc64-linux-LIBC
+ # elif defined(__sparc__)
+-        sparc-linux-gnu
++        sparc-linux-LIBC
+ # elif defined(__riscv)
+ #  if __riscv_xlen == 32
+-        riscv32-linux-gnu
++        riscv32-linux-LIBC
+ #  elif __riscv_xlen == 64
+-        riscv64-linux-gnu
++        riscv64-linux-LIBC
+ #  else
+ #   error unknown platform triplet
+ #  endif
+@@ -1102,12 +1169,7 @@ cat > conftest.c <<EOF
+ EOF
+ 
+ if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
+-  PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' 	'`
+-  case "$build_os" in
+-  linux-musl*)
+-    PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'`
+-    ;;
+-  esac
++  PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | grep -v typedef | tr -d ' 	'`
+   AC_MSG_RESULT([$PLATFORM_TRIPLET])
+ else
+   AC_MSG_RESULT([none])
diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix
index 70fd5c240df49..e4556d95f0fdd 100644
--- a/pkgs/development/interpreters/python/default.nix
+++ b/pkgs/development/interpreters/python/default.nix
@@ -5,136 +5,35 @@
 , db
 , lib
 , libffiBoot
-, makeScopeWithSplicing
+, makeScopeWithSplicing'
 , pythonPackagesExtensions
 , stdenv
-}:
+}@args:
 
 (let
 
   # Common passthru for all Python interpreters.
-  passthruFun =
-    { implementation
-    , libPrefix
-    , executable
-    , sourceVersion
-    , pythonVersion
-    , packageOverrides
-    , sitePackages
-    , hasDistutilsCxxPatch
-    , pythonOnBuildForBuild
-    , pythonOnBuildForHost
-    , pythonOnBuildForTarget
-    , pythonOnHostForHost
-    , pythonOnTargetForTarget
-    , pythonAttr ? null
-    , self # is pythonOnHostForTarget
-    }: let
-      pythonPackages = let
-        ensurePythonModules = items: let
-          exceptions = [
-            stdenv
-          ];
-          providesSetupHook = lib.attrByPath [ "provides" "setupHook"] false;
-          valid = value: pythonPackages.hasPythonModule value || providesSetupHook value || lib.elem value exceptions;
-          func = name: value:
-            if lib.isDerivation value then
-              lib.extendDerivation (valid value || throw "${name} should use `buildPythonPackage` or `toPythonModule` if it is to be part of the Python packages set.") {} value
-            else
-              value;
-        in lib.mapAttrs func items;
-      in ensurePythonModules (callPackage
-        # Function that when called
-        # - imports python-packages.nix
-        # - adds spliced package sets to the package set
-        # - applies overrides from `packageOverrides` and `pythonPackagesOverlays`.
-        ({ pkgs, stdenv, python, overrides }: let
-          pythonPackagesFun = import ./python-packages-base.nix {
-            inherit stdenv pkgs lib;
-            python = self;
-          };
-          otherSplices = {
-            selfBuildBuild = pythonOnBuildForBuild.pkgs;
-            selfBuildHost = pythonOnBuildForHost.pkgs;
-            selfBuildTarget = pythonOnBuildForTarget.pkgs;
-            selfHostHost = pythonOnHostForHost.pkgs;
-            selfTargetTarget = pythonOnTargetForTarget.pkgs or {}; # There is no Python TargetTarget.
-          };
-          hooks = import ./hooks/default.nix;
-          keep = lib.extends hooks pythonPackagesFun;
-          extra = _: {};
-          optionalExtensions = cond: as: lib.optionals cond as;
-          pythonExtension = import ../../../top-level/python-packages.nix;
-          python2Extension = import ../../../top-level/python2-packages.nix;
-          extensions = lib.composeManyExtensions ([
-            pythonExtension
-          ] ++ (optionalExtensions (!self.isPy3k) [
-            python2Extension
-          ]) ++ pythonPackagesExtensions ++ [
-            overrides
-          ]);
-          aliases = self: super: lib.optionalAttrs config.allowAliases (import ../../../top-level/python-aliases.nix lib self super);
-        in makeScopeWithSplicing
-          otherSplices
-          keep
-          extra
-          (lib.extends (lib.composeExtensions aliases extensions) keep))
-        {
-          overrides = packageOverrides;
-          python = self;
-        });
-    in rec {
-        isPy27 = pythonVersion == "2.7";
-        isPy37 = pythonVersion == "3.7";
-        isPy38 = pythonVersion == "3.8";
-        isPy39 = pythonVersion == "3.9";
-        isPy310 = pythonVersion == "3.10";
-        isPy311 = pythonVersion == "3.11";
-        isPy312 = pythonVersion == "3.12";
-        isPy2 = lib.strings.substring 0 1 pythonVersion == "2";
-        isPy3 = lib.strings.substring 0 1 pythonVersion == "3";
-        isPy3k = isPy3;
-        isPyPy = lib.hasInfix "pypy" interpreter;
-
-        buildEnv = callPackage ./wrapper.nix { python = self; inherit (pythonPackages) requiredPythonModules; };
-        withPackages = import ./with-packages.nix { inherit buildEnv pythonPackages;};
-        pkgs = pythonPackages;
-        interpreter = "${self}/bin/${executable}";
-        inherit executable implementation libPrefix pythonVersion sitePackages;
-        inherit sourceVersion;
-        pythonAtLeast = lib.versionAtLeast pythonVersion;
-        pythonOlder = lib.versionOlder pythonVersion;
-        inherit hasDistutilsCxxPatch;
-        # TODO: rename to pythonOnBuild
-        # Not done immediately because its likely used outside Nixpkgs.
-        pythonForBuild = pythonOnBuildForHost.override { inherit packageOverrides; self = pythonForBuild; };
-
-        tests = callPackage ./tests.nix {
-          python = self;
-        };
-
-        inherit pythonAttr;
-  };
+  passthruFun = import ./passthrufun.nix args;
 
   sources = {
     python310 = {
       sourceVersion = {
         major = "3";
         minor = "10";
-        patch = "10";
+        patch = "13";
         suffix = "";
       };
-      hash = "sha256-BBnpCFv1G3pnIAmz9Q2/GFms3xi6cl0OwZqlyFA/DqM=";
+      hash = "sha256-XIiEhmhkDT4VKzW0U27xwjsspL0slX7x7LsFP1cd0/Y=";
     };
 
     python311 = {
       sourceVersion = {
         major = "3";
         minor = "11";
-        patch = "2";
+        patch = "6";
         suffix = "";
       };
-      hash = "sha256-KeS49fFlhUKowT4t0nc1jJxI8rL3MYZS7xZ15AK50q8=";
+      hash = "sha256-D6t4+n8TP084IQxiYNkNfA1ccZhEZBnOBX7HrC5vXzg=";
     };
   };
 
@@ -146,9 +45,9 @@ in {
       major = "2";
       minor = "7";
       patch = "18";
-      suffix = ".6"; # ActiveState's Python 2 extended support
+      suffix = ".7"; # ActiveState's Python 2 extended support
     };
-    hash = "sha256-+I0QOBkuTHMIQz71lgNn1X1vjPsjJMtFbgC0xcGTwWY=";
+    hash = "sha256-zcjAoSq6491ePiDySBCKrLIyYoO/5fdH6aBTNg/NH8s=";
     inherit (darwin) configd;
     inherit passthruFun;
   };
@@ -158,10 +57,10 @@ in {
     sourceVersion = {
       major = "3";
       minor = "8";
-      patch = "16";
+      patch = "18";
       suffix = "";
     };
-    hash = "sha256-2F27N3QTJHPYCB3LFY80oQzK16kLlsflDqS7YfXORWI=";
+    hash = "sha256-P/txzTSaMmunsvrcfn34a6V33ZxJF+UqhAGtvadAXj8=";
     inherit (darwin) configd;
     inherit passthruFun;
   };
@@ -171,10 +70,10 @@ in {
     sourceVersion = {
       major = "3";
       minor = "9";
-      patch = "16";
+      patch = "18";
       suffix = "";
     };
-    hash = "sha256-It3cCZJG3SdgZlVh6K23OU6gzEOnJoTGSA+TgPd4ZDk=";
+    hash = "sha256-AVl9sBMsHPezMe/2iuCbWiNaPDyqnJRMKcrH0cTEwAo=";
     inherit (darwin) configd;
     inherit passthruFun;
   };
@@ -196,14 +95,26 @@ in {
     sourceVersion = {
       major = "3";
       minor = "12";
-      patch = "0";
-      suffix = "a6";
+      patch = "1";
+      suffix = "";
     };
-    hash = "sha256-KYRAJSxLa04SDgFMFdcp6vird5MA3Mph1CLFN+ToXso=";
+    hash = "sha256-jfuPQm/NImZX+eK9Xx6W5TJkllF2+hfTJljoc1ka6yE=";
     inherit (darwin) configd;
     inherit passthruFun;
   };
 
+  python313 = callPackage ./cpython {
+    self = __splicedPackages.python313;
+    sourceVersion = {
+      major = "3";
+      minor = "13";
+      patch = "0";
+      suffix = "a2";
+    };
+    hash = "sha256-ttRrRBkMTAJCHraaBC0WsMVUgb3agYxsQW3CRBE6nC0=";
+    inherit (darwin) configd;
+    inherit passthruFun;
+  };
   # Minimal versions of Python (built without optional dependencies)
   python3Minimal = (callPackage ./cpython ({
     self = __splicedPackages.python3Minimal;
@@ -228,7 +139,7 @@ in {
     enableOptimizations = false;
     enableLTO = false;
     mimetypesSupport = false;
-  } // sources.python310)).overrideAttrs(old: {
+  } // sources.python311)).overrideAttrs(old: {
     # TODO(@Artturin): Add this to the main cpython expr
     strictDeps = true;
     pname = "python3-minimal";
@@ -239,10 +150,10 @@ in {
     sourceVersion = {
       major = "7";
       minor = "3";
-      patch = "11";
+      patch = "12";
     };
 
-    hash = "sha256-ERevtmgx2k6m852NIIR4enRon9AineC+MB+e2bJVCTw=";
+    hash = "sha256-3WHYjaJ0ws4s7HdmfUo9+aZSvMUOJvkJkdTdCvZrzPQ=";
     pythonVersion = "2.7";
     db = db.override { dbmSupport = !stdenv.isDarwin; };
     python = __splicedPackages.pythonInterpreters.pypy27_prebuilt;
@@ -256,10 +167,10 @@ in {
     sourceVersion = {
       major = "7";
       minor = "3";
-      patch = "11";
+      patch = "12";
     };
 
-    hash = "sha256-sPMWb7Klqt/VzrnbXN1feSmg7MygK0omwNrgSS98qOo=";
+    hash = "sha256-56IEbH5sJfw4aru1Ey6Sp8wkkeOTVpmpRstdy7NCwqo=";
     pythonVersion = "3.9";
     db = db.override { dbmSupport = !stdenv.isDarwin; };
     python = __splicedPackages.pypy27;
@@ -268,28 +179,26 @@ in {
     inherit (darwin.apple_sdk.frameworks) Security;
   };
 
-  pypy38 = __splicedPackages.pypy39.override {
-    self = __splicedPackages.pythonInterpreters.pypy38;
-    pythonVersion = "3.8";
-    hash = "sha256-TWdpv8pzc06GZv1wUDt86wam4lkRDmFzMbs4mcpOYFg=";
+  pypy310 = __splicedPackages.pypy39.override {
+    self = __splicedPackages.pythonInterpreters.pypy310;
+    pythonVersion = "3.10";
+    hash = "sha256-huTk6sw2BGxhgvQwGHllN/4zpg4dKizGuOf5Gl3LPkI=";
   };
 
-  pypy37 = throw "pypy37 has been removed from nixpkgs since it is no longer supported upstream"; # Added 2023-01-04
-
   pypy27_prebuilt = callPackage ./pypy/prebuilt_2_7.nix {
     # Not included at top-level
     self = __splicedPackages.pythonInterpreters.pypy27_prebuilt;
     sourceVersion = {
       major = "7";
       minor = "3";
-      patch = "11";
+      patch = "12";
     };
 
     hash = {
-      aarch64-linux = "sha256-6pJNod7+kyXvdg4oiwT5hGFOQFWA9TIetqXI9Tm9QVo=";
-      x86_64-linux = "sha256-uo7ZWKkFwHNaTP/yh1wlCJlU3AIOCH2YKw/6W52jFs0=";
-      aarch64-darwin = "sha256-zFaWq0+TzTSBweSZC13t17pgrAYC+hiQ02iImmxb93E=";
-      x86_64-darwin = "sha256-Vt7unCJkD1aGw1udZP2xzjq9BEWD5AePCxccov0qGY4=";
+      aarch64-linux = "sha256-4E3LYoantHJOw/DlDTzBuoWDMB3RZYwG1/N1meQgHFk=";
+      x86_64-linux = "sha256-GmGiV0t5Rm9gYBDymZormVvZbNCF+Rp46909XCxA6B0=";
+      aarch64-darwin = "sha256-a3R6oHauhZfklgPF3sTKWTWhoKEy10BKVZvpaiYNm/c=";
+      x86_64-darwin = "sha256-bon/3RVTfOT/zjFFtl7lfC6clSiSvZW5NAEtLwCfUDs=";
     }.${stdenv.system};
     pythonVersion = "2.7";
     inherit passthruFun;
@@ -301,13 +210,13 @@ in {
     sourceVersion = {
       major = "7";
       minor = "3";
-      patch = "11";
+      patch = "12";
     };
     hash = {
-      aarch64-linux = "sha256-CRddxlLtiV2Y6a1j0haBK/PufjmNkAqb+espBrqDArk=";
-      x86_64-linux = "sha256-1QYXLKEQcSdBdddOnFgcMWZDLQF5sDZHDjuejSDq5YE=";
-      aarch64-darwin = "sha256-ka11APGjlTHb76CzRaPc/5J/+ZcWVOjS6e98WuMR9X4=";
-      x86_64-darwin = "sha256-0z9AsgcJmHJYWv1xhzV1ym6mOKJ9gjvGISOMWuglQu0=";
+      aarch64-linux = "sha256-6TJ/ue2vKtkZNdW4Vj7F/yQZO92xdcGsqvdywCWvGCQ=";
+      x86_64-linux = "sha256-hMiblm+rK1j0UaSC7jDKf+wzUENb0LlhRhXGHcbaI5A=";
+      aarch64-darwin = "sha256-DooaNGi5eQxzSsaY9bAMwD/BaJnMxs6HZGX6wLg5gOM=";
+      x86_64-darwin = "sha256-ZPAI/6BwxAfl70bIJWsuAU3nGW6l2Fg4WGElTnlZ9Os=";
     }.${stdenv.system};
     pythonVersion = "3.9";
     inherit passthruFun;
diff --git a/pkgs/development/interpreters/python/hooks/default.nix b/pkgs/development/interpreters/python/hooks/default.nix
index 001e477b9185b..35116b38f8104 100644
--- a/pkgs/development/interpreters/python/hooks/default.nix
+++ b/pkgs/development/interpreters/python/hooks/default.nix
@@ -1,9 +1,10 @@
-self: super: with self;
+self: dontUse: with self;
 
 let
-  pythonInterpreter = super.python.pythonForBuild.interpreter;
-  pythonSitePackages = super.python.sitePackages;
-  pythonCheckInterpreter = super.python.interpreter;
+  inherit (python) pythonOnBuildForHost;
+  pythonInterpreter = pythonOnBuildForHost.interpreter;
+  pythonSitePackages = python.sitePackages;
+  pythonCheckInterpreter = python.interpreter;
   setuppy = ../run_setup.py;
 in {
   makePythonHook = args: pkgs.makeSetupHook ({passthru.provides.setupHook = true; } // args);
@@ -44,15 +45,6 @@ in {
       propagatedBuildInputs = [ ];
     } ./egg-unpack-hook.sh) {};
 
-  flitBuildHook = callPackage ({ makePythonHook, flit }:
-    makePythonHook {
-      name = "flit-build-hook";
-      propagatedBuildInputs = [ flit ];
-      substitutions = {
-        inherit pythonInterpreter;
-      };
-    } ./flit-build-hook.sh) {};
-
   pipBuildHook = callPackage ({ makePythonHook, pip, wheel }:
     makePythonHook {
       name = "pip-build-hook.sh";
@@ -62,6 +54,26 @@ in {
       };
     } ./pip-build-hook.sh) {};
 
+  pypaBuildHook = callPackage ({ makePythonHook, build, wheel }:
+    makePythonHook {
+      name = "pypa-build-hook.sh";
+      propagatedBuildInputs = [ wheel ];
+      substitutions = {
+        inherit build;
+      };
+      # A test to ensure that this hook never propagates any of its dependencies
+      #   into the build environment.
+      # This prevents false positive alerts raised by catchConflictsHook.
+      # Such conflicts don't happen within the standard nixpkgs python package
+      #   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 pythonOnBuildForHost runCommand;
+      };
+    } ./pypa-build-hook.sh) {
+      inherit (pythonOnBuildForHost.pkgs) build;
+    };
+
   pipInstallHook = callPackage ({ makePythonHook, pip }:
     makePythonHook {
       name = "pip-install-hook";
@@ -71,6 +83,17 @@ in {
       };
     } ./pip-install-hook.sh) {};
 
+  pypaInstallHook = callPackage ({ makePythonHook, installer }:
+    makePythonHook {
+      name = "pypa-install-hook";
+      propagatedBuildInputs = [ installer ];
+      substitutions = {
+        inherit pythonInterpreter pythonSitePackages;
+      };
+    } ./pypa-install-hook.sh) {
+      inherit (pythonOnBuildForHost.pkgs) installer;
+    };
+
   pytestCheckHook = callPackage ({ makePythonHook, pytest }:
     makePythonHook {
       name = "pytest-check-hook";
@@ -83,9 +106,16 @@ in {
   pythonCatchConflictsHook = callPackage ({ makePythonHook, setuptools }:
     makePythonHook {
       name = "python-catch-conflicts-hook";
-      substitutions = {
-        inherit pythonInterpreter pythonSitePackages setuptools;
-        catchConflicts=../catch_conflicts/catch_conflicts.py;
+      substitutions = let
+        useLegacyHook = lib.versionOlder python.pythonVersion "3.10";
+      in {
+        inherit pythonInterpreter pythonSitePackages;
+        catchConflicts = if useLegacyHook then
+          ../catch_conflicts/catch_conflicts_py2.py
+        else
+          ../catch_conflicts/catch_conflicts.py;
+      } // lib.optionalAttrs useLegacyHook {
+        inherit setuptools;
       };
     } ./python-catch-conflicts-hook.sh) {};
 
@@ -97,11 +127,12 @@ in {
       };
     } ./python-imports-check-hook.sh) {};
 
-  pythonNamespacesHook = callPackage ({ makePythonHook, findutils }:
+  pythonNamespacesHook = callPackage ({ makePythonHook, buildPackages }:
     makePythonHook {
       name = "python-namespaces-hook.sh";
       substitutions = {
-        inherit pythonSitePackages findutils;
+        inherit pythonSitePackages;
+        inherit (buildPackages) findutils;
       };
     } ./python-namespaces-hook.sh) {};
 
@@ -123,9 +154,8 @@ in {
   pythonRelaxDepsHook = callPackage ({ makePythonHook, wheel }:
     makePythonHook {
       name = "python-relax-deps-hook";
-      propagatedBuildInputs = [ wheel ];
       substitutions = {
-        inherit pythonInterpreter;
+        inherit pythonInterpreter pythonSitePackages wheel;
       };
     } ./python-relax-deps-hook.sh) {};
 
@@ -160,6 +190,18 @@ in {
       };
     } ./setuptools-check-hook.sh) {};
 
+    setuptoolsRustBuildHook = callPackage ({ makePythonHook, setuptools-rust }:
+      makePythonHook {
+        name = "setuptools-rust-setup-hook";
+        propagatedBuildInputs = [ setuptools-rust ];
+        substitutions = {
+          pyLibDir = "${python}/lib/${python.libPrefix}";
+          cargoBuildTarget = stdenv.hostPlatform.rust.rustcTargetSpec;
+          cargoLinkerVar = stdenv.hostPlatform.rust.cargoEnvVarTarget;
+          targetLinker = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
+        };
+      } ./setuptools-rust-hook.sh) {};
+
   unittestCheckHook = callPackage ({ makePythonHook }:
     makePythonHook {
       name = "unittest-check-hook";
@@ -187,9 +229,12 @@ in {
     inherit (pkgs.buildPackages) makeWrapper;
   };
 
-  sphinxHook = callPackage ({ makePythonHook, sphinx, installShellFiles }:
+  sphinxHook = callPackage ({ makePythonHook, installShellFiles }:
     makePythonHook {
       name = "python${python.pythonVersion}-sphinx-hook";
-      propagatedBuildInputs = [ sphinx installShellFiles ];
+      propagatedBuildInputs = [ pythonOnBuildForHost.pkgs.sphinx installShellFiles ];
+      substitutions = {
+        sphinxBuild = "${pythonOnBuildForHost.pkgs.sphinx}/bin/sphinx-build";
+      };
     } ./sphinx-hook.sh) {};
 }
diff --git a/pkgs/development/interpreters/python/hooks/flit-build-hook.sh b/pkgs/development/interpreters/python/hooks/flit-build-hook.sh
deleted file mode 100644
index 45893aae00f4e..0000000000000
--- a/pkgs/development/interpreters/python/hooks/flit-build-hook.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-# Setup hook for flit
-echo "Sourcing flit-build-hook"
-
-flitBuildPhase () {
-    echo "Executing flitBuildPhase"
-    runHook preBuild
-    @pythonInterpreter@ -m flit build --format wheel
-    runHook postBuild
-    echo "Finished executing flitBuildPhase"
-}
-
-if [ -z "${dontUseFlitBuild-}" ] && [ -z "${buildPhase-}" ]; then
-    echo "Using flitBuildPhase"
-    buildPhase=flitBuildPhase
-fi
diff --git a/pkgs/development/interpreters/python/hooks/pip-build-hook.sh b/pkgs/development/interpreters/python/hooks/pip-build-hook.sh
index 745f02e8c9bc3..9de4c7d1dd0dd 100644
--- a/pkgs/development/interpreters/python/hooks/pip-build-hook.sh
+++ b/pkgs/development/interpreters/python/hooks/pip-build-hook.sh
@@ -1,13 +1,22 @@
 # Setup hook to use for pip projects
 echo "Sourcing pip-build-hook"
 
+declare -a pipBuildFlags
+
 pipBuildPhase() {
     echo "Executing pipBuildPhase"
     runHook preBuild
 
     mkdir -p dist
     echo "Creating a wheel..."
-    @pythonInterpreter@ -m pip wheel --verbose --no-index --no-deps --no-clean --no-build-isolation --wheel-dir dist .
+    @pythonInterpreter@ -m pip wheel \
+       --verbose \
+       --no-index \
+       --no-deps \
+       --no-clean \
+       --no-build-isolation \
+       --wheel-dir dist \
+       $pipBuildFlags .
     echo "Finished creating a wheel..."
 
     runHook postBuild
diff --git a/pkgs/development/interpreters/python/hooks/pypa-build-hook-test.nix b/pkgs/development/interpreters/python/hooks/pypa-build-hook-test.nix
new file mode 100644
index 0000000000000..4153c21ca4f97
--- /dev/null
+++ b/pkgs/development/interpreters/python/hooks/pypa-build-hook-test.nix
@@ -0,0 +1,32 @@
+{ pythonOnBuildForHost, runCommand }: {
+  dont-propagate-conflicting-deps = let
+    # customize a package so that its store paths differs
+    mkConflict = pkg: pkg.overrideAttrs { some_modification = true; };
+    # minimal pyproject.toml for the example project
+    pyprojectToml = builtins.toFile "pyproject.toml" ''
+      [project]
+      name = "my-project"
+      version = "1.0.0"
+    '';
+    # the source of the example project
+    projectSource = runCommand "my-project-source" {} ''
+      mkdir -p $out/src
+      cp ${pyprojectToml} $out/pyproject.toml
+      touch $out/src/__init__.py
+    '';
+    in
+    # this build must never triger conflicts
+    pythonOnBuildForHost.pkgs.buildPythonPackage {
+      pname = "dont-propagate-conflicting-deps";
+      version = "0.0.0";
+      src = projectSource;
+      format = "pyproject";
+      propagatedBuildInputs = [
+        # At least one dependency of `build` should be included here to
+        # keep the test meaningful
+        (mkConflict pythonOnBuildForHost.pkgs.tomli)
+        # setuptools is also needed to build the example project
+        pythonOnBuildForHost.pkgs.setuptools
+      ];
+    };
+}
diff --git a/pkgs/development/interpreters/python/hooks/pypa-build-hook.sh b/pkgs/development/interpreters/python/hooks/pypa-build-hook.sh
new file mode 100644
index 0000000000000..dd49d935bcee7
--- /dev/null
+++ b/pkgs/development/interpreters/python/hooks/pypa-build-hook.sh
@@ -0,0 +1,19 @@
+# Setup hook to use for pypa/build projects
+echo "Sourcing pypa-build-hook"
+
+pypaBuildPhase() {
+    echo "Executing pypaBuildPhase"
+    runHook preBuild
+
+    echo "Creating a wheel..."
+    @build@/bin/pyproject-build --no-isolation --outdir dist/ --wheel $pypaBuildFlags
+    echo "Finished creating a wheel..."
+
+    runHook postBuild
+    echo "Finished executing pypaBuildPhase"
+}
+
+if [ -z "${dontUsePypaBuild-}" ] && [ -z "${buildPhase-}" ]; then
+    echo "Using pypaBuildPhase"
+    buildPhase=pypaBuildPhase
+fi
diff --git a/pkgs/development/interpreters/python/hooks/pypa-install-hook.sh b/pkgs/development/interpreters/python/hooks/pypa-install-hook.sh
new file mode 100644
index 0000000000000..2d925742daa73
--- /dev/null
+++ b/pkgs/development/interpreters/python/hooks/pypa-install-hook.sh
@@ -0,0 +1,26 @@
+# Setup hook for PyPA installer.
+echo "Sourcing pypa-install-hook"
+
+pypaInstallPhase() {
+    echo "Executing pypaInstallPhase"
+    runHook preInstall
+
+    pushd dist > /dev/null
+
+    for wheel in *.whl; do
+        @pythonInterpreter@ -m installer --prefix "$out" "$wheel"
+        echo "Successfully installed $wheel"
+    done
+
+    popd > /dev/null
+
+    export PYTHONPATH="$out/@pythonSitePackages@:$PYTHONPATH"
+
+    runHook postInstall
+    echo "Finished executing pypaInstallPhase"
+}
+
+if [ -z "${dontUsePypaInstall-}" ] && [ -z "${installPhase-}" ]; then
+    echo "Using pypaInstallPhase"
+    installPhase=pypaInstallPhase
+fi
diff --git a/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh b/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh
index 31bdec914f690..1ac91fb40e4e5 100644
--- a/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh
+++ b/pkgs/development/interpreters/python/hooks/python-relax-deps-hook.sh
@@ -78,24 +78,27 @@ pythonRelaxDepsHook() {
     pushd dist
 
     # See https://peps.python.org/pep-0491/#escaping-and-unicode
-    local -r pkg_name="${pname//[^[:alnum:].]/_}-$version"
+    local -r pkg_name="${pname//[^[:alnum:].]/_}"
     local -r unpack_dir="unpacked"
-    local -r metadata_file="$unpack_dir/$pkg_name/$pkg_name.dist-info/METADATA"
+    local -r metadata_file="$unpack_dir/$pkg_name*/$pkg_name*.dist-info/METADATA"
 
     # We generally shouldn't have multiple wheel files, but let's be safer here
     for wheel in "$pkg_name"*".whl"; do
-        @pythonInterpreter@ -m wheel unpack --dest "$unpack_dir" "$wheel"
+        PYTHONPATH="@wheel@/@pythonSitePackages@:$PYTHONPATH" \
+            @pythonInterpreter@ -m wheel unpack --dest "$unpack_dir" "$wheel"
         rm -rf "$wheel"
 
-        _pythonRelaxDeps "$metadata_file"
-        _pythonRemoveDeps "$metadata_file"
+        # Using no quotes on purpose since we need to expand the glob from `$metadata_file`
+        _pythonRelaxDeps $metadata_file
+        _pythonRemoveDeps $metadata_file
 
         if (( "${NIX_DEBUG:-0}" >= 1 )); then
             echo "pythonRelaxDepsHook: resulting METADATA for '$wheel':"
-            cat "$unpack_dir/$pkg_name/$pkg_name.dist-info/METADATA"
+            cat $metadata_file
         fi
 
-        @pythonInterpreter@ -m wheel pack "$unpack_dir/$pkg_name"
+        PYTHONPATH="@wheel@/@pythonSitePackages@:$PYTHONPATH" \
+            @pythonInterpreter@ -m wheel pack "$unpack_dir/$pkg_name"*
     done
 
     # Remove the folder since it will otherwise be in the dist output.
diff --git a/pkgs/development/interpreters/python/hooks/setuptools-rust-hook.sh b/pkgs/development/interpreters/python/hooks/setuptools-rust-hook.sh
new file mode 100644
index 0000000000000..917c19ef9b31b
--- /dev/null
+++ b/pkgs/development/interpreters/python/hooks/setuptools-rust-hook.sh
@@ -0,0 +1,18 @@
+echo "Sourcing setuptools-rust-hook"
+
+setuptoolsRustSetup() {
+    # This can work only if rustPlatform.cargoSetupHook is also included
+    if ! command -v cargoSetupPostPatchHook >/dev/null; then
+        echo "ERROR: setuptools-rust has to be used alongside with rustPlatform.cargoSetupHook!"
+        exit 1
+    fi
+
+    export PYO3_CROSS_LIB_DIR="@pyLibDir@"
+    export CARGO_BUILD_TARGET=@cargoBuildTarget@
+    # TODO theoretically setting linker should not be required because it is
+    # already set in pkgs/build-support/rust/hooks/default.nix but build fails
+    # on missing linker without this.
+    export CARGO_TARGET_@cargoLinkerVar@_LINKER=@targetLinker@
+}
+
+preConfigureHooks+=(setuptoolsRustSetup)
diff --git a/pkgs/development/interpreters/python/hooks/sphinx-hook.sh b/pkgs/development/interpreters/python/hooks/sphinx-hook.sh
index ca67fa9beabf3..0307e83d94799 100644
--- a/pkgs/development/interpreters/python/hooks/sphinx-hook.sh
+++ b/pkgs/development/interpreters/python/hooks/sphinx-hook.sh
@@ -38,7 +38,7 @@ buildSphinxPhase() {
 
     for __builder in "${__sphinxBuilders[@]}"; do
         echo "Executing sphinx-build with ${__builder} builder"
-        sphinx-build -M "${__builder}" "${__sphinxRoot}" ".sphinx/${__builder}" -v
+        @sphinxBuild@ -M "${__builder}" "${__sphinxRoot}" ".sphinx/${__builder}" -v
     done
 
     runHook postBuildSphinx
diff --git a/pkgs/development/interpreters/python/manylinux/default.nix b/pkgs/development/interpreters/python/manylinux/default.nix
index 04f0779618070..ba20c0d3a4cda 100644
--- a/pkgs/development/interpreters/python/manylinux/default.nix
+++ b/pkgs/development/interpreters/python/manylinux/default.nix
@@ -56,6 +56,8 @@ let
     "libgobject-2.0.so.0" = glib;
     "libgthread-2.0.so.0" = glib;
     "libglib-2.0.so.0" = glib;
+    "libz.so.1" = zlib;
+    "libexpat.so.1" = expat;
     });
 
   # https://www.python.org/dev/peps/pep-0571/
diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix
index b1f35cc2fb137..c14c6bc096fd3 100644
--- a/pkgs/development/interpreters/python/mk-python-derivation.nix
+++ b/pkgs/development/interpreters/python/mk-python-derivation.nix
@@ -11,9 +11,8 @@
 , namePrefix
 , update-python-libraries
 , setuptools
-, flitBuildHook
-, pipBuildHook
-, pipInstallHook
+, pypaBuildHook
+, pypaInstallHook
 , pythonCatchConflictsHook
 , pythonImportsCheckHook
 , pythonNamespacesHook
@@ -82,14 +81,18 @@
 # However, some packages do provide executables with extensions, and thus bytecode is generated.
 , removeBinBytecode ? true
 
+# pyproject = true <-> format = "pyproject"
+# pyproject = false <-> format = "other"
+# https://github.com/NixOS/nixpkgs/issues/253154
+, pyproject ? null
+
 # Several package formats are supported.
 # "setuptools" : Install a common setuptools/distutils based package. This builds a wheel.
 # "wheel" : Install from a pre-compiled wheel.
-# "flit" : Install a flit package. This builds a wheel.
 # "pyproject": Install a package using a ``pyproject.toml`` file (PEP517). This builds a wheel.
 # "egg": Install a package from an egg.
 # "other" : Provide your own buildPhase and installPhase.
-, format ? "setuptools"
+, format ? null
 
 , meta ? {}
 
@@ -99,19 +102,100 @@
 
 , disabledTestPaths ? []
 
+# Allow passing in a custom stdenv to buildPython*
+, stdenv ? python.stdenv
+
 , ... } @ attrs:
 
-let
-  inherit (python) stdenv;
+assert (pyproject != null) -> (format == null);
 
-  withDistOutput = lib.elem format ["pyproject" "setuptools" "flit" "wheel"];
+let
+  format' =
+    if pyproject != null then
+      if pyproject then
+        "pyproject"
+      else
+        "other"
+    else if format != null then
+      format
+    else
+      "setuptools";
+
+  withDistOutput = lib.elem format' ["pyproject" "setuptools" "wheel"];
 
   name_ = name;
 
+  validatePythonMatches = attrName: let
+    isPythonModule = drv:
+      # all pythonModules have the pythonModule attribute
+      (drv ? "pythonModule")
+      # Some pythonModules are turned in to a pythonApplication by setting the field to false
+      && (!builtins.isBool drv.pythonModule);
+    isMismatchedPython = drv: drv.pythonModule != python;
+
+    optionalLocation = let
+        pos = builtins.unsafeGetAttrPos (if attrs ? "pname" then "pname" else "name") attrs;
+      in lib.optionalString (pos != null) " at ${pos.file}:${toString pos.line}:${toString pos.column}";
+
+    leftPadName = name: against: let
+        len = lib.max (lib.stringLength name) (lib.stringLength against);
+      in lib.strings.fixedWidthString len " " name;
+
+    throwMismatch = drv: let
+      myName = "'${namePrefix}${name}'";
+      theirName = "'${drv.name}'";
+    in throw ''
+      Python version mismatch in ${myName}:
+
+      The Python derivation ${myName} depends on a Python derivation
+      named ${theirName}, but the two derivations use different versions
+      of Python:
+
+          ${leftPadName myName theirName} uses ${python}
+          ${leftPadName theirName myName} uses ${toString drv.pythonModule}
+
+      Possible solutions:
+
+        * If ${theirName} is a Python library, change the reference to ${theirName}
+          in the ${attrName} of ${myName} to use a ${theirName} built from the same
+          version of Python
+
+        * If ${theirName} is used as a tool during the build, move the reference to
+          ${theirName} in ${myName} from ${attrName} to nativeBuildInputs
+
+        * If ${theirName} provides executables that are called at run time, pass its
+          bin path to makeWrapperArgs:
+
+              makeWrapperArgs = [ "--prefix PATH : ''${lib.makeBinPath [ ${lib.getName drv } ] }" ];
+
+      ${optionalLocation}
+    '';
+
+    checkDrv = drv:
+      if (isPythonModule drv) && (isMismatchedPython drv)
+      then throwMismatch drv
+      else drv;
+
+    in inputs: builtins.map (checkDrv) inputs;
+
+  isBootstrapInstallPackage = builtins.elem (attrs.pname or null) [
+    "flit-core" "installer"
+  ];
+
+  isBootstrapPackage = isBootstrapInstallPackage || builtins.elem (attrs.pname or null) ([
+    "build" "packaging" "pyproject-hooks" "wheel"
+  ] ++ lib.optionals (python.pythonOlder "3.11") [
+    "tomli"
+  ]);
+
+  isSetuptoolsDependency = builtins.elem (attrs.pname or null) [
+    "setuptools" "wheel"
+  ];
+
   # Keep extra attributes from `attrs`, e.g., `patchPhase', etc.
   self = toPythonModule (stdenv.mkDerivation ((builtins.removeAttrs attrs [
-    "disabled" "checkPhase" "checkInputs" "nativeCheckInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" "format"
-    "disabledTestPaths" "outputs"
+    "disabled" "checkPhase" "checkInputs" "nativeCheckInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" "pyproject" "format"
+    "disabledTestPaths" "outputs" "stdenv"
   ]) // {
 
     name = namePrefix + name_;
@@ -121,25 +205,42 @@ let
       wrapPython
       ensureNewerSourcesForZipFilesHook  # move to wheel installer (pip) or builder (setuptools, flit, ...)?
       pythonRemoveTestsDirHook
-    ] ++ lib.optionals catchConflicts [
+    ] ++ lib.optionals (catchConflicts && !isBootstrapPackage && !isSetuptoolsDependency) [
+      #
+      # 1. When building a package that is also part of the bootstrap chain, we
+      #    must ignore conflicts after installation, because there will be one with
+      #    the package in the bootstrap.
+      #
+      # 2. When a package is a dependency of setuptools, we must ignore conflicts
+      #    because the hook that checks for conflicts uses setuptools.
+      #
       pythonCatchConflictsHook
     ] ++ lib.optionals removeBinBytecode [
       pythonRemoveBinBytecodeHook
     ] ++ lib.optionals (lib.hasSuffix "zip" (attrs.src.name or "")) [
       unzip
-    ] ++ lib.optionals (format == "setuptools") [
+    ] ++ lib.optionals (format' == "setuptools") [
       setuptoolsBuildHook
-    ] ++ lib.optionals (format == "flit") [
-      flitBuildHook
-    ] ++ lib.optionals (format == "pyproject") [
-      pipBuildHook
-    ] ++ lib.optionals (format == "wheel") [
+    ] ++ lib.optionals (format' == "pyproject") [(
+      if isBootstrapPackage then
+        pypaBuildHook.override {
+          inherit (python.pythonOnBuildForHost.pkgs.bootstrap) build;
+          wheel = null;
+        }
+      else
+        pypaBuildHook
+    )] ++ lib.optionals (format' == "wheel") [
       wheelUnpackHook
-    ] ++ lib.optionals (format == "egg") [
+    ] ++ lib.optionals (format' == "egg") [
       eggUnpackHook eggBuildHook eggInstallHook
-    ] ++ lib.optionals (!(format == "other") || dontUsePipInstall) [
-      pipInstallHook
-    ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [
+    ] ++ lib.optionals (format' != "other") [(
+      if isBootstrapInstallPackage then
+        pypaInstallHook.override {
+          inherit (python.pythonOnBuildForHost.pkgs.bootstrap) installer;
+        }
+      else
+        pypaInstallHook
+    )] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [
       # This is a test, however, it should be ran independent of the checkPhase and checkInputs
       pythonImportsCheckHook
     ] ++ lib.optionals (python.pythonAtLeast "3.3") [
@@ -149,14 +250,14 @@ let
       pythonOutputDistHook
     ] ++ nativeBuildInputs;
 
-    buildInputs = buildInputs ++ pythonPath;
+    buildInputs = validatePythonMatches "buildInputs" (buildInputs ++ pythonPath);
 
-    propagatedBuildInputs = propagatedBuildInputs ++ [
+    propagatedBuildInputs = validatePythonMatches "propagatedBuildInputs" (propagatedBuildInputs ++ [
       # we propagate python even for packages transformed with 'toPythonApplication'
       # this pollutes the PATH but avoids rebuilds
       # see https://github.com/NixOS/nixpkgs/issues/170887 for more context
       python
-    ];
+    ]);
 
     inherit strictDeps;
 
@@ -166,7 +267,7 @@ let
     doCheck = false;
     doInstallCheck = attrs.doCheck or true;
     nativeInstallCheckInputs = [
-    ] ++ lib.optionals (format == "setuptools") [
+    ] ++ lib.optionals (format' == "setuptools") [
       # Longer-term we should get rid of this and require
       # users of this function to set the `installCheckPhase` or
       # pass in a hook that sets it.
@@ -179,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
new file mode 100644
index 0000000000000..b06433113b6b3
--- /dev/null
+++ b/pkgs/development/interpreters/python/passthrufun.nix
@@ -0,0 +1,105 @@
+{ lib, stdenv, callPackage, pythonPackagesExtensions, config, makeScopeWithSplicing', ... }:
+
+{ implementation
+, libPrefix
+, executable
+, sourceVersion
+, pythonVersion
+, packageOverrides
+, sitePackages
+, hasDistutilsCxxPatch
+, pythonOnBuildForBuild
+, pythonOnBuildForHost
+, pythonOnBuildForTarget
+, pythonOnHostForHost
+, pythonOnTargetForTarget
+, pythonAttr ? null
+, self # is pythonOnHostForTarget
+}: let
+  pythonPackages = let
+    ensurePythonModules = items: let
+      exceptions = [
+        stdenv
+      ];
+      providesSetupHook = lib.attrByPath [ "provides" "setupHook"] false;
+      valid = value: pythonPackages.hasPythonModule value || providesSetupHook value || lib.elem value exceptions;
+      func = name: value:
+        if lib.isDerivation value then
+          lib.extendDerivation (valid value || throw "${name} should use `buildPythonPackage` or `toPythonModule` if it is to be part of the Python packages set.") {} value
+        else
+          value;
+    in lib.mapAttrs func items;
+  in ensurePythonModules (callPackage
+    # Function that when called
+    # - imports python-packages.nix
+    # - adds spliced package sets to the package set
+    # - applies overrides from `packageOverrides` and `pythonPackagesOverlays`.
+    ({ pkgs, stdenv, python, overrides }: let
+      pythonPackagesFun = import ./python-packages-base.nix {
+        inherit stdenv pkgs lib;
+        python = self;
+      };
+      otherSplices = {
+        selfBuildBuild = pythonOnBuildForBuild.pkgs;
+        selfBuildHost = pythonOnBuildForHost.pkgs;
+        selfBuildTarget = pythonOnBuildForTarget.pkgs;
+        selfHostHost = pythonOnHostForHost.pkgs;
+        selfTargetTarget = pythonOnTargetForTarget.pkgs or {}; # There is no Python TargetTarget.
+      };
+      hooks = import ./hooks/default.nix;
+      keep = self: hooks self {};
+      optionalExtensions = cond: as: lib.optionals cond as;
+      pythonExtension = import ../../../top-level/python-packages.nix;
+      python2Extension = import ../../../top-level/python2-packages.nix;
+      extensions = lib.composeManyExtensions ([
+        hooks
+        pythonExtension
+      ] ++ (optionalExtensions (!self.isPy3k) [
+        python2Extension
+      ]) ++ pythonPackagesExtensions ++ [
+        overrides
+      ]);
+      aliases = self: super: lib.optionalAttrs config.allowAliases (import ../../../top-level/python-aliases.nix lib self super);
+    in makeScopeWithSplicing' {
+      inherit otherSplices keep;
+      f = lib.extends (lib.composeExtensions aliases extensions) pythonPackagesFun;
+    }) {
+      overrides = packageOverrides;
+      python = self;
+    });
+  pythonOnBuildForHost_overridden =
+    pythonOnBuildForHost.override { inherit packageOverrides; self = pythonOnBuildForHost_overridden; };
+in rec {
+    isPy27 = pythonVersion == "2.7";
+    isPy37 = pythonVersion == "3.7";
+    isPy38 = pythonVersion == "3.8";
+    isPy39 = pythonVersion == "3.9";
+    isPy310 = pythonVersion == "3.10";
+    isPy311 = pythonVersion == "3.11";
+    isPy312 = pythonVersion == "3.12";
+    isPy2 = lib.strings.substring 0 1 pythonVersion == "2";
+    isPy3 = lib.strings.substring 0 1 pythonVersion == "3";
+    isPy3k = isPy3;
+    isPyPy = lib.hasInfix "pypy" interpreter;
+
+    buildEnv = callPackage ./wrapper.nix { python = self; inherit (pythonPackages) requiredPythonModules; };
+    withPackages = import ./with-packages.nix { inherit buildEnv pythonPackages;};
+    pkgs = pythonPackages;
+    interpreter = "${self}/bin/${executable}";
+    inherit executable implementation libPrefix pythonVersion sitePackages;
+    inherit sourceVersion;
+    pythonAtLeast = lib.versionAtLeast pythonVersion;
+    pythonOlder = lib.versionOlder pythonVersion;
+    inherit hasDistutilsCxxPatch;
+    # 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 {
+      python = self;
+    };
+
+    inherit pythonAttr;
+}
diff --git a/pkgs/development/interpreters/python/pypy/default.nix b/pkgs/development/interpreters/python/pypy/default.nix
index 84af77bade9e7..c64c65df350ef 100644
--- a/pkgs/development/interpreters/python/pypy/default.nix
+++ b/pkgs/development/interpreters/python/pypy/default.nix
@@ -1,9 +1,12 @@
 { lib, stdenv, substituteAll, fetchurl
-, zlib ? null, zlibSupport ? true, bzip2, pkg-config, libffi, libunwind, Security
+, zlibSupport ? true, zlib
+, bzip2, pkg-config, libffi, libunwind, Security
 , sqlite, openssl, ncurses, python, expat, tcl, tk, tix, libX11
-, self, gdbm, db, xz
-, python-setup-hook
+, gdbm, db, xz, python-setup-hook
+, optimizationLevel ? "jit", boehmgc
 # For the Python package set
+, hash
+, self
 , packageOverrides ? (self: super: {})
 , pkgsBuildBuild
 , pkgsBuildHost
@@ -12,7 +15,6 @@
 , pkgsTargetTarget
 , sourceVersion
 , pythonVersion
-, hash
 , passthruFun
 , pythonAttr ? "pypy${lib.substring 0 1 pythonVersion}${lib.substring 2 3 pythonVersion}"
 }:
@@ -59,6 +61,8 @@ in with passthru; stdenv.mkDerivation rec {
     stdenv.cc.libc
   ] ++ lib.optionals zlibSupport [
     zlib
+  ] ++ lib.optionals (lib.any (l: l == optimizationLevel) [ "0" "1" "2" "3"]) [
+    boehmgc
   ] ++ lib.optionals stdenv.isDarwin [
     libunwind Security
   ];
@@ -102,7 +106,7 @@ in with passthru; stdenv.mkDerivation rec {
 
     ${pythonForPypy.interpreter} rpython/bin/rpython \
       --make-jobs="$NIX_BUILD_CORES" \
-      -Ojit \
+      -O${optimizationLevel} \
       --batch pypy/goal/targetpypystandalone.py
 
     runHook postBuild
@@ -195,10 +199,11 @@ in with passthru; stdenv.mkDerivation rec {
   enableParallelBuilding = true;  # almost no parallelization without STM
 
   meta = with lib; {
-    homepage = "http://pypy.org/";
+    homepage = "https://www.pypy.org/";
     description = "Fast, compliant alternative implementation of the Python language (${pythonVersion})";
     license = licenses.mit;
     platforms = [ "aarch64-linux" "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ];
+    broken = optimizationLevel == "0"; # generates invalid code
     maintainers = with maintainers; [ andersk ];
   };
 }
diff --git a/pkgs/development/interpreters/python/pypy/prebuilt.nix b/pkgs/development/interpreters/python/pypy/prebuilt.nix
index 69508742148be..4b47c642eca4c 100644
--- a/pkgs/development/interpreters/python/pypy/prebuilt.nix
+++ b/pkgs/development/interpreters/python/pypy/prebuilt.nix
@@ -70,6 +70,7 @@ in with passthru; stdenv.mkDerivation {
     ncurses6
     sqlite
     zlib
+    stdenv.cc.cc.libgcc or null
   ] ++ lib.optionals stdenv.isLinux [
     tcl-8_5
     tk-8_5
diff --git a/pkgs/development/interpreters/python/pypy/prebuilt_2_7.nix b/pkgs/development/interpreters/python/pypy/prebuilt_2_7.nix
index c4b676271673d..37a06f9f61ed5 100644
--- a/pkgs/development/interpreters/python/pypy/prebuilt_2_7.nix
+++ b/pkgs/development/interpreters/python/pypy/prebuilt_2_7.nix
@@ -70,6 +70,7 @@ in with passthru; stdenv.mkDerivation {
     ncurses6
     sqlite
     zlib
+    stdenv.cc.cc.libgcc or null
   ] ++ lib.optionals stdenv.isLinux [
     tcl-8_5
     tk-8_5
diff --git a/pkgs/development/interpreters/python/python-packages-base.nix b/pkgs/development/interpreters/python/python-packages-base.nix
index 0899ad18e967c..2126b796ca9de 100644
--- a/pkgs/development/interpreters/python/python-packages-base.nix
+++ b/pkgs/development/interpreters/python/python-packages-base.nix
@@ -8,13 +8,12 @@ self:
 
 let
   inherit (self) callPackage;
-  inherit (python.passthru) isPy27 isPy37 isPy38 isPy39 isPy310 isPy311 isPy3k isPyPy pythonAtLeast pythonOlder;
 
   namePrefix = python.libPrefix + "-";
 
   # Derivations built with `buildPythonPackage` can already be overridden with `override`, `overrideAttrs`, and `overrideDerivation`.
   # This function introduces `overridePythonAttrs` and it overrides the call to `buildPythonPackage`.
-  makeOverridablePythonPackage = f: origArgs:
+  makeOverridablePythonPackage = f: lib.mirrorFunctionArgs f (origArgs:
     let
       args = lib.fix (lib.extends
         (_: previousAttrs: {
@@ -31,21 +30,23 @@ let
         overridePythonAttrs = newArgs: makeOverridablePythonPackage f (overrideWith newArgs);
         __functor = self: result;
       }
-      else result;
+      else result);
+
+  mkPythonDerivation = if python.isPy3k then
+    ./mk-python-derivation.nix
+  else
+    ./python2/mk-python-derivation.nix;
 
-  buildPythonPackage = makeOverridablePythonPackage (lib.makeOverridable (callPackage ./mk-python-derivation.nix {
+  buildPythonPackage = makeOverridablePythonPackage (lib.makeOverridable (callPackage mkPythonDerivation {
     inherit namePrefix;     # We want Python libraries to be named like e.g. "python3.6-${name}"
     inherit toPythonModule; # Libraries provide modules
   }));
 
-  buildPythonApplication = makeOverridablePythonPackage (lib.makeOverridable (callPackage ./mk-python-derivation.nix {
+  buildPythonApplication = makeOverridablePythonPackage (lib.makeOverridable (callPackage mkPythonDerivation {
     namePrefix = "";        # Python applications should not have any prefix
     toPythonModule = x: x;  # Application does not provide modules.
   }));
 
-  # See build-setupcfg/default.nix for documentation.
-  buildSetupcfg = import ../../../build-support/build-setupcfg lib self;
-
   # Check whether a derivation provides a Python module.
   hasPythonModule = drv: drv?pythonModule && drv.pythonModule == python;
 
@@ -88,14 +89,11 @@ let
   disabledIf = x: drv: if x then disabled drv else drv;
 
 in {
-
   inherit lib pkgs stdenv;
   inherit (python.passthru) isPy27 isPy37 isPy38 isPy39 isPy310 isPy311 isPy3k isPyPy pythonAtLeast pythonOlder;
   inherit buildPythonPackage buildPythonApplication;
-  inherit (pkgs) fetchPypi;
   inherit hasPythonModule requiredPythonModules makePythonPath disabled disabledIf;
   inherit toPythonModule toPythonApplication;
-  inherit buildSetupcfg;
 
   python = toPythonModule python;
   # Dont take pythonPackages from "global" pkgs scope to avoid mixing python versions
diff --git a/pkgs/development/interpreters/python/python2/mk-python-derivation.nix b/pkgs/development/interpreters/python/python2/mk-python-derivation.nix
new file mode 100644
index 0000000000000..1a6f9c784cf67
--- /dev/null
+++ b/pkgs/development/interpreters/python/python2/mk-python-derivation.nix
@@ -0,0 +1,250 @@
+# Generic builder only used for EOL and deprecated Python 2.
+
+{ lib
+, config
+, python
+, wrapPython
+, unzip
+, ensureNewerSourcesForZipFilesHook
+# Whether the derivation provides a Python module or not.
+, toPythonModule
+, namePrefix
+, update-python-libraries
+, setuptools
+, pipBuildHook
+, pipInstallHook
+, pythonCatchConflictsHook
+, pythonImportsCheckHook
+, pythonOutputDistHook
+, pythonRemoveBinBytecodeHook
+, pythonRemoveTestsDirHook
+, setuptoolsBuildHook
+, setuptoolsCheckHook
+, wheelUnpackHook
+, eggUnpackHook
+, eggBuildHook
+, eggInstallHook
+}:
+
+{ name ? "${attrs.pname}-${attrs.version}"
+
+# Build-time dependencies for the package
+, nativeBuildInputs ? []
+
+# Run-time dependencies for the package
+, buildInputs ? []
+
+# Dependencies needed for running the checkPhase.
+# These are added to buildInputs when doCheck = true.
+, checkInputs ? []
+, nativeCheckInputs ? []
+
+# propagate build dependencies so in case we have A -> B -> C,
+# C can import package A propagated by B
+, propagatedBuildInputs ? []
+
+# DEPRECATED: use propagatedBuildInputs
+, pythonPath ? []
+
+# Enabled to detect some (native)BuildInputs mistakes
+, strictDeps ? true
+
+, outputs ? [ "out" ]
+
+# used to disable derivation, useful for specific python versions
+, disabled ? false
+
+# Raise an error if two packages are installed with the same name
+# TODO: For cross we probably need a different PYTHONPATH, or not
+# add the runtime deps until after buildPhase.
+, catchConflicts ? (python.stdenv.hostPlatform == python.stdenv.buildPlatform)
+
+# Additional arguments to pass to the makeWrapper function, which wraps
+# generated binaries.
+, makeWrapperArgs ? []
+
+# Skip wrapping of python programs altogether
+, dontWrapPythonPrograms ? false
+
+# Don't use Pip to install a wheel
+# Note this is actually a variable for the pipInstallPhase in pip's setupHook.
+# It's included here to prevent an infinite recursion.
+, dontUsePipInstall ? false
+
+# Skip setting the PYTHONNOUSERSITE environment variable in wrapped programs
+, permitUserSite ? false
+
+# Remove bytecode from bin folder.
+# When a Python script has the extension `.py`, bytecode is generated
+# Typically, executables in bin have no extension, so no bytecode is generated.
+# However, some packages do provide executables with extensions, and thus bytecode is generated.
+, removeBinBytecode ? true
+
+# Several package formats are supported.
+# "setuptools" : Install a common setuptools/distutils based package. This builds a wheel.
+# "wheel" : Install from a pre-compiled wheel.
+# "pyproject": Install a package using a ``pyproject.toml`` file (PEP517). This builds a wheel.
+# "egg": Install a package from an egg.
+# "other" : Provide your own buildPhase and installPhase.
+, format ? "setuptools"
+
+, meta ? {}
+
+, passthru ? {}
+
+, doCheck ? config.doCheckByDefault or false
+
+, disabledTestPaths ? []
+
+, ... } @ attrs:
+
+let
+  inherit (python) stdenv;
+
+  withDistOutput = lib.elem format ["pyproject" "setuptools" "wheel"];
+
+  name_ = name;
+
+  validatePythonMatches = attrName: let
+    isPythonModule = drv:
+      # all pythonModules have the pythonModule attribute
+      (drv ? "pythonModule")
+      # Some pythonModules are turned in to a pythonApplication by setting the field to false
+      && (!builtins.isBool drv.pythonModule);
+    isMismatchedPython = drv: drv.pythonModule != python;
+
+    optionalLocation = let
+        pos = builtins.unsafeGetAttrPos (if attrs ? "pname" then "pname" else "name") attrs;
+      in lib.optionalString (pos != null) " at ${pos.file}:${toString pos.line}:${toString pos.column}";
+
+    leftPadName = name: against: let
+        len = lib.max (lib.stringLength name) (lib.stringLength against);
+      in lib.strings.fixedWidthString len " " name;
+
+    throwMismatch = drv: let
+      myName = "'${namePrefix}${name}'";
+      theirName = "'${drv.name}'";
+    in throw ''
+      Python version mismatch in ${myName}:
+
+      The Python derivation ${myName} depends on a Python derivation
+      named ${theirName}, but the two derivations use different versions
+      of Python:
+
+          ${leftPadName myName theirName} uses ${python}
+          ${leftPadName theirName myName} uses ${toString drv.pythonModule}
+
+      Possible solutions:
+
+        * If ${theirName} is a Python library, change the reference to ${theirName}
+          in the ${attrName} of ${myName} to use a ${theirName} built from the same
+          version of Python
+
+        * If ${theirName} is used as a tool during the build, move the reference to
+          ${theirName} in ${myName} from ${attrName} to nativeBuildInputs
+
+        * If ${theirName} provides executables that are called at run time, pass its
+          bin path to makeWrapperArgs:
+
+              makeWrapperArgs = [ "--prefix PATH : ''${lib.makeBinPath [ ${lib.getName drv } ] }" ];
+
+      ${optionalLocation}
+    '';
+
+    checkDrv = drv:
+      if (isPythonModule drv) && (isMismatchedPython drv)
+      then throwMismatch drv
+      else drv;
+
+    in inputs: builtins.map (checkDrv) inputs;
+
+  # Keep extra attributes from `attrs`, e.g., `patchPhase', etc.
+  self = toPythonModule (stdenv.mkDerivation ((builtins.removeAttrs attrs [
+    "disabled" "checkPhase" "checkInputs" "nativeCheckInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" "format"
+    "disabledTestPaths" "outputs"
+  ]) // {
+
+    name = namePrefix + name_;
+
+    nativeBuildInputs = [
+      python
+      wrapPython
+      ensureNewerSourcesForZipFilesHook  # move to wheel installer (pip) or builder (setuptools, ...)?
+      pythonRemoveTestsDirHook
+    ] ++ lib.optionals catchConflicts [
+      pythonCatchConflictsHook
+    ] ++ lib.optionals removeBinBytecode [
+      pythonRemoveBinBytecodeHook
+    ] ++ lib.optionals (lib.hasSuffix "zip" (attrs.src.name or "")) [
+      unzip
+    ] ++ lib.optionals (format == "setuptools") [
+      setuptoolsBuildHook
+    ] ++ lib.optionals (format == "pyproject") [(
+      pipBuildHook
+    )] ++ lib.optionals (format == "wheel") [
+      wheelUnpackHook
+    ] ++ lib.optionals (format == "egg") [
+      eggUnpackHook eggBuildHook eggInstallHook
+    ] ++ lib.optionals (format != "other") [(
+      pipInstallHook
+    )] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [
+      # This is a test, however, it should be ran independent of the checkPhase and checkInputs
+      pythonImportsCheckHook
+    ] ++ lib.optionals withDistOutput [
+      pythonOutputDistHook
+    ] ++ nativeBuildInputs;
+
+    buildInputs = validatePythonMatches "buildInputs" (buildInputs ++ pythonPath);
+
+    propagatedBuildInputs = validatePythonMatches "propagatedBuildInputs" (propagatedBuildInputs ++ [
+      # we propagate python even for packages transformed with 'toPythonApplication'
+      # this pollutes the PATH but avoids rebuilds
+      # see https://github.com/NixOS/nixpkgs/issues/170887 for more context
+      python
+    ]);
+
+    inherit strictDeps;
+
+    LANG = "${if python.stdenv.isDarwin then "en_US" else "C"}.UTF-8";
+
+    # Python packages don't have a checkPhase, only an installCheckPhase
+    doCheck = false;
+    doInstallCheck = attrs.doCheck or true;
+    nativeInstallCheckInputs = [
+    ] ++ lib.optionals (format == "setuptools") [
+      # Longer-term we should get rid of this and require
+      # users of this function to set the `installCheckPhase` or
+      # pass in a hook that sets it.
+      setuptoolsCheckHook
+    ] ++ nativeCheckInputs;
+    installCheckInputs = checkInputs;
+
+    postFixup = lib.optionalString (!dontWrapPythonPrograms) ''
+      wrapPythonPrograms
+    '' + 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.pythonOnBuildForHost ];
+
+    outputs = outputs ++ lib.optional withDistOutput "dist";
+
+    meta = {
+      # default to python's platforms
+      platforms = python.meta.platforms;
+      isBuildPythonPackage = python.meta.platforms;
+    } // meta;
+  } // lib.optionalAttrs (attrs?checkPhase) {
+    # If given use the specified checkPhase, otherwise use the setup hook.
+    # Longer-term we should get rid of `checkPhase` and use `installCheckPhase`.
+    installCheckPhase = attrs.checkPhase;
+  } //  lib.optionalAttrs (disabledTestPaths != []) {
+      disabledTestPaths = lib.escapeShellArgs disabledTestPaths;
+  }));
+
+  passthru.updateScript = let
+      filename = builtins.head (lib.splitString ":" self.meta.position);
+    in attrs.passthru.updateScript or [ update-python-libraries filename ];
+in lib.extendDerivation
+  (disabled -> throw "${name} not supported for interpreter ${python.executable}")
+  passthru
+  self
diff --git a/pkgs/development/interpreters/python/rustpython/Cargo.lock b/pkgs/development/interpreters/python/rustpython/Cargo.lock
index bf9256a61fa8d..36335bb395d13 100644
--- a/pkgs/development/interpreters/python/rustpython/Cargo.lock
+++ b/pkgs/development/interpreters/python/rustpython/Cargo.lock
@@ -9,12 +9,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3"
 
 [[package]]
-name = "abort_on_panic"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "955f37ac58af2416bac687c8ab66a4ccba282229bd7422a28d2281a5e66a6116"
-
-[[package]]
 name = "adler"
 version = "1.0.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -32,7 +26,7 @@ version = "0.7.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
 dependencies = [
- "getrandom",
+ "getrandom 0.2.8",
  "once_cell",
  "version_check",
 ]
@@ -66,9 +60,9 @@ dependencies = [
 
 [[package]]
 name = "anyhow"
-version = "1.0.66"
+version = "1.0.69"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6"
+checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800"
 
 [[package]]
 name = "approx"
@@ -92,15 +86,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16"
 
 [[package]]
-name = "ascii-canvas"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6"
-dependencies = [
- "term",
-]
-
-[[package]]
 name = "atomic"
 version = "0.5.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -115,7 +100,7 @@ version = "0.2.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
 dependencies = [
- "hermit-abi",
+ "hermit-abi 0.1.19",
  "libc",
  "winapi",
 ]
@@ -133,42 +118,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
 
 [[package]]
-name = "bincode"
-version = "1.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "bit-set"
-version = "0.5.3"
+name = "bitflags"
+version = "1.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1"
-dependencies = [
- "bit-vec",
-]
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
 
 [[package]]
-name = "bit-vec"
-version = "0.6.3"
+name = "bitflags"
+version = "2.3.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
+checksum = "6776fc96284a0bb647b615056fc496d1fe1644a7ab01829818a6d91cae888b84"
 
 [[package]]
-name = "bitflags"
-version = "1.3.2"
+name = "blake2"
+version = "0.10.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
+dependencies = [
+ "digest 0.10.6",
+]
 
 [[package]]
-name = "blake2"
-version = "0.10.5"
+name = "block-buffer"
+version = "0.9.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b12e5fd123190ce1c2e559308a94c9bacad77907d4c6005d9e58fe1a0689e55e"
+checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
 dependencies = [
- "digest",
+ "block-padding",
+ "generic-array",
 ]
 
 [[package]]
@@ -181,6 +158,12 @@ dependencies = [
 ]
 
 [[package]]
+name = "block-padding"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae"
+
+[[package]]
 name = "bstr"
 version = "0.2.17"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -189,14 +172,13 @@ dependencies = [
  "lazy_static 1.4.0",
  "memchr",
  "regex-automata",
- "serde",
 ]
 
 [[package]]
 name = "bumpalo"
-version = "3.11.1"
+version = "3.12.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba"
+checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535"
 
 [[package]]
 name = "byteorder"
@@ -243,9 +225,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
 
 [[package]]
 name = "cc"
-version = "1.0.77"
+version = "1.0.79"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4"
+checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
 
 [[package]]
 name = "cfg-if"
@@ -276,7 +258,7 @@ checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
 dependencies = [
  "ansi_term",
  "atty",
- "bitflags",
+ "bitflags 1.3.2",
  "strsim",
  "textwrap 0.11.0",
  "unicode-width",
@@ -285,9 +267,9 @@ dependencies = [
 
 [[package]]
 name = "clipboard-win"
-version = "4.4.2"
+version = "4.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4ab1b92798304eedc095b53942963240037c0516452cb11aeba709d420b2219"
+checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362"
 dependencies = [
  "error-code",
  "str-buf",
@@ -306,15 +288,14 @@ dependencies = [
 
 [[package]]
 name = "console"
-version = "0.15.2"
+version = "0.15.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c050367d967ced717c04b65d8c619d863ef9292ce0c5760028655a2fb298718c"
+checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60"
 dependencies = [
  "encode_unicode",
  "lazy_static 1.4.0",
  "libc",
- "terminal_size",
- "winapi",
+ "windows-sys 0.42.0",
 ]
 
 [[package]]
@@ -328,6 +309,12 @@ dependencies = [
 ]
 
 [[package]]
+name = "convert_case"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"
+
+[[package]]
 name = "core-foundation"
 version = "0.9.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -500,7 +487,7 @@ dependencies = [
  "clap",
  "criterion-plot",
  "csv",
- "itertools",
+ "itertools 0.10.5",
  "lazy_static 1.4.0",
  "num-traits",
  "oorandom",
@@ -522,7 +509,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876"
 dependencies = [
  "cast",
- "itertools",
+ "itertools 0.10.5",
 ]
 
 [[package]]
@@ -561,9 +548,9 @@ dependencies = [
 
 [[package]]
 name = "crossbeam-utils"
-version = "0.8.14"
+version = "0.8.16"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f"
+checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294"
 dependencies = [
  "cfg-if",
 ]
@@ -586,13 +573,12 @@ dependencies = [
 
 [[package]]
 name = "csv"
-version = "1.1.6"
+version = "1.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1"
+checksum = "af91f40b7355f82b0a891f50e70399475945bb0b0da4f1700ce60761c9d3e359"
 dependencies = [
- "bstr",
  "csv-core",
- "itoa 0.4.8",
+ "itoa",
  "ryu",
  "serde",
 ]
@@ -608,9 +594,9 @@ dependencies = [
 
 [[package]]
 name = "cxx"
-version = "1.0.82"
+version = "1.0.91"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d4a41a86530d0fe7f5d9ea779916b7cadd2d4f9add748b99c2c029cbbdfaf453"
+checksum = "86d3488e7665a7a483b57e25bdd90d0aeb2bc7608c8d0346acf2ad3f1caf1d62"
 dependencies = [
  "cc",
  "cxxbridge-flags",
@@ -620,9 +606,9 @@ dependencies = [
 
 [[package]]
 name = "cxx-build"
-version = "1.0.82"
+version = "1.0.91"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06416d667ff3e3ad2df1cd8cd8afae5da26cf9cec4d0825040f88b5ca659a2f0"
+checksum = "48fcaf066a053a41a81dfb14d57d99738b767febb8b735c3016e469fac5da690"
 dependencies = [
  "cc",
  "codespan-reporting",
@@ -635,15 +621,15 @@ dependencies = [
 
 [[package]]
 name = "cxxbridge-flags"
-version = "1.0.82"
+version = "1.0.91"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "820a9a2af1669deeef27cb271f476ffd196a2c4b6731336011e0ba63e2c7cf71"
+checksum = "a2ef98b8b717a829ca5603af80e1f9e2e48013ab227b68ef37872ef84ee479bf"
 
 [[package]]
 name = "cxxbridge-macro"
-version = "1.0.82"
+version = "1.0.91"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a08a6e2fcc370a089ad3b4aaf54db3b1b4cee38ddabce5896b33eb693275f470"
+checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -651,10 +637,26 @@ dependencies = [
 ]
 
 [[package]]
-name = "diff"
-version = "0.1.13"
+name = "derive_more"
+version = "0.99.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
+dependencies = [
+ "convert_case",
+ "proc-macro2",
+ "quote",
+ "rustc_version",
+ "syn",
+]
+
+[[package]]
+name = "digest"
+version = "0.9.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
+checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
+dependencies = [
+ "generic-array",
+]
 
 [[package]]
 name = "digest"
@@ -662,7 +664,7 @@ version = "0.10.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f"
 dependencies = [
- "block-buffer",
+ "block-buffer 0.10.3",
  "crypto-common",
  "subtle",
 ]
@@ -701,18 +703,27 @@ dependencies = [
 ]
 
 [[package]]
+name = "dyn-clone"
+version = "1.0.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c9b0705efd4599c15a38151f4721f7bc388306f61084d3bfd50bd07fbca5cb60"
+
+[[package]]
 name = "either"
-version = "1.8.0"
+version = "1.8.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797"
+checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"
 
 [[package]]
-name = "ena"
-version = "0.14.0"
+name = "embed-doc-image"
+version = "0.1.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7402b94a93c24e742487327a7cd839dc9d36fec9de9fb25b09f2dae459f36c3"
+checksum = "af36f591236d9d822425cb6896595658fa558fcebf5ee8accac1d4b92c47166e"
 dependencies = [
- "log",
+ "base64",
+ "proc-macro2",
+ "quote",
+ "syn",
 ]
 
 [[package]]
@@ -740,13 +751,13 @@ dependencies = [
 
 [[package]]
 name = "errno"
-version = "0.2.8"
+version = "0.3.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1"
+checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a"
 dependencies = [
  "errno-dragonfly",
  "libc",
- "winapi",
+ "windows-sys 0.48.0",
 ]
 
 [[package]]
@@ -777,22 +788,16 @@ checksum = "de853764b47027c2e862a995c34978ffa63c1501f2e15f987ba11bd4f9bba193"
 
 [[package]]
 name = "fd-lock"
-version = "3.0.8"
+version = "3.0.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb21c69b9fea5e15dbc1049e4b77145dd0ba1c84019c488102de0dc4ea4b0a27"
+checksum = "39ae6b3d9530211fb3b12a95374b8b0823be812f53d09e18c5675c0146b09642"
 dependencies = [
  "cfg-if",
  "rustix",
- "windows-sys 0.42.0",
+ "windows-sys 0.48.0",
 ]
 
 [[package]]
-name = "fixedbitset"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
-
-[[package]]
 name = "flame"
 version = "0.2.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -830,9 +835,9 @@ dependencies = [
 
 [[package]]
 name = "flate2"
-version = "1.0.24"
+version = "1.0.25"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6"
+checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841"
 dependencies = [
  "crc32fast",
  "libz-sys",
@@ -891,6 +896,17 @@ dependencies = [
 
 [[package]]
 name = "getrandom"
+version = "0.1.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "wasi 0.9.0+wasi-snapshot-preview1",
+]
+
+[[package]]
+name = "getrandom"
 version = "0.2.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31"
@@ -904,9 +920,9 @@ dependencies = [
 
 [[package]]
 name = "glob"
-version = "0.3.0"
+version = "0.3.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
+checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
 
 [[package]]
 name = "half"
@@ -922,9 +938,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
 
 [[package]]
 name = "heck"
-version = "0.4.0"
+version = "0.4.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
+checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
 
 [[package]]
 name = "hermit-abi"
@@ -936,6 +952,21 @@ dependencies = [
 ]
 
 [[package]]
+name = "hermit-abi"
+version = "0.2.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "hermit-abi"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
+
+[[package]]
 name = "hex"
 version = "0.4.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -983,9 +1014,9 @@ dependencies = [
 
 [[package]]
 name = "insta"
-version = "1.21.1"
+version = "1.28.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba1e75aa1530e7385af7b2685478dece08dafb9db3b4225c753286decea83bef"
+checksum = "fea5b3894afe466b4bcf0388630fc15e11938a6074af0cd637c825ba2ec8a099"
 dependencies = [
  "console",
  "lazy_static 1.4.0",
@@ -996,19 +1027,20 @@ dependencies = [
 
 [[package]]
 name = "io-lifetimes"
-version = "1.0.1"
+version = "1.0.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7d367024b3f3414d8e01f437f704f41a9f64ab36f9067fa73e526ad4c763c87"
+checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220"
 dependencies = [
+ "hermit-abi 0.3.1",
  "libc",
- "windows-sys 0.42.0",
+ "windows-sys 0.48.0",
 ]
 
 [[package]]
 name = "is-macro"
-version = "0.2.1"
+version = "0.2.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c068d4c6b922cd6284c609cfa6dec0e41615c9c5a1a4ba729a970d8daba05fb"
+checksum = "8a7d079e129b77477a49c5c4f1cfe9ce6c2c909ef52520693e8e811a714c7b20"
 dependencies = [
  "Inflector",
  "pmutil",
@@ -1019,30 +1051,33 @@ dependencies = [
 
 [[package]]
 name = "itertools"
-version = "0.10.5"
+version = "0.9.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
+checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
 dependencies = [
  "either",
 ]
 
 [[package]]
-name = "itoa"
-version = "0.4.8"
+name = "itertools"
+version = "0.10.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
+checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
+dependencies = [
+ "either",
+]
 
 [[package]]
 name = "itoa"
-version = "1.0.4"
+version = "1.0.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc"
+checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440"
 
 [[package]]
 name = "js-sys"
-version = "0.3.60"
+version = "0.3.61"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47"
+checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730"
 dependencies = [
  "wasm-bindgen",
 ]
@@ -1057,36 +1092,10 @@ dependencies = [
 ]
 
 [[package]]
-name = "lalrpop"
-version = "0.19.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b30455341b0e18f276fa64540aff54deafb54c589de6aca68659c63dd2d5d823"
-dependencies = [
- "ascii-canvas",
- "atty",
- "bit-set",
- "diff",
- "ena",
- "itertools",
- "lalrpop-util",
- "petgraph",
- "pico-args",
- "regex",
- "regex-syntax",
- "string_cache",
- "term",
- "tiny-keccak",
- "unicode-xid",
-]
-
-[[package]]
 name = "lalrpop-util"
-version = "0.19.8"
+version = "0.20.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcf796c978e9b4d983414f4caedc9273aa33ee214c5b887bd55fde84c85d2dc4"
-dependencies = [
- "regex",
-]
+checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d"
 
 [[package]]
 name = "lazy_static"
@@ -1132,26 +1141,25 @@ dependencies = [
 
 [[package]]
 name = "libc"
-version = "0.2.137"
+version = "0.2.141"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89"
+checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5"
 
 [[package]]
 name = "libffi"
-version = "2.0.1"
+version = "3.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b05b52bd89490a0b36c56715aef46d8580d25343ed243d01337663b287004bf"
+checksum = "6cb06d5b4c428f3cd682943741c39ed4157ae989fffe1094a08eaf7c4014cf60"
 dependencies = [
- "abort_on_panic",
  "libc",
  "libffi-sys",
 ]
 
 [[package]]
 name = "libffi-sys"
-version = "1.3.2"
+version = "2.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7283a0ec88c0064eb8b3e40990d2a49cdca5a207f46f678e79ea7302b335401f"
+checksum = "11c6f11e063a27ffe040a9d15f0b661bf41edc2383b7ae0e0ad5a7e7d53d9da3"
 dependencies = [
  "cc",
 ]
@@ -1181,9 +1189,9 @@ dependencies = [
 
 [[package]]
 name = "link-cplusplus"
-version = "1.0.7"
+version = "1.0.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369"
+checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5"
 dependencies = [
  "cc",
 ]
@@ -1196,9 +1204,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
 
 [[package]]
 name = "linux-raw-sys"
-version = "0.1.3"
+version = "0.3.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f"
+checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f"
 
 [[package]]
 name = "lock_api"
@@ -1234,7 +1242,7 @@ version = "1.1.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "b238e3235c8382b7653c6408ed1b08dd379bdb9fdf990fb0bbae3db2cc0ae963"
 dependencies = [
- "nix 0.23.1",
+ "nix 0.23.2",
  "winapi",
 ]
 
@@ -1248,6 +1256,65 @@ dependencies = [
 ]
 
 [[package]]
+name = "malachite"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f6cf7f4730c30071ba374fac86ad35b1cb7a0716f774737768667ea3fa1828e3"
+dependencies = [
+ "malachite-base",
+ "malachite-nz",
+ "malachite-q",
+]
+
+[[package]]
+name = "malachite-base"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b06bfa98a4b4802af5a4263b4ad4660e28e51e8490f6354eb9336c70767e1c5"
+dependencies = [
+ "itertools 0.9.0",
+ "rand 0.7.3",
+ "rand_chacha 0.2.2",
+ "ryu",
+ "sha3 0.9.1",
+]
+
+[[package]]
+name = "malachite-bigint"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a5110aee54537b0cef214efbebdd7df79b7408db8eef4f6a4b6db9d0d8fc01b"
+dependencies = [
+ "derive_more",
+ "malachite",
+ "num-integer",
+ "num-traits",
+ "paste",
+]
+
+[[package]]
+name = "malachite-nz"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c89e21c64b7af5be3dc8cef16f786243faf59459fe4ba93b44efdeb264e5ade4"
+dependencies = [
+ "embed-doc-image",
+ "itertools 0.9.0",
+ "malachite-base",
+]
+
+[[package]]
+name = "malachite-q"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3755e541d5134b5016594c9043094172c4dda9259b3ce824a7b8101941850360"
+dependencies = [
+ "itertools 0.9.0",
+ "malachite-base",
+ "malachite-nz",
+]
+
+[[package]]
 name = "maplit"
 version = "1.0.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1255,9 +1322,9 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
 
 [[package]]
 name = "matches"
-version = "0.1.9"
+version = "0.1.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
+checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
 
 [[package]]
 name = "md-5"
@@ -1265,7 +1332,7 @@ version = "0.10.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca"
 dependencies = [
- "digest",
+ "digest 0.10.6",
 ]
 
 [[package]]
@@ -1303,9 +1370,9 @@ dependencies = [
 
 [[package]]
 name = "miniz_oxide"
-version = "0.5.4"
+version = "0.6.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34"
+checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa"
 dependencies = [
  "adler",
 ]
@@ -1316,16 +1383,10 @@ version = "2.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "12ca7f22ed370d5991a9caec16a83187e865bc8a532f889670337d5a5689e3a1"
 dependencies = [
- "rand_core",
+ "rand_core 0.6.4",
 ]
 
 [[package]]
-name = "new_debug_unreachable"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"
-
-[[package]]
 name = "nibble_vec"
 version = "0.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1336,11 +1397,11 @@ dependencies = [
 
 [[package]]
 name = "nix"
-version = "0.23.1"
+version = "0.23.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6"
+checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c"
 dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
  "cc",
  "cfg-if",
  "libc",
@@ -1349,36 +1410,34 @@ dependencies = [
 
 [[package]]
 name = "nix"
-version = "0.24.2"
+version = "0.26.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc"
+checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a"
 dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
  "cfg-if",
  "libc",
- "memoffset 0.6.5",
+ "memoffset 0.7.1",
+ "pin-utils",
+ "static_assertions",
 ]
 
 [[package]]
-name = "num-bigint"
-version = "0.4.3"
+name = "nom8"
+version = "0.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f"
+checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8"
 dependencies = [
- "autocfg",
- "num-integer",
- "num-traits",
- "serde",
+ "memchr",
 ]
 
 [[package]]
 name = "num-complex"
-version = "0.4.2"
+version = "0.4.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19"
+checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d"
 dependencies = [
  "num-traits",
- "serde",
 ]
 
 [[package]]
@@ -1392,18 +1451,6 @@ dependencies = [
 ]
 
 [[package]]
-name = "num-rational"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0"
-dependencies = [
- "autocfg",
- "num-bigint",
- "num-integer",
- "num-traits",
-]
-
-[[package]]
 name = "num-traits"
 version = "0.2.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1414,28 +1461,28 @@ dependencies = [
 
 [[package]]
 name = "num_cpus"
-version = "1.14.0"
+version = "1.15.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5"
+checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b"
 dependencies = [
- "hermit-abi",
+ "hermit-abi 0.2.6",
  "libc",
 ]
 
 [[package]]
 name = "num_enum"
-version = "0.5.7"
+version = "0.5.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9"
+checksum = "8d829733185c1ca374f17e52b762f24f535ec625d2cc1f070e34c8a9068f341b"
 dependencies = [
  "num_enum_derive",
 ]
 
 [[package]]
 name = "num_enum_derive"
-version = "0.5.7"
+version = "0.5.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce"
+checksum = "2be1598bf1c313dcdd12092e3f1920f463462525a21b7b4e11b4168353d0123e"
 dependencies = [
  "proc-macro-crate",
  "proc-macro2",
@@ -1445,9 +1492,9 @@ dependencies = [
 
 [[package]]
 name = "once_cell"
-version = "1.16.0"
+version = "1.17.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860"
+checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
 
 [[package]]
 name = "oorandom"
@@ -1456,12 +1503,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
 
 [[package]]
+name = "opaque-debug"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
+
+[[package]]
 name = "openssl"
-version = "0.10.43"
+version = "0.10.55"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "020433887e44c27ff16365eaa2d380547a94544ad509aff6eb5b6e3e0b27b376"
+checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d"
 dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
  "cfg-if",
  "foreign-types",
  "libc",
@@ -1489,20 +1542,19 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
 
 [[package]]
 name = "openssl-src"
-version = "111.24.0+1.1.1s"
+version = "111.25.0+1.1.1t"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3498f259dab01178c6228c6b00dcef0ed2a2d5e20d648c017861227773ea4abd"
+checksum = "3173cd3626c43e3854b1b727422a276e568d9ec5fe8cec197822cf52cfb743d6"
 dependencies = [
  "cc",
 ]
 
 [[package]]
 name = "openssl-sys"
-version = "0.9.78"
+version = "0.9.90"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "07d5c8cb6e57b3a3612064d7b18b117912b4ce70955c2504d4b741c9e244b132"
+checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6"
 dependencies = [
- "autocfg",
  "cc",
  "libc",
  "openssl-src",
@@ -1538,47 +1590,37 @@ dependencies = [
 
 [[package]]
 name = "parking_lot_core"
-version = "0.9.4"
+version = "0.9.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0"
+checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521"
 dependencies = [
  "cfg-if",
  "libc",
  "redox_syscall 0.2.16",
  "smallvec",
- "windows-sys 0.42.0",
+ "windows-sys 0.45.0",
 ]
 
 [[package]]
 name = "paste"
-version = "1.0.9"
+version = "1.0.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1"
-
-[[package]]
-name = "petgraph"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143"
-dependencies = [
- "fixedbitset",
- "indexmap",
-]
+checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79"
 
 [[package]]
 name = "phf"
-version = "0.10.1"
+version = "0.11.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259"
+checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c"
 dependencies = [
  "phf_shared",
 ]
 
 [[package]]
 name = "phf_codegen"
-version = "0.10.0"
+version = "0.11.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd"
+checksum = "a56ac890c5e3ca598bbdeaa99964edb5b0258a583a9eb6ef4e89fc85d9224770"
 dependencies = [
  "phf_generator",
  "phf_shared",
@@ -1586,28 +1628,28 @@ dependencies = [
 
 [[package]]
 name = "phf_generator"
-version = "0.10.0"
+version = "0.11.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6"
+checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf"
 dependencies = [
  "phf_shared",
- "rand",
+ "rand 0.8.5",
 ]
 
 [[package]]
 name = "phf_shared"
-version = "0.10.0"
+version = "0.11.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
+checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676"
 dependencies = [
  "siphasher",
 ]
 
 [[package]]
-name = "pico-args"
-version = "0.4.2"
+name = "pin-utils"
+version = "0.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468"
+checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
 
 [[package]]
 name = "pkg-config"
@@ -1661,27 +1703,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
 
 [[package]]
-name = "precomputed-hash"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
-
-[[package]]
 name = "proc-macro-crate"
-version = "1.2.1"
+version = "1.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9"
+checksum = "66618389e4ec1c7afe67d51a9bf34ff9236480f8d51e7489b7d5ab0303c13f34"
 dependencies = [
  "once_cell",
- "thiserror",
- "toml",
+ "toml_edit",
 ]
 
 [[package]]
 name = "proc-macro2"
-version = "1.0.47"
+version = "1.0.66"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725"
+checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9"
 dependencies = [
  "unicode-ident",
 ]
@@ -1704,9 +1739,9 @@ dependencies = [
 
 [[package]]
 name = "quote"
-version = "1.0.21"
+version = "1.0.23"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
+checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b"
 dependencies = [
  "proc-macro2",
 ]
@@ -1729,13 +1764,36 @@ dependencies = [
 
 [[package]]
 name = "rand"
+version = "0.7.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
+dependencies = [
+ "getrandom 0.1.16",
+ "libc",
+ "rand_chacha 0.2.2",
+ "rand_core 0.5.1",
+ "rand_hc",
+]
+
+[[package]]
+name = "rand"
 version = "0.8.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
 dependencies = [
  "libc",
- "rand_chacha",
- "rand_core",
+ "rand_chacha 0.3.1",
+ "rand_core 0.6.4",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
+dependencies = [
+ "ppv-lite86",
+ "rand_core 0.5.1",
 ]
 
 [[package]]
@@ -1745,7 +1803,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
 dependencies = [
  "ppv-lite86",
- "rand_core",
+ "rand_core 0.6.4",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
+dependencies = [
+ "getrandom 0.1.16",
 ]
 
 [[package]]
@@ -1754,25 +1821,33 @@ version = "0.6.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
 dependencies = [
- "getrandom",
+ "getrandom 0.2.8",
+]
+
+[[package]]
+name = "rand_hc"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
+dependencies = [
+ "rand_core 0.5.1",
 ]
 
 [[package]]
 name = "rayon"
-version = "1.6.0"
+version = "1.6.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e060280438193c554f654141c9ea9417886713b7acd75974c85b18a69a88e0b"
+checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7"
 dependencies = [
- "crossbeam-deque",
  "either",
  "rayon-core",
 ]
 
 [[package]]
 name = "rayon-core"
-version = "1.10.1"
+version = "1.10.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3"
+checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b"
 dependencies = [
  "crossbeam-channel",
  "crossbeam-deque",
@@ -1792,7 +1867,7 @@ version = "0.2.16"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
 dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
 ]
 
 [[package]]
@@ -1801,7 +1876,7 @@ version = "0.4.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b"
 dependencies = [
- "getrandom",
+ "getrandom 0.2.8",
  "redox_syscall 0.2.16",
  "thiserror",
 ]
@@ -1820,9 +1895,9 @@ dependencies = [
 
 [[package]]
 name = "regex"
-version = "1.7.0"
+version = "1.7.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a"
+checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733"
 dependencies = [
  "aho-corasick",
  "memchr",
@@ -1847,7 +1922,7 @@ version = "2.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "877e54ea2adcd70d80e9179344c97f93ef0dffd6b03e1f4529e6e83ab2fa9ae0"
 dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
  "libc",
  "mach",
  "winapi",
@@ -1892,21 +1967,21 @@ dependencies = [
 
 [[package]]
 name = "rustix"
-version = "0.36.3"
+version = "0.37.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b1fbb4dfc4eb1d390c02df47760bb19a84bb80b301ecc947ab5406394d8223e"
+checksum = "85597d61f83914ddeba6a47b3b8ffe7365107221c2e557ed94426489fefb5f77"
 dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
  "errno",
  "io-lifetimes",
  "libc",
  "linux-raw-sys",
- "windows-sys 0.42.0",
+ "windows-sys 0.48.0",
 ]
 
 [[package]]
 name = "rustpython"
-version = "0.2.0"
+version = "0.3.0"
 dependencies = [
  "atty",
  "cfg-if",
@@ -1919,7 +1994,6 @@ dependencies = [
  "flamescope",
  "libc",
  "log",
- "num-traits",
  "python3-sys",
  "rustpython-compiler",
  "rustpython-parser",
@@ -1931,85 +2005,85 @@ dependencies = [
 
 [[package]]
 name = "rustpython-ast"
-version = "0.2.0"
+version = "0.3.0"
+source = "git+https://github.com/RustPython/Parser.git?tag=0.3.0#a1e4336f7043807eda8a5ecb15d4115172cc4a7e"
 dependencies = [
- "num-bigint",
- "rustpython-common",
- "rustpython-compiler-core",
+ "is-macro",
+ "malachite-bigint",
+ "rustpython-literal",
+ "rustpython-parser-core",
+ "static_assertions",
 ]
 
 [[package]]
 name = "rustpython-codegen"
-version = "0.2.0"
+version = "0.3.0"
 dependencies = [
  "ahash",
- "bitflags",
+ "bitflags 2.3.1",
  "indexmap",
  "insta",
- "itertools",
+ "itertools 0.10.5",
  "log",
  "num-complex",
  "num-traits",
  "rustpython-ast",
  "rustpython-compiler-core",
  "rustpython-parser",
- "thiserror",
+ "rustpython-parser-core",
 ]
 
 [[package]]
 name = "rustpython-common"
-version = "0.2.0"
+version = "0.3.0"
 dependencies = [
  "ascii",
- "bitflags",
+ "bitflags 2.3.1",
+ "bstr",
  "cfg-if",
- "hexf-parse",
- "itertools",
- "lexical-parse-float",
+ "itertools 0.10.5",
  "libc",
  "lock_api",
- "num-bigint",
+ "malachite-base",
+ "malachite-bigint",
+ "malachite-q",
  "num-complex",
  "num-traits",
  "once_cell",
  "parking_lot",
  "radium",
- "rand",
+ "rand 0.8.5",
+ "rustpython-format",
  "siphasher",
- "unic-ucd-category",
  "volatile",
  "widestring",
 ]
 
 [[package]]
 name = "rustpython-compiler"
-version = "0.2.0"
+version = "0.3.0"
 dependencies = [
  "rustpython-codegen",
  "rustpython-compiler-core",
  "rustpython-parser",
- "thiserror",
 ]
 
 [[package]]
 name = "rustpython-compiler-core"
-version = "0.2.0"
+version = "0.3.0"
 dependencies = [
- "bincode",
- "bitflags",
- "bstr",
- "itertools",
+ "bitflags 2.3.1",
+ "itertools 0.10.5",
  "lz4_flex",
- "num-bigint",
+ "malachite-bigint",
  "num-complex",
+ "rustpython-parser-core",
  "serde",
- "static_assertions",
- "thiserror",
 ]
 
 [[package]]
 name = "rustpython-derive"
-version = "0.2.0"
+version = "0.3.0"
 dependencies = [
  "rustpython-compiler",
  "rustpython-derive-impl",
@@ -2018,16 +2092,16 @@ dependencies = [
 
 [[package]]
 name = "rustpython-derive-impl"
-version = "0.2.0"
+version = "0.3.0"
 dependencies = [
- "indexmap",
- "itertools",
+ "itertools 0.10.5",
  "maplit",
  "once_cell",
  "proc-macro2",
  "quote",
  "rustpython-compiler-core",
  "rustpython-doc",
+ "rustpython-parser-core",
  "syn",
  "syn-ext",
  "textwrap 0.15.2",
@@ -2035,15 +2109,27 @@ dependencies = [
 
 [[package]]
 name = "rustpython-doc"
-version = "0.1.0"
-source = "git+https://github.com/RustPython/__doc__?branch=main#d927debd491e4c45b88e953e6e50e4718e0f2965"
+version = "0.3.0"
+source = "git+https://github.com/RustPython/__doc__?tag=0.3.0#8b62ce5d796d68a091969c9fa5406276cb483f79"
 dependencies = [
  "once_cell",
 ]
 
 [[package]]
+name = "rustpython-format"
+version = "0.3.0"
+source = "git+https://github.com/RustPython/Parser.git?tag=0.3.0#a1e4336f7043807eda8a5ecb15d4115172cc4a7e"
+dependencies = [
+ "bitflags 2.3.1",
+ "itertools 0.10.5",
+ "malachite-bigint",
+ "num-traits",
+ "rustpython-literal",
+]
+
+[[package]]
 name = "rustpython-jit"
-version = "0.2.0"
+version = "0.3.0"
 dependencies = [
  "approx",
  "cranelift",
@@ -2057,24 +2143,34 @@ dependencies = [
 ]
 
 [[package]]
+name = "rustpython-literal"
+version = "0.3.0"
+source = "git+https://github.com/RustPython/Parser.git?tag=0.3.0#a1e4336f7043807eda8a5ecb15d4115172cc4a7e"
+dependencies = [
+ "hexf-parse",
+ "is-macro",
+ "lexical-parse-float",
+ "num-traits",
+ "unic-ucd-category",
+]
+
+[[package]]
 name = "rustpython-parser"
-version = "0.2.0"
+version = "0.3.0"
+source = "git+https://github.com/RustPython/Parser.git?tag=0.3.0#a1e4336f7043807eda8a5ecb15d4115172cc4a7e"
 dependencies = [
- "ahash",
  "anyhow",
- "insta",
- "itertools",
- "lalrpop",
+ "is-macro",
+ "itertools 0.10.5",
  "lalrpop-util",
  "log",
- "num-bigint",
+ "malachite-bigint",
  "num-traits",
  "phf",
  "phf_codegen",
  "rustc-hash",
  "rustpython-ast",
- "rustpython-compiler-core",
- "thiserror",
+ "rustpython-parser-core",
  "tiny-keccak",
  "unic-emoji-char",
  "unic-ucd-ident",
@@ -2082,8 +2178,27 @@ dependencies = [
 ]
 
 [[package]]
+name = "rustpython-parser-core"
+version = "0.3.0"
+source = "git+https://github.com/RustPython/Parser.git?tag=0.3.0#a1e4336f7043807eda8a5ecb15d4115172cc4a7e"
+dependencies = [
+ "is-macro",
+ "memchr",
+ "rustpython-parser-vendored",
+]
+
+[[package]]
+name = "rustpython-parser-vendored"
+version = "0.3.0"
+source = "git+https://github.com/RustPython/Parser.git?tag=0.3.0#a1e4336f7043807eda8a5ecb15d4115172cc4a7e"
+dependencies = [
+ "memchr",
+ "once_cell",
+]
+
+[[package]]
 name = "rustpython-pylib"
-version = "0.2.0"
+version = "0.3.0"
 dependencies = [
  "glob",
  "rustpython-compiler-core",
@@ -2092,7 +2207,7 @@ dependencies = [
 
 [[package]]
 name = "rustpython-stdlib"
-version = "0.2.0"
+version = "0.3.0"
 dependencies = [
  "adler32",
  "ahash",
@@ -2104,27 +2219,26 @@ dependencies = [
  "crc32fast",
  "crossbeam-utils",
  "csv-core",
- "digest",
+ "digest 0.10.6",
  "dns-lookup",
+ "dyn-clone",
  "flate2",
  "foreign-types-shared",
  "gethostname",
  "hex",
- "itertools",
- "lexical-parse-float",
+ "itertools 0.10.5",
  "libc",
  "libsqlite3-sys",
  "libz-sys",
  "mac_address",
+ "malachite-bigint",
  "md-5",
  "memchr",
  "memmap2",
  "mt19937",
- "nix 0.24.2",
- "num-bigint",
+ "nix 0.26.2",
  "num-complex",
  "num-integer",
- "num-rational",
  "num-traits",
  "num_enum",
  "once_cell",
@@ -2135,18 +2249,19 @@ dependencies = [
  "parking_lot",
  "paste",
  "puruspe",
- "rand",
- "rand_core",
+ "rand 0.8.5",
+ "rand_core 0.6.4",
  "rustpython-common",
  "rustpython-derive",
  "rustpython-vm",
  "schannel",
  "sha-1",
  "sha2",
- "sha3",
+ "sha3 0.10.6",
  "socket2",
  "system-configuration",
  "termios",
+ "ucd",
  "unic-char-property",
  "unic-normal",
  "unic-ucd-age",
@@ -2163,13 +2278,12 @@ dependencies = [
 
 [[package]]
 name = "rustpython-vm"
-version = "0.2.0"
+version = "0.3.0"
 dependencies = [
- "adler32",
  "ahash",
  "ascii",
  "atty",
- "bitflags",
+ "bitflags 2.3.1",
  "bstr",
  "caseless",
  "cfg-if",
@@ -2178,24 +2292,21 @@ dependencies = [
  "exitcode",
  "flame",
  "flamer",
- "flate2",
- "getrandom",
+ "getrandom 0.2.8",
  "glob",
  "half",
  "hex",
- "hexf-parse",
  "indexmap",
  "is-macro",
- "itertools",
+ "itertools 0.10.5",
  "libc",
  "log",
+ "malachite-bigint",
  "memchr",
  "memoffset 0.6.5",
- "nix 0.24.2",
- "num-bigint",
+ "nix 0.26.2",
  "num-complex",
  "num-integer",
- "num-rational",
  "num-traits",
  "num_cpus",
  "num_enum",
@@ -2203,7 +2314,7 @@ dependencies = [
  "optional",
  "parking_lot",
  "paste",
- "rand",
+ "rand 0.8.5",
  "result-like",
  "rustc_version",
  "rustpython-ast",
@@ -2212,8 +2323,11 @@ dependencies = [
  "rustpython-compiler",
  "rustpython-compiler-core",
  "rustpython-derive",
+ "rustpython-format",
  "rustpython-jit",
+ "rustpython-literal",
  "rustpython-parser",
+ "rustpython-parser-core",
  "rustyline",
  "schannel",
  "serde",
@@ -2240,11 +2354,10 @@ dependencies = [
 
 [[package]]
 name = "rustpython_wasm"
-version = "0.2.0"
+version = "0.3.0"
 dependencies = [
  "console_error_panic_hook",
  "js-sys",
- "parking_lot",
  "rustpython-common",
  "rustpython-parser",
  "rustpython-pylib",
@@ -2259,17 +2372,17 @@ dependencies = [
 
 [[package]]
 name = "rustversion"
-version = "1.0.9"
+version = "1.0.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8"
+checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70"
 
 [[package]]
 name = "rustyline"
-version = "10.0.0"
+version = "11.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d1cd5ae51d3f7bf65d7969d579d502168ef578f289452bd8ccc91de28fda20e"
+checksum = "5dfc8644681285d1fb67a467fb3021bfea306b99b4146b166a1fe3ada965eece"
 dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
  "cfg-if",
  "clipboard-win",
  "dirs-next",
@@ -2277,7 +2390,7 @@ dependencies = [
  "libc",
  "log",
  "memchr",
- "nix 0.24.2",
+ "nix 0.26.2",
  "radix_trie",
  "scopeguard",
  "unicode-segmentation",
@@ -2288,9 +2401,9 @@ dependencies = [
 
 [[package]]
 name = "ryu"
-version = "1.0.11"
+version = "1.0.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09"
+checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde"
 
 [[package]]
 name = "same-file"
@@ -2303,12 +2416,11 @@ dependencies = [
 
 [[package]]
 name = "schannel"
-version = "0.1.20"
+version = "0.1.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2"
+checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3"
 dependencies = [
- "lazy_static 1.4.0",
- "windows-sys 0.36.1",
+ "windows-sys 0.42.0",
 ]
 
 [[package]]
@@ -2319,21 +2431,21 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
 
 [[package]]
 name = "scratch"
-version = "1.0.2"
+version = "1.0.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898"
+checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2"
 
 [[package]]
 name = "semver"
-version = "1.0.14"
+version = "1.0.16"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4"
+checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a"
 
 [[package]]
 name = "serde"
-version = "1.0.147"
+version = "1.0.152"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965"
+checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb"
 dependencies = [
  "serde_derive",
 ]
@@ -2362,9 +2474,9 @@ dependencies = [
 
 [[package]]
 name = "serde_derive"
-version = "1.0.147"
+version = "1.0.152"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852"
+checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -2373,24 +2485,24 @@ dependencies = [
 
 [[package]]
 name = "serde_json"
-version = "1.0.89"
+version = "1.0.93"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db"
+checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76"
 dependencies = [
- "itoa 1.0.4",
+ "itoa",
  "ryu",
  "serde",
 ]
 
 [[package]]
 name = "sha-1"
-version = "0.10.0"
+version = "0.10.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f"
+checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c"
 dependencies = [
  "cfg-if",
  "cpufeatures",
- "digest",
+ "digest 0.10.6",
 ]
 
 [[package]]
@@ -2401,7 +2513,19 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0"
 dependencies = [
  "cfg-if",
  "cpufeatures",
- "digest",
+ "digest 0.10.6",
+]
+
+[[package]]
+name = "sha3"
+version = "0.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809"
+dependencies = [
+ "block-buffer 0.9.0",
+ "digest 0.9.0",
+ "keccak",
+ "opaque-debug",
 ]
 
 [[package]]
@@ -2410,7 +2534,7 @@ version = "0.10.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9"
 dependencies = [
- "digest",
+ "digest 0.10.6",
  "keccak",
 ]
 
@@ -2454,7 +2578,7 @@ version = "0.4.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "a490c5c46c35dba9a6f5e7ee8e4d67e775eb2d2da0f115750b8d10e1c1ac2d28"
 dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
  "num_enum",
  "optional",
 ]
@@ -2472,19 +2596,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0"
 
 [[package]]
-name = "string_cache"
-version = "0.8.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "213494b7a2b503146286049378ce02b482200519accc31872ee8be91fa820a08"
-dependencies = [
- "new_debug_unreachable",
- "once_cell",
- "parking_lot",
- "phf_shared",
- "precomputed-hash",
-]
-
-[[package]]
 name = "strsim"
 version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2517,9 +2628,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
 
 [[package]]
 name = "syn"
-version = "1.0.103"
+version = "1.0.107"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d"
+checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -2541,7 +2652,7 @@ version = "0.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd"
 dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
  "core-foundation",
  "system-configuration-sys",
 ]
@@ -2558,41 +2669,20 @@ dependencies = [
 
 [[package]]
 name = "target-lexicon"
-version = "0.12.5"
+version = "0.12.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9410d0f6853b1d94f0e519fb95df60f29d2c1eff2d921ffdf01a4c8a3b54f12d"
-
-[[package]]
-name = "term"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f"
-dependencies = [
- "dirs-next",
- "rustversion",
- "winapi",
-]
+checksum = "8ae9980cab1db3fceee2f6c6f643d5d8de2997c58ee8d25fb0cc8a9e9e7348e5"
 
 [[package]]
 name = "termcolor"
-version = "1.1.3"
+version = "1.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
+checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6"
 dependencies = [
  "winapi-util",
 ]
 
 [[package]]
-name = "terminal_size"
-version = "0.1.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df"
-dependencies = [
- "libc",
- "winapi",
-]
-
-[[package]]
 name = "termios"
 version = "0.3.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2618,18 +2708,18 @@ checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d"
 
 [[package]]
 name = "thiserror"
-version = "1.0.37"
+version = "1.0.38"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e"
+checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0"
 dependencies = [
  "thiserror-impl",
 ]
 
 [[package]]
 name = "thiserror-impl"
-version = "1.0.37"
+version = "1.0.38"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb"
+checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -2649,18 +2739,19 @@ dependencies = [
 
 [[package]]
 name = "thread_local"
-version = "1.1.4"
+version = "1.1.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180"
+checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152"
 dependencies = [
+ "cfg-if",
  "once_cell",
 ]
 
 [[package]]
 name = "time"
-version = "0.1.44"
+version = "0.1.45"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
+checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a"
 dependencies = [
  "libc",
  "wasi 0.10.0+wasi-snapshot-preview1",
@@ -2703,17 +2794,25 @@ dependencies = [
 
 [[package]]
 name = "tinyvec_macros"
-version = "0.1.0"
+version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
+checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
 
 [[package]]
-name = "toml"
-version = "0.5.9"
+name = "toml_datetime"
+version = "0.5.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7"
+checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5"
+
+[[package]]
+name = "toml_edit"
+version = "0.18.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "56c59d8dd7d0dcbc6428bf7aa2f0e823e26e43b3c9aca15bbc9475d23e5fa12b"
 dependencies = [
- "serde",
+ "indexmap",
+ "nom8",
+ "toml_datetime",
 ]
 
 [[package]]
@@ -2728,9 +2827,15 @@ dependencies = [
 
 [[package]]
 name = "typenum"
-version = "1.15.0"
+version = "1.16.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
+
+[[package]]
+name = "ucd"
+version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
+checksum = "fe4fa6e588762366f1eb4991ce59ad1b93651d0b769dfb4e4d1c5c4b943d1159"
 
 [[package]]
 name = "uname"
@@ -2865,9 +2970,9 @@ checksum = "623f59e6af2a98bdafeb93fa277ac8e1e40440973001ca15cf4ae1541cd16d56"
 
 [[package]]
 name = "unicode-ident"
-version = "1.0.5"
+version = "1.0.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"
+checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc"
 
 [[package]]
 name = "unicode-normalization"
@@ -2880,9 +2985,9 @@ dependencies = [
 
 [[package]]
 name = "unicode-segmentation"
-version = "1.10.0"
+version = "1.10.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a"
+checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36"
 
 [[package]]
 name = "unicode-width"
@@ -2891,16 +2996,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
 
 [[package]]
-name = "unicode-xid"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c"
-
-[[package]]
 name = "unicode_names2"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "029df4cc8238cefc911704ff8fa210853a0f3bce2694d8f51181dd41ee0f3301"
+version = "0.6.0"
+source = "git+https://github.com/youknowone/unicode_names2.git?rev=4ce16aa85cbcdd9cc830410f1a72ef9a235f2fde#4ce16aa85cbcdd9cc830410f1a72ef9a235f2fde"
+dependencies = [
+ "phf",
+]
 
 [[package]]
 name = "utf8parse"
@@ -2910,21 +3011,21 @@ checksum = "936e4b492acfd135421d8dca4b1aa80a7bfc26e702ef3af710e0752684df5372"
 
 [[package]]
 name = "uuid"
-version = "1.2.2"
+version = "1.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "422ee0de9031b5b948b97a8fc04e3aa35230001a722ddd27943e0be31564ce4c"
+checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79"
 dependencies = [
  "atomic",
- "getrandom",
- "rand",
+ "getrandom 0.2.8",
+ "rand 0.8.5",
  "uuid-macro-internal",
 ]
 
 [[package]]
 name = "uuid-macro-internal"
-version = "1.2.2"
+version = "1.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73bc89f2894593e665241e0052c3791999e6787b7c4831daa0a5c2e637e276d8"
+checksum = "c1b300a878652a387d2a0de915bdae8f1a548f0c6d45e072fe2688794b656cc9"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -2968,6 +3069,12 @@ dependencies = [
 
 [[package]]
 name = "wasi"
+version = "0.9.0+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
+
+[[package]]
+name = "wasi"
 version = "0.10.0+wasi-snapshot-preview1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
@@ -2980,9 +3087,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
 
 [[package]]
 name = "wasm-bindgen"
-version = "0.2.83"
+version = "0.2.84"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268"
+checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b"
 dependencies = [
  "cfg-if",
  "wasm-bindgen-macro",
@@ -2990,9 +3097,9 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-backend"
-version = "0.2.83"
+version = "0.2.84"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142"
+checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9"
 dependencies = [
  "bumpalo",
  "log",
@@ -3005,9 +3112,9 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-futures"
-version = "0.4.33"
+version = "0.4.34"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d"
+checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454"
 dependencies = [
  "cfg-if",
  "js-sys",
@@ -3017,9 +3124,9 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-macro"
-version = "0.2.83"
+version = "0.2.84"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810"
+checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5"
 dependencies = [
  "quote",
  "wasm-bindgen-macro-support",
@@ -3027,9 +3134,9 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-macro-support"
-version = "0.2.83"
+version = "0.2.84"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c"
+checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -3040,15 +3147,15 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-shared"
-version = "0.2.83"
+version = "0.2.84"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f"
+checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d"
 
 [[package]]
 name = "web-sys"
-version = "0.3.60"
+version = "0.3.61"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f"
+checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97"
 dependencies = [
  "js-sys",
  "wasm-bindgen",
@@ -3056,9 +3163,9 @@ dependencies = [
 
 [[package]]
 name = "which"
-version = "4.3.0"
+version = "4.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b"
+checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269"
 dependencies = [
  "either",
  "libc",
@@ -3134,20 +3241,74 @@ version = "0.42.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
 dependencies = [
- "windows_aarch64_gnullvm",
- "windows_aarch64_msvc 0.42.0",
- "windows_i686_gnu 0.42.0",
- "windows_i686_msvc 0.42.0",
- "windows_x86_64_gnu 0.42.0",
- "windows_x86_64_gnullvm",
- "windows_x86_64_msvc 0.42.0",
+ "windows_aarch64_gnullvm 0.42.1",
+ "windows_aarch64_msvc 0.42.1",
+ "windows_i686_gnu 0.42.1",
+ "windows_i686_msvc 0.42.1",
+ "windows_x86_64_gnu 0.42.1",
+ "windows_x86_64_gnullvm 0.42.1",
+ "windows_x86_64_msvc 0.42.1",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.45.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
+dependencies = [
+ "windows-targets 0.42.1",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
+dependencies = [
+ "windows-targets 0.48.0",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.42.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7"
+dependencies = [
+ "windows_aarch64_gnullvm 0.42.1",
+ "windows_aarch64_msvc 0.42.1",
+ "windows_i686_gnu 0.42.1",
+ "windows_i686_msvc 0.42.1",
+ "windows_x86_64_gnu 0.42.1",
+ "windows_x86_64_gnullvm 0.42.1",
+ "windows_x86_64_msvc 0.42.1",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5"
+dependencies = [
+ "windows_aarch64_gnullvm 0.48.0",
+ "windows_aarch64_msvc 0.48.0",
+ "windows_i686_gnu 0.48.0",
+ "windows_i686_msvc 0.48.0",
+ "windows_x86_64_gnu 0.48.0",
+ "windows_x86_64_gnullvm 0.48.0",
+ "windows_x86_64_msvc 0.48.0",
 ]
 
 [[package]]
 name = "windows_aarch64_gnullvm"
-version = "0.42.0"
+version = "0.42.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"
+checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608"
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
 
 [[package]]
 name = "windows_aarch64_msvc"
@@ -3163,9 +3324,15 @@ checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2"
 
 [[package]]
 name = "windows_aarch64_msvc"
-version = "0.42.0"
+version = "0.42.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"
+checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
 
 [[package]]
 name = "windows_i686_gnu"
@@ -3181,9 +3348,15 @@ checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b"
 
 [[package]]
 name = "windows_i686_gnu"
-version = "0.42.0"
+version = "0.42.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.48.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"
+checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
 
 [[package]]
 name = "windows_i686_msvc"
@@ -3199,9 +3372,15 @@ checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106"
 
 [[package]]
 name = "windows_i686_msvc"
-version = "0.42.0"
+version = "0.42.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"
+checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
 
 [[package]]
 name = "windows_x86_64_gnu"
@@ -3217,15 +3396,27 @@ checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65"
 
 [[package]]
 name = "windows_x86_64_gnu"
-version = "0.42.0"
+version = "0.42.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"
+checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
 
 [[package]]
 name = "windows_x86_64_gnullvm"
-version = "0.42.0"
+version = "0.42.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.48.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"
+checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
 
 [[package]]
 name = "windows_x86_64_msvc"
@@ -3241,9 +3432,15 @@ checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809"
 
 [[package]]
 name = "windows_x86_64_msvc"
-version = "0.42.0"
+version = "0.42.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
+checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
 
 [[package]]
 name = "winreg"
@@ -3256,9 +3453,9 @@ dependencies = [
 
 [[package]]
 name = "xml-rs"
-version = "0.8.4"
+version = "0.8.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3"
+checksum = "52839dc911083a8ef63efa4d039d1f58b5e409f923e44c80828f206f66e5541c"
 
 [[package]]
 name = "yaml-rust"
diff --git a/pkgs/development/interpreters/python/rustpython/default.nix b/pkgs/development/interpreters/python/rustpython/default.nix
index 68de17f1c99e1..3d10ab361ca3d 100644
--- a/pkgs/development/interpreters/python/rustpython/default.nix
+++ b/pkgs/development/interpreters/python/rustpython/default.nix
@@ -4,35 +4,28 @@
 , fetchFromGitHub
 , SystemConfiguration
 , python3
-, fetchpatch
 }:
 
 rustPlatform.buildRustPackage rec {
   pname = "rustpython";
-  version = "0.2.0";
+  version = "0.3.0";
 
   src = fetchFromGitHub {
     owner = "RustPython";
     repo = "RustPython";
-    rev = "v${version}";
-    hash = "sha256-RNUOBBbq4ca9yEKNj5TZTOQW0hruWOIm/G+YCHoJ19U=";
+    rev = "refs/tags/${version}";
+    hash = "sha256-8tDzgsmKLjsfMT5j5HqrQ93LsGHxmC2DJu5KbR3FNXc=";
   };
 
   cargoLock = {
     lockFile = ./Cargo.lock;
     outputHashes = {
-      "rustpython-doc-0.1.0" = "sha256-4xBiV1FcYA05cWs9fQV+OklZEU1VZunhCo9deOSWPe8=";
+      "rustpython-ast-0.3.0" = "sha256-5IR/G6Y9OE0+gTvU1iTob0TxfiV3O9elA/0BUy2GA8g=";
+      "rustpython-doc-0.3.0" = "sha256-34ERuLFKzUD9Xmf1zlafe42GLWZfUlw17ejf/NN6yH4=";
+      "unicode_names2-0.6.0" = "sha256-eWg9+ISm/vztB0KIdjhq5il2ZnwGJQCleCYfznCI3Wg=";
     };
   };
 
-  patches = [
-    # Fix aarch64 compatibility for sqlite. Remove with the next release. https://github.com/RustPython/RustPython/pull/4499
-    (fetchpatch {
-      url = "https://github.com/RustPython/RustPython/commit/9cac89347e2276fcb309f108561e99f4be5baff2.patch";
-      hash = "sha256-vUPQI/5ec6/36Vdtt7/B2unPDsVrGh5iEiSMBRatxWU=";
-    })
-  ];
-
   # freeze the stdlib into the rustpython binary
   cargoBuildFlags = [ "--features=freeze-stdlib" ];
 
@@ -45,5 +38,10 @@ rustPlatform.buildRustPackage rec {
     homepage = "https://rustpython.github.io";
     license = licenses.mit;
     maintainers = with maintainers; [ prusnak ];
+    #   = note: Undefined symbols for architecture x86_64:
+    #       "_utimensat", referenced from:
+    #           rustpython_vm::function::builtin::IntoPyNativeFn::into_func::... in
+    #           rustpython-10386d81555652a7.rustpython_vm-f0b5bedfcf056d0b.rustpython_vm.7926b68e665728ca-cgu.08.rcgu.o.rcgu.o
+    broken = stdenv.isDarwin && stdenv.isx86_64;
   };
 }
diff --git a/pkgs/development/interpreters/python/tests.nix b/pkgs/development/interpreters/python/tests.nix
index 4ba1b757c3f6a..67670ceb6546a 100644
--- a/pkgs/development/interpreters/python/tests.nix
+++ b/pkgs/development/interpreters/python/tests.nix
@@ -8,7 +8,6 @@
 { stdenv
 , python
 , runCommand
-, substituteAll
 , lib
 , callPackage
 , pkgs
@@ -60,7 +59,7 @@ let
         is_nixenv = "True";
         is_virtualenv = "False";
       };
-    } // lib.optionalAttrs (python.isPy3k && (!python.isPyPy)) rec {
+    } // lib.optionalAttrs (python.isPy3k && (!python.isPyPy)) {
       # Venv built using plain Python
       # Python 2 does not support venv
       # TODO: PyPy executable name is incorrect, it should be pypy-c or pypy-3c instead of pypy and pypy3.
@@ -109,11 +108,15 @@ let
       cpython-gdb = callPackage ./tests/test_cpython_gdb {
         interpreter = python;
       };
-    } // lib.optionalAttrs (python.pythonAtLeast "3.7") rec {
+    } // lib.optionalAttrs (python.pythonAtLeast "3.7") {
       # Before the addition of NIX_PYTHONPREFIX mypy was broken with typed packages
       nix-pythonprefix-mypy = callPackage ./tests/test_nix_pythonprefix {
         interpreter = python;
       };
+      # Make sure tkinter is importable. See https://github.com/NixOS/nixpkgs/issues/238990
+      tkinter = callPackage ./tests/test_tkinter {
+        interpreter = python;
+      };
     }
   );
 
@@ -122,7 +125,7 @@ let
     extension = self: super: {
       foobar = super.numpy;
     };
-  in {
+  in lib.optionalAttrs (python.isPy3k) ({
     test-packageOverrides = let
       myPython = let
         self = python.override {
@@ -146,7 +149,7 @@ let
         ];
       });
     in pkgs_.${python.pythonAttr}.pkgs.foo;
-  };
+  });
 
   condaTests = let
     requests = callPackage ({
@@ -174,7 +177,7 @@ let
       }
     ) {};
     pythonWithRequests = requests.pythonModule.withPackages (ps: [ requests ]);
-    in lib.optionalAttrs stdenv.isLinux
+    in lib.optionalAttrs (python.isPy3k && stdenv.isLinux)
     {
       condaExamplePackage = runCommand "import-requests" {} ''
         ${pythonWithRequests.interpreter} -c "import requests" > $out
diff --git a/pkgs/development/interpreters/python/tests/test_tkinter/default.nix b/pkgs/development/interpreters/python/tests/test_tkinter/default.nix
new file mode 100644
index 0000000000000..67e67d2d1e97e
--- /dev/null
+++ b/pkgs/development/interpreters/python/tests/test_tkinter/default.nix
@@ -0,0 +1,17 @@
+{ interpreter, writeText, runCommand }:
+
+let
+
+  pythonEnv = interpreter.withPackages(ps: [
+    ps.tkinter
+  ]);
+
+  pythonScript = writeText "myscript.py" ''
+    import tkinter
+    print(tkinter)
+  '';
+
+in runCommand "${interpreter.name}-tkinter-test" {} ''
+  ${pythonEnv}/bin/python ${pythonScript}
+  touch $out
+''
diff --git a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py
index 14b3ed4f3f1e4..d9b539926b833 100755
--- a/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py
+++ b/pkgs/development/interpreters/python/update-python-libraries/update-python-libraries.py
@@ -12,23 +12,24 @@ to update all non-pinned libraries in that folder.
 """
 
 import argparse
+import collections
 import json
 import logging
 import os
 import re
-import requests
+import subprocess
 from concurrent.futures import ThreadPoolExecutor as Pool
-from packaging.version import Version as _Version
-from packaging.version import InvalidVersion
+from typing import Any, Optional
+
+import requests
 from packaging.specifiers import SpecifierSet
-from typing import Optional, Any
-import collections
-import subprocess
+from packaging.version import InvalidVersion
+from packaging.version import Version as _Version
 
 INDEX = "https://pypi.io/pypi"
 """url of PyPI"""
 
-EXTENSIONS = ['tar.gz', 'tar.bz2', 'tar', 'zip', '.whl']
+EXTENSIONS = ["tar.gz", "tar.bz2", "tar", "zip", ".whl"]
 """Permitted file extensions. These are evaluated from left to right and the first occurance is returned."""
 
 PRERELEASES = False
@@ -37,13 +38,16 @@ BULK_UPDATE = False
 
 GIT = "git"
 
-NIXPKGS_ROOT = subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).decode('utf-8').strip()
+NIXPKGS_ROOT = (
+    subprocess.check_output(["git", "rev-parse", "--show-toplevel"])
+    .decode("utf-8")
+    .strip()
+)
 
 logging.basicConfig(level=logging.INFO)
 
 
 class Version(_Version, collections.abc.Sequence):
-
     def __init__(self, version):
         super().__init__(version)
         # We cannot use `str(Version(0.04.21))` because that becomes `0.4.21`
@@ -65,7 +69,7 @@ def _get_values(attribute, text):
 
     :returns: List of matches.
     """
-    regex = '{}\s+=\s+"(.*)";'.format(attribute)
+    regex = rf'{re.escape(attribute)}\s+=\s+"(.*)";'
     regex = re.compile(regex)
     values = regex.findall(text)
     return values
@@ -73,14 +77,19 @@ def _get_values(attribute, text):
 
 def _get_attr_value(attr_path: str) -> Optional[Any]:
     try:
-        response = subprocess.check_output([
-            "nix",
-            "--extra-experimental-features", "nix-command",
-            "eval",
-            "-f", f"{NIXPKGS_ROOT}/default.nix",
-            "--json",
-            f"{attr_path}"
-        ])
+        response = subprocess.check_output(
+            [
+                "nix",
+                "--extra-experimental-features",
+                "nix-command",
+                "eval",
+                "-f",
+                f"{NIXPKGS_ROOT}/default.nix",
+                "--json",
+                f"{attr_path}",
+            ],
+            stderr=subprocess.DEVNULL,
+        )
         return json.loads(response.decode())
     except (subprocess.CalledProcessError, ValueError):
         return None
@@ -100,12 +109,13 @@ def _get_unique_value(attribute, text):
     else:
         raise ValueError("no value found for {}".format(attribute))
 
+
 def _get_line_and_value(attribute, text, value=None):
     """Match attribute in text. Return the line and the value of the attribute."""
     if value is None:
-        regex = rf'({attribute}\s+=\s+\"(.*)\";)'
+        regex = rf"({re.escape(attribute)}\s+=\s+\"(.*)\";)"
     else:
-        regex = rf'({attribute}\s+=\s+\"({value})\";)'
+        regex = rf"({re.escape(attribute)}\s+=\s+\"({re.escape(value)})\";)"
     regex = re.compile(regex)
     results = regex.findall(text)
     n = len(results)
@@ -138,7 +148,7 @@ def _fetch_page(url):
 
 def _fetch_github(url):
     headers = {}
-    token = os.environ.get('GITHUB_API_TOKEN')
+    token = os.environ.get("GITHUB_API_TOKEN")
     if token:
         headers["Authorization"] = f"token {token}"
     r = requests.get(url, headers=headers)
@@ -151,31 +161,26 @@ def _fetch_github(url):
 
 def _hash_to_sri(algorithm, value):
     """Convert a hash to its SRI representation"""
-    return subprocess.check_output([
-        "nix",
-        "hash",
-        "to-sri",
-        "--type", algorithm,
-        value
-    ]).decode().strip()
+    return (
+        subprocess.check_output(["nix", "hash", "to-sri", "--type", algorithm, value])
+        .decode()
+        .strip()
+    )
 
 
 def _skip_bulk_update(attr_name: str) -> bool:
-    return bool(_get_attr_value(
-        f"{attr_name}.skipBulkUpdate"
-    ))
+    return bool(_get_attr_value(f"{attr_name}.skipBulkUpdate"))
 
 
 SEMVER = {
-    'major' : 0,
-    'minor' : 1,
-    'patch' : 2,
+    "major": 0,
+    "minor": 1,
+    "patch": 2,
 }
 
 
 def _determine_latest_version(current_version, target, versions):
-    """Determine latest version, given `target`.
-    """
+    """Determine latest version, given `target`."""
     current_version = Version(current_version)
 
     def _parse_versions(versions):
@@ -193,7 +198,7 @@ def _determine_latest_version(current_version, target, versions):
     if len(ceiling) == 0:
         ceiling = None
     else:
-        ceiling[-1]+=1
+        ceiling[-1] += 1
         ceiling = Version(".".join(map(str, ceiling)))
 
     # We do not want prereleases
@@ -210,17 +215,19 @@ def _get_latest_version_pypi(package, extension, current_version, target):
     url = "{}/{}/json".format(INDEX, package)
     json = _fetch_page(url)
 
-    versions = json['releases'].keys()
+    versions = json["releases"].keys()
     version = _determine_latest_version(current_version, target, versions)
 
     try:
-        releases = json['releases'][version]
+        releases = json["releases"][version]
     except KeyError as e:
-        raise KeyError('Could not find version {} for {}'.format(version, package)) from e
+        raise KeyError(
+            "Could not find version {} for {}".format(version, package)
+        ) from e
     for release in releases:
-        if release['filename'].endswith(extension):
+        if release["filename"].endswith(extension):
             # TODO: In case of wheel we need to do further checks!
-            sha256 = release['digests']['sha256']
+            sha256 = release["digests"]["sha256"]
             break
     else:
         sha256 = None
@@ -240,33 +247,40 @@ def _get_latest_version_github(package, extension, current_version, target):
     attr_path = os.environ.get("UPDATE_NIX_ATTR_PATH", f"python3Packages.{package}")
     try:
         homepage = subprocess.check_output(
-            ["nix", "eval", "-f", f"{NIXPKGS_ROOT}/default.nix", "--raw", f"{attr_path}.src.meta.homepage"])\
-            .decode('utf-8')
+            [
+                "nix",
+                "eval",
+                "-f",
+                f"{NIXPKGS_ROOT}/default.nix",
+                "--raw",
+                f"{attr_path}.src.meta.homepage",
+            ]
+        ).decode("utf-8")
     except Exception as e:
         raise ValueError(f"Unable to determine homepage: {e}")
-    owner_repo = homepage[len("https://github.com/"):]  # remove prefix
+    owner_repo = homepage[len("https://github.com/") :]  # remove prefix
     owner, repo = owner_repo.split("/")
 
     url = f"https://api.github.com/repos/{owner}/{repo}/releases"
     all_releases = _fetch_github(url)
-    releases = list(filter(lambda x: not x['prerelease'], all_releases))
+    releases = list(filter(lambda x: not x["prerelease"], all_releases))
 
     if len(releases) == 0:
         raise ValueError(f"{homepage} does not contain any stable releases")
 
-    versions = map(lambda x: strip_prefix(x['tag_name']), releases)
+    versions = map(lambda x: strip_prefix(x["tag_name"]), releases)
     version = _determine_latest_version(current_version, target, versions)
 
-    release = next(filter(lambda x: strip_prefix(x['tag_name']) == version, releases))
-    prefix = get_prefix(release['tag_name'])
+    release = next(filter(lambda x: strip_prefix(x["tag_name"]) == version, releases))
+    prefix = get_prefix(release["tag_name"])
 
     # some attributes require using the fetchgit
     git_fetcher_args = []
-    if (_get_attr_value(f"{attr_path}.src.fetchSubmodules")):
+    if _get_attr_value(f"{attr_path}.src.fetchSubmodules"):
         git_fetcher_args.append("--fetch-submodules")
-    if (_get_attr_value(f"{attr_path}.src.fetchLFS")):
+    if _get_attr_value(f"{attr_path}.src.fetchLFS"):
         git_fetcher_args.append("--fetch-lfs")
-    if (_get_attr_value(f"{attr_path}.src.leaveDotGit")):
+    if _get_attr_value(f"{attr_path}.src.leaveDotGit"):
         git_fetcher_args.append("--leave-dotGit")
 
     if git_fetcher_args:
@@ -274,8 +288,10 @@ def _get_latest_version_github(package, extension, current_version, target):
         cmd = [
             "nix-prefetch-git",
             f"https://github.com/{owner}/{repo}.git",
-            "--hash", algorithm,
-            "--rev", f"refs/tags/{release['tag_name']}"
+            "--hash",
+            algorithm,
+            "--rev",
+            f"refs/tags/{release['tag_name']}",
         ]
         cmd.extend(git_fetcher_args)
         response = subprocess.check_output(cmd)
@@ -283,45 +299,60 @@ def _get_latest_version_github(package, extension, current_version, target):
         hash = _hash_to_sri(algorithm, document[algorithm])
     else:
         try:
-            hash = subprocess.check_output([
-                "nix-prefetch-url",
-                "--type", "sha256",
-                "--unpack",
-                f"{release['tarball_url']}"
-            ], stderr=subprocess.DEVNULL).decode('utf-8').strip()
+            hash = (
+                subprocess.check_output(
+                    [
+                        "nix-prefetch-url",
+                        "--type",
+                        "sha256",
+                        "--unpack",
+                        f"{release['tarball_url']}",
+                    ],
+                    stderr=subprocess.DEVNULL,
+                )
+                .decode("utf-8")
+                .strip()
+            )
         except (subprocess.CalledProcessError, UnicodeError):
             # this may fail if they have both a branch and a tag of the same name, attempt tag name
-            tag_url = str(release['tarball_url']).replace("tarball","tarball/refs/tags")
-            hash = subprocess.check_output([
-                "nix-prefetch-url",
-                "--type", "sha256",
-                "--unpack",
-                tag_url
-            ], stderr=subprocess.DEVNULL).decode('utf-8').strip()
+            tag_url = str(release["tarball_url"]).replace(
+                "tarball", "tarball/refs/tags"
+            )
+            hash = (
+                subprocess.check_output(
+                    ["nix-prefetch-url", "--type", "sha256", "--unpack", tag_url],
+                    stderr=subprocess.DEVNULL,
+                )
+                .decode("utf-8")
+                .strip()
+            )
 
     return version, hash, prefix
 
 
 FETCHERS = {
-    'fetchFromGitHub'   :   _get_latest_version_github,
-    'fetchPypi'         :   _get_latest_version_pypi,
-    'fetchurl'          :   _get_latest_version_pypi,
+    "fetchFromGitHub": _get_latest_version_github,
+    "fetchPypi": _get_latest_version_pypi,
+    "fetchurl": _get_latest_version_pypi,
 }
 
 
-DEFAULT_SETUPTOOLS_EXTENSION = 'tar.gz'
+DEFAULT_SETUPTOOLS_EXTENSION = "tar.gz"
 
 
 FORMATS = {
-    'setuptools'        :   DEFAULT_SETUPTOOLS_EXTENSION,
-    'wheel'             :   'whl',
-    'pyproject'         :   'tar.gz',
-    'flit'              :   'tar.gz'
+    "setuptools": DEFAULT_SETUPTOOLS_EXTENSION,
+    "wheel": "whl",
+    "pyproject": "tar.gz",
+    "flit": "tar.gz",
 }
 
+
 def _determine_fetcher(text):
     # Count occurrences of fetchers.
-    nfetchers = sum(text.count('src = {}'.format(fetcher)) for fetcher in FETCHERS.keys())
+    nfetchers = sum(
+        text.count("src = {}".format(fetcher)) for fetcher in FETCHERS.keys()
+    )
     if nfetchers == 0:
         raise ValueError("no fetcher.")
     elif nfetchers > 1:
@@ -329,7 +360,7 @@ def _determine_fetcher(text):
     else:
         # Then we check which fetcher to use.
         for fetcher in FETCHERS.keys():
-            if 'src = {}'.format(fetcher) in text:
+            if "src = {}".format(fetcher) in text:
                 return fetcher
 
 
@@ -341,47 +372,46 @@ def _determine_extension(text, fetcher):
     - fetchurl, we determine the extension from the url.
     - fetchFromGitHub we simply use `.tar.gz`.
     """
-    if fetcher == 'fetchPypi':
+    if fetcher == "fetchPypi":
         try:
-            src_format = _get_unique_value('format', text)
+            src_format = _get_unique_value("format", text)
         except ValueError:
-            src_format = None   # format was not given
+            src_format = None  # format was not given
 
         try:
-            extension = _get_unique_value('extension', text)
+            extension = _get_unique_value("extension", text)
         except ValueError:
-            extension = None    # extension was not given
+            extension = None  # extension was not given
 
         if extension is None:
             if src_format is None:
-                src_format = 'setuptools'
-            elif src_format == 'other':
+                src_format = "setuptools"
+            elif src_format == "other":
                 raise ValueError("Don't know how to update a format='other' package.")
             extension = FORMATS[src_format]
 
-    elif fetcher == 'fetchurl':
-        url = _get_unique_value('url', text)
+    elif fetcher == "fetchurl":
+        url = _get_unique_value("url", text)
         extension = os.path.splitext(url)[1]
-        if 'pypi' not in url:
-            raise ValueError('url does not point to PyPI.')
+        if "pypi" not in url:
+            raise ValueError("url does not point to PyPI.")
 
-    elif fetcher == 'fetchFromGitHub':
+    elif fetcher == "fetchFromGitHub":
         extension = "tar.gz"
 
     return extension
 
 
 def _update_package(path, target):
-
     # Read the expression
-    with open(path, 'r') as f:
+    with open(path, "r") as f:
         text = f.read()
 
     # Determine pname. Many files have more than one pname
-    pnames = _get_values('pname', text)
+    pnames = _get_values("pname", text)
 
     # Determine version.
-    version = _get_unique_value('version', text)
+    version = _get_unique_value("version", text)
 
     # First we check how many fetchers are mentioned.
     fetcher = _determine_fetcher(text)
@@ -393,8 +423,12 @@ def _update_package(path, target):
     for pname in pnames:
         if BULK_UPDATE and _skip_bulk_update(f"python3Packages.{pname}"):
             raise ValueError(f"Bulk update skipped for {pname}")
+        elif _get_attr_value(f"python3Packages.{pname}.cargoDeps") is not None:
+            raise ValueError(f"Cargo dependencies are unsupported, skipping {pname}")
         try:
-            new_version, new_sha256, prefix = FETCHERS[fetcher](pname, extension, version, target)
+            new_version, new_sha256, prefix = FETCHERS[fetcher](
+                pname, extension, version, target
+            )
             successful_fetch = True
             break
         except ValueError:
@@ -411,7 +445,7 @@ def _update_package(path, target):
     if not new_sha256:
         raise ValueError("no file available for {}.".format(pname))
 
-    text = _replace_value('version', new_version, text)
+    text = _replace_value("version", new_version, text)
 
     # hashes from pypi are 16-bit encoded sha256's, normalize it to sri to avoid merge conflicts
     # sri hashes have been the default format since nix 2.4+
@@ -421,16 +455,16 @@ def _update_package(path, target):
     if old_hash := _get_attr_value(f"python3Packages.{pname}.src.outputHash"):
         # fetchers can specify a sha256, or a sri hash
         try:
-            text = _replace_value('hash', sri_hash, text, old_hash)
+            text = _replace_value("hash", sri_hash, text, old_hash)
         except ValueError:
-            text = _replace_value('sha256', sri_hash, text, old_hash)
+            text = _replace_value("sha256", sri_hash, text, old_hash)
     else:
         raise ValueError(f"Unable to retrieve old hash for {pname}")
 
-    if fetcher == 'fetchFromGitHub':
+    if fetcher == "fetchFromGitHub":
         # in the case of fetchFromGitHub, it's common to see `rev = version;` or `rev = "v${version}";`
         # in which no string value is meant to be substituted. However, we can just overwrite the previous value.
-        regex = '(rev\s+=\s+[^;]*;)'
+        regex = r"(rev\s+=\s+[^;]*;)"
         regex = re.compile(regex)
         matches = regex.findall(text)
         n = len(matches)
@@ -442,30 +476,33 @@ def _update_package(path, target):
             match = matches[0]
             text = text.replace(match, f'rev = "refs/tags/{prefix}${{version}}";')
             # incase there's no prefix, just rewrite without interpolation
-            text = text.replace('"${version}";', 'version;')
+            text = text.replace('"${version}";', "version;")
 
-    with open(path, 'w') as f:
+    with open(path, "w") as f:
         f.write(text)
 
-        logging.info("Path {}: updated {} from {} to {}".format(path, pname, version, new_version))
+        logging.info(
+            "Path {}: updated {} from {} to {}".format(
+                path, pname, version, new_version
+            )
+        )
 
     result = {
-        'path'  : path,
-        'target': target,
-        'pname': pname,
-        'old_version'   : version,
-        'new_version'   : new_version,
+        "path": path,
+        "target": target,
+        "pname": pname,
+        "old_version": version,
+        "new_version": new_version,
         #'fetcher'       : fetcher,
-        }
+    }
 
     return result
 
 
 def _update(path, target):
-
     # We need to read and modify a Nix expression.
     if os.path.isdir(path):
-        path = os.path.join(path, 'default.nix')
+        path = os.path.join(path, "default.nix")
 
     # If a default.nix does not exist, we quit.
     if not os.path.isfile(path):
@@ -485,32 +522,41 @@ def _update(path, target):
 
 
 def _commit(path, pname, old_version, new_version, pkgs_prefix="python: ", **kwargs):
-    """Commit result.
-    """
+    """Commit result."""
+
+    msg = f"{pkgs_prefix}{pname}: {old_version} -> {new_version}"
 
-    msg = f'{pkgs_prefix}{pname}: {old_version} -> {new_version}'
+    if changelog := _get_attr_value(f"{pkgs_prefix}{pname}.meta.changelog"):
+        msg += f"\n\n{changelog}"
 
     try:
-        subprocess.check_call([GIT, 'add', path])
-        subprocess.check_call([GIT, 'commit', '-m', msg])
+        subprocess.check_call([GIT, "add", path])
+        subprocess.check_call([GIT, "commit", "-m", msg])
     except subprocess.CalledProcessError as e:
-        subprocess.check_call([GIT, 'checkout', path])
-        raise subprocess.CalledProcessError(f'Could not commit {path}') from e
+        subprocess.check_call([GIT, "checkout", path])
+        raise subprocess.CalledProcessError(f"Could not commit {path}") from e
 
     return True
 
 
 def main():
-
     epilog = """
 environment variables:
   GITHUB_API_TOKEN\tGitHub API token used when updating github packages
     """
-    parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, epilog=epilog)
-    parser.add_argument('package', type=str, nargs='+')
-    parser.add_argument('--target', type=str, choices=SEMVER.keys(), default='major')
-    parser.add_argument('--commit', action='store_true', help='Create a commit for each package update')
-    parser.add_argument('--use-pkgs-prefix', action='store_true', help='Use python3Packages.${pname}: instead of python: ${pname}: when making commits')
+    parser = argparse.ArgumentParser(
+        formatter_class=argparse.RawDescriptionHelpFormatter, epilog=epilog
+    )
+    parser.add_argument("package", type=str, nargs="+")
+    parser.add_argument("--target", type=str, choices=SEMVER.keys(), default="major")
+    parser.add_argument(
+        "--commit", action="store_true", help="Create a commit for each package update"
+    )
+    parser.add_argument(
+        "--use-pkgs-prefix",
+        action="store_true",
+        help="Use python3Packages.${pname}: instead of python: ${pname}: when making commits",
+    )
 
     args = parser.parse_args()
     target = args.target
@@ -519,7 +565,7 @@ environment variables:
 
     if len(packages) > 1:
         global BULK_UPDATE
-        BULK_UPDATE = true
+        BULK_UPDATE = True
 
     logging.info("Updating packages...")
 
@@ -545,6 +591,5 @@ environment variables:
     logging.info("{} package(s) updated".format(count))
 
 
-
-if __name__ == '__main__':
+if __name__ == "__main__":
     main()
diff --git a/pkgs/development/interpreters/python/wrap-python.nix b/pkgs/development/interpreters/python/wrap-python.nix
index c67a8e0885149..8817d091a283a 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/python/wrapper.nix b/pkgs/development/interpreters/python/wrapper.nix
index b36662335abe2..f5f9b03e0fd3c 100644
--- a/pkgs/development/interpreters/python/wrapper.nix
+++ b/pkgs/development/interpreters/python/wrapper.nix
@@ -42,7 +42,7 @@ let
             if [ -f "$prg" ]; then
               rm -f "$out/bin/$prg"
               if [ -x "$prg" ]; then
-                makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set NIX_PYTHONPREFIX "$out" --set NIX_PYTHONEXECUTABLE ${pythonExecutable} --set NIX_PYTHONPATH ${pythonPath} ${if permitUserSite then "" else ''--set PYTHONNOUSERSITE "true"''} ${lib.concatStringsSep " " makeWrapperArgs}
+                makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set NIX_PYTHONPREFIX "$out" --set NIX_PYTHONEXECUTABLE ${pythonExecutable} --set NIX_PYTHONPATH ${pythonPath} ${lib.optionalString (!permitUserSite) ''--set PYTHONNOUSERSITE "true"''} ${lib.concatStringsSep " " makeWrapperArgs}
               fi
             fi
           done
diff --git a/pkgs/development/interpreters/quickjs/default.nix b/pkgs/development/interpreters/quickjs/default.nix
index cc5487183db38..2f548207ea047 100644
--- a/pkgs/development/interpreters/quickjs/default.nix
+++ b/pkgs/development/interpreters/quickjs/default.nix
@@ -6,15 +6,19 @@
 
 stdenv.mkDerivation rec {
   pname = "quickjs";
-  version = "2021-03-27";
+  version = "2021-12-09";
 
   src = fetchFromGitHub {
     owner = "bellard";
     repo = pname;
-    rev = "b5e62895c619d4ffc75c9d822c8d85f1ece77e5b";
-    hash = "sha256-VMaxVVQuJ3DAwYrC14uJqlRBg0//ugYvtyhOXsTUbCA=";
+    rev = "daa35bc1e5d43192098af9b51caeb4f18f73f9f9";
+    hash = "sha256-BhAsa8tumCQ4jK/TbRbptj2iOIUFFjU1MQYdIrDMpko=";
   };
 
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace Makefile --replace "CONFIG_LTO=y" ""
+  '';
+
   makeFlags = [ "prefix=${placeholder "out"}" ];
   enableParallelBuilding = true;
 
@@ -45,15 +49,15 @@ stdenv.mkDerivation rec {
     temp=$(mktemp).js
     echo "console.log('Output from compiled program');" > "$temp"
     set -o verbose
-    out=$(mktemp) && qjsc         "$temp" -o "$out" && "$out" | grep -q "Output from compiled program"
-    out=$(mktemp) && qjsc   -flto "$temp" -o "$out" && "$out" | grep -q "Output from compiled program"
+    out=$(mktemp) && qjsc         -o "$out" "$temp" && "$out" | grep -q "Output from compiled program"
+    out=$(mktemp) && qjsc   -flto -o "$out" "$temp" && "$out" | grep -q "Output from compiled program"
   '';
 
   meta = with lib; {
     description = "A small and embeddable Javascript engine";
     homepage = "https://bellard.org/quickjs/";
     maintainers = with maintainers; [ stesie AndersonTorres ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     license = licenses.mit;
     mainProgram = "qjs";
   };
diff --git a/pkgs/development/interpreters/racket/default.nix b/pkgs/development/interpreters/racket/default.nix
index 03f6fb31cb546..38fdd0f71d7fd 100644
--- a/pkgs/development/interpreters/racket/default.nix
+++ b/pkgs/development/interpreters/racket/default.nix
@@ -9,7 +9,6 @@
 , libGL
 , libGLU
 , libjpeg
-, xorg
 , ncurses
 , libpng, libtool, mpfr, openssl, pango, poppler
 , readline, sqlite
@@ -25,7 +24,7 @@ let
     fontDirectories = [ freefont_ttf ];
   };
 
-  libPath = lib.makeLibraryPath [
+  libPath = lib.makeLibraryPath ([
     cairo
     fontconfig
     glib
@@ -33,8 +32,6 @@ let
     gtk3
     gsettings-desktop-schemas
     libedit
-    libGL
-    libGLU
     libjpeg
     libpng
     mpfr
@@ -44,22 +41,25 @@ let
     poppler
     readline
     sqlite
-  ];
+  ] ++ lib.optionals (!stdenv.isDarwin) [
+    libGL
+    libGLU
+  ]);
 
 in
 
 stdenv.mkDerivation rec {
   pname = "racket";
-  version = "8.8"; # always change at once with ./minimal.nix
+  version = "8.11.1"; # always change at once with ./minimal.nix
 
-  src = (lib.makeOverridable ({ name, sha256 }:
+  src = (lib.makeOverridable ({ name, hash }:
     fetchurl {
       url = "https://mirror.racket-lang.org/installers/${version}/${name}-src.tgz";
-      inherit sha256;
+      inherit hash;
     }
   )) {
     name = "${pname}-${version}";
-    sha256 = "sha256-OYQi4rQjc+FOTg+W2j2Vy1dEJHuj9z6pmBX7aTwnFKs=";
+    hash = "sha256-5ZqwMLkqeONYnsQFxdJfpRdojCCZAjO9aMs0Vo1lTAU=";
   };
 
   FONTCONFIG_FILE = fontsConf;
@@ -98,6 +98,10 @@ stdenv.mkDerivation rec {
         --replace /bin/true ${coreutils}/bin/true
     done
 
+    # Remove QuickScript register.rkt because it breaks on sandbox
+    # https://github.com/Metaxal/quickscript/issues/73
+    rm -f share/pkgs/quickscript/register.rkt
+
     # The configure script forces using `libtool -o` as AR on Darwin. But, the
     # `-o` option is only available from Apple libtool. GNU ar works here.
     substituteInPlace src/ChezScheme/zlib/configure \
@@ -131,12 +135,14 @@ stdenv.mkDerivation rec {
   shared = if stdenv.isDarwin then "dylib" else "shared";
   configureFlags = [ "--enable-${shared}"  "--enable-lt=${libtool}/bin/libtool" ]
                    ++ lib.optionals disableDocs [ "--disable-docs" ]
-                   ++ lib.optionals stdenv.isDarwin [ "--enable-xonx" ];
+                   ++ lib.optionals stdenv.isDarwin [ "--disable-strip" "--enable-xonx" ];
 
   configureScript = "../configure";
 
   enableParallelBuilding = false;
 
+  dontStrip = stdenv.isDarwin;
+
   meta = with lib; {
     description = "A programmable programming language";
     longDescription = ''
@@ -149,8 +155,9 @@ stdenv.mkDerivation rec {
       GUIs and charts.
     '';
     homepage = "https://racket-lang.org/";
+    changelog = "https://github.com/racket/racket/releases/tag/v${version}";
     license = with licenses; [ asl20 /* or */ mit ];
-    maintainers = with maintainers; [ henrytill vrthra ];
+    maintainers = with maintainers; [ vrthra ];
     platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
   };
 }
diff --git a/pkgs/development/interpreters/racket/minimal.nix b/pkgs/development/interpreters/racket/minimal.nix
index c52869344a6af..73143f432d7fe 100644
--- a/pkgs/development/interpreters/racket/minimal.nix
+++ b/pkgs/development/interpreters/racket/minimal.nix
@@ -6,7 +6,7 @@ racket.overrideAttrs (oldAttrs: rec {
   version = oldAttrs.version;
   src = oldAttrs.src.override {
     name = "${pname}-${version}";
-    sha256 = "sha256-KaYT1PzHtGYej3CZEnensGiFaR9+487XueiZf3e+hQU=";
+    hash = "sha256-H1X9bhQw9yOaESbK4+tveFWVb4EyMNGLKukwKAo588w=";
   };
 
   meta = oldAttrs.meta // {
@@ -16,6 +16,5 @@ racket.overrideAttrs (oldAttrs: rec {
       and the pkg library are still bundled.
     '';
     platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
-    broken = false; # Minimal build does not require working FFI
   };
 })
diff --git a/pkgs/development/interpreters/racket/racket_7_9.nix b/pkgs/development/interpreters/racket/racket_7_9.nix
index ac4b6b5ba1800..836bc879dbbca 100644
--- a/pkgs/development/interpreters/racket/racket_7_9.nix
+++ b/pkgs/development/interpreters/racket/racket_7_9.nix
@@ -104,7 +104,7 @@ stdenv.mkDerivation rec {
     '';
     homepage = "https://racket-lang.org/";
     license = with licenses; [ asl20 /* or */ mit ];
-    maintainers = with maintainers; [ henrytill vrthra ];
+    maintainers = with maintainers; [ vrthra ];
     platforms = [ "x86_64-darwin" "x86_64-linux" "aarch64-linux" ];
     broken = stdenv.isDarwin; # No support yet for setting FFI lookup path
   };
diff --git a/pkgs/development/interpreters/rakudo/default.nix b/pkgs/development/interpreters/rakudo/default.nix
index 5acec350035c7..db3153dc370fd 100644
--- a/pkgs/development/interpreters/rakudo/default.nix
+++ b/pkgs/development/interpreters/rakudo/default.nix
@@ -1,12 +1,15 @@
-{ stdenv, fetchurl, perl, icu, zlib, gmp, lib, nqp, removeReferencesTo }:
+{ stdenv, fetchFromGitHub, perl, icu, zlib, gmp, lib, nqp, removeReferencesTo }:
 
 stdenv.mkDerivation rec {
   pname = "rakudo";
-  version = "2023.02";
+  version = "2023.08";
 
-  src = fetchurl {
-    url = "https://rakudo.org/dl/rakudo/rakudo-${version}.tar.gz";
-    hash = "sha256-/RaGqizzLrnw630Nb5bfyJfPU8z4ntp9Iltoc4CTqhE=";
+  src = fetchFromGitHub {
+    owner = "rakudo";
+    repo = "rakudo";
+    rev = version;
+    hash = "sha256-wvHMyXMkI2RarmUeC8lKGgy3TNmVQsZo/3D/eS4FUrI=";
+    fetchSubmodules = true;
   };
 
   nativeBuildInputs = [ removeReferencesTo ];
diff --git a/pkgs/development/interpreters/rakudo/moarvm.nix b/pkgs/development/interpreters/rakudo/moarvm.nix
index ca31f0305b97c..d914b7a1fac22 100644
--- a/pkgs/development/interpreters/rakudo/moarvm.nix
+++ b/pkgs/development/interpreters/rakudo/moarvm.nix
@@ -1,6 +1,7 @@
 { lib
 , stdenv
-, fetchurl
+, fetchFromGitHub
+, cctools-port
 , perl
 , CoreServices
 , ApplicationServices
@@ -8,11 +9,14 @@
 
 stdenv.mkDerivation rec {
   pname = "moarvm";
-  version = "2023.02";
+  version = "2023.10";
 
-  src = fetchurl {
-    url = "https://moarvm.org/releases/MoarVM-${version}.tar.gz";
-    hash = "sha256-Z+IU1E1fYmeHyn8EQkBDpjkwikOnd3tvpBkmtyQODcU=";
+  src = fetchFromGitHub {
+    owner = "moarvm";
+    repo = "moarvm";
+    rev = version;
+    hash = "sha256-1w6oMoxDro/AHE+QvjKUx9cxNpYuVSXYrRMh31ksgoQ=";
+    fetchSubmodules = true;
   };
 
   postPatch = ''
@@ -26,6 +30,10 @@ stdenv.mkDerivation rec {
       --replace '`sw_vers -productVersion`' '"$MACOSX_DEPLOYMENT_TARGET"'
   '';
 
+  nativeBuildInputs = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
+    cctools-port
+  ];
+
   buildInputs = [ perl ] ++ lib.optionals stdenv.isDarwin [ CoreServices ApplicationServices ];
   doCheck = false; # MoarVM does not come with its own test suite
 
diff --git a/pkgs/development/interpreters/rakudo/nqp.nix b/pkgs/development/interpreters/rakudo/nqp.nix
index e238e5c204503..c774a65d01c4e 100644
--- a/pkgs/development/interpreters/rakudo/nqp.nix
+++ b/pkgs/development/interpreters/rakudo/nqp.nix
@@ -1,12 +1,15 @@
-{ stdenv, fetchurl, perl, lib, moarvm }:
+{ stdenv, fetchFromGitHub, perl, lib, moarvm }:
 
 stdenv.mkDerivation rec {
   pname = "nqp";
-  version = "2023.02";
-
-  src = fetchurl {
-    url = "https://github.com/raku/nqp/releases/download/${version}/nqp-${version}.tar.gz";
-    hash = "sha256-417V7ZTsMqbXMO6BW/hcX8+IqGf6xlZjaMGtSf5jtT8=";
+  version = "2023.08";
+
+  src = fetchFromGitHub {
+    owner = "raku";
+    repo = "nqp";
+    rev = version;
+    hash = "sha256-kVNj6zDT0z6eFxtTovpT1grbl0pygsPKkFoVcFW7baI=";
+    fetchSubmodules = true;
   };
 
   buildInputs = [ perl ];
diff --git a/pkgs/development/interpreters/rakudo/zef.nix b/pkgs/development/interpreters/rakudo/zef.nix
index b9388663ca36a..2ce4a164f7e6e 100644
--- a/pkgs/development/interpreters/rakudo/zef.nix
+++ b/pkgs/development/interpreters/rakudo/zef.nix
@@ -1,35 +1,50 @@
-{ lib, stdenv, fetchFromGitHub, rakudo, makeWrapper }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, rakudo
+, makeBinaryWrapper
+}:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "zef";
-  version = "0.18.1";
+  version = "0.21.1";
 
   src = fetchFromGitHub {
     owner = "ugexe";
     repo = "zef";
-    rev = "v${version}";
-    sha256 = "sha256-F4q8cHM1CLp9FLZTo6WmxEiK2sqmAx3LOHevNXn2kOw=";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-ji+KTxAOPZhuGryK0+svsVkU+HC1egKZWOboSBUON+s=";
   };
 
-  nativeBuildInputs = [ makeWrapper ];
-  buildInputs = [ rakudo ];
+  nativeBuildInputs = [
+    makeBinaryWrapper
+  ];
+
+  buildInputs = [
+    rakudo
+  ];
 
   installPhase = ''
+    runHook preInstall
+
     mkdir -p "$out"
     # TODO: Find better solution. zef stores cache stuff in $HOME with the
     # default config.
     env HOME=$TMPDIR ${rakudo}/bin/raku -I. ./bin/zef --/depends --/test-depends --/build-depends --install-to=$out install .
+
+    runHook postInstall
   '';
 
   postFixup =''
     wrapProgram $out/bin/zef --prefix RAKUDOLIB , "inst#$out"
   '';
 
-  meta = with lib; {
+  meta = {
     description = "Raku / Perl6 Module Management";
     homepage    = "https://github.com/ugexe/zef";
-    license     = licenses.artistic2;
-    platforms   = platforms.unix;
-    maintainers = with maintainers; [ sgo ];
+    license     = lib.licenses.artistic2;
+    mainProgram = "zef";
+    maintainers = with lib.maintainers; [ sgo ];
+    platforms   = lib.platforms.unix;
   };
-}
+})
diff --git a/pkgs/development/interpreters/rascal/default.nix b/pkgs/development/interpreters/rascal/default.nix
index fa54a421ccc16..aab9fffcd6052 100644
--- a/pkgs/development/interpreters/rascal/default.nix
+++ b/pkgs/development/interpreters/rascal/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "rascal";
-  version = "0.6.2";
+  version = "0.28.2";
 
   src = fetchurl {
     url = "https://update.rascal-mpl.org/console/${pname}-${version}.jar";
-    sha256 = "1z4mwdbdc3r24haljnxng8znlfg2ihm9bf9zq8apd9a32ipcw4i6";
+    sha256 = "sha256-KMoGTegjXuGSzNnwH6SkcM5GC/F3oluvFrlJ51Pms3M=";
   };
 
   nativeBuildInputs = [ makeWrapper ];
diff --git a/pkgs/development/interpreters/regina/default.nix b/pkgs/development/interpreters/regina/default.nix
deleted file mode 100644
index 79258d2cc0fa0..0000000000000
--- a/pkgs/development/interpreters/regina/default.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ lib, stdenv, fetchurl, ncurses }:
-
-stdenv.mkDerivation rec {
-  pname = "Regina-REXX";
-  version = "3.9.1";
-
-  src = fetchurl {
-    url = "mirror://sourceforge/regina-rexx/regina-rexx/${version}/${pname}-${version}.tar.gz";
-    sha256 = "1vpksnjmg6y5zag9li6sxqxj2xapgalfz8krfxgg49vyk0kdy4sx";
-  };
-
-  buildInputs = [ ncurses ];
-
-  configureFlags = [
-    "--libdir=$(out)/lib"
-  ];
-
-  meta = with lib; {
-    description = "REXX interpreter";
-    maintainers = [ maintainers.raskin ];
-    platforms = platforms.linux;
-    license = licenses.lgpl2;
-  };
-}
diff --git a/pkgs/development/interpreters/renpy/default.nix b/pkgs/development/interpreters/renpy/default.nix
index bee024829cefb..b68c540b39cff 100644
--- a/pkgs/development/interpreters/renpy/default.nix
+++ b/pkgs/development/interpreters/renpy/default.nix
@@ -3,34 +3,36 @@
 , makeWrapper
 }:
 
-stdenv.mkDerivation rec {
-  pname = "renpy";
-
+let
   # https://renpy.org/doc/html/changelog.html#versioning
   # base_version is of the form major.minor.patch
   # vc_version is of the form YYMMDDCC
   # version corresponds to the tag on GitHub
-  base_version = "8.0.3";
-  vc_version = "22090809";
+  base_version = "8.1.1";
+  vc_version = "23060707";
+in stdenv.mkDerivation rec {
+  pname = "renpy";
+
   version = "${base_version}.${vc_version}";
 
   src = fetchFromGitHub {
     owner = "renpy";
     repo = "renpy";
     rev = version;
-    sha256 = "sha256-0/wkUk7PMPbBSGzDuSd82yxRzvAYxkbEhM5LTVt4bMA=";
+    sha256 = "sha256-aJ/MobZ6SNBYRC/EpUxAMLJ3pwK6PC92DV0YL/LF5Ew=";
   };
 
   nativeBuildInputs = [
     pkg-config
     makeWrapper
     python3.pkgs.cython
+    python3.pkgs.setuptools
   ];
 
   buildInputs = [
     SDL2 libpng ffmpeg freetype glew libGLU libGL fribidi zlib
   ] ++ (with python3.pkgs; [
-    python pygame_sdl2 tkinter future six pefile requests
+    python pygame_sdl2 tkinter future six pefile requests ecdsa
   ]);
 
   RENPY_DEPS_INSTALL = lib.concatStringsSep "::" (map (path: path) [
@@ -40,33 +42,31 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   patches = [
-    ./renpy-system-fribidi.diff
     ./shutup-erofs-errors.patch
   ];
 
   postPatch = ''
-    substituteInPlace module/setup.py \
-      --replace "@fribidi@" "${fribidi}"
-
     cp tutorial/game/tutorial_director.rpy{m,}
 
     cat > renpy/vc_version.py << EOF
-    vc_version = ${vc_version}
+    version = '${version}'
     official = False
     nightly = False
+    # Look at https://renpy.org/latest.html for what to put.
+    version_name = 'Where No One Has Gone Before'
     EOF
   '';
 
   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 --prefix=$out
+    ${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
 
@@ -87,4 +87,6 @@ stdenv.mkDerivation rec {
     platforms = platforms.linux;
     maintainers = with maintainers; [ shadowrz ];
   };
+
+  passthru = { inherit base_version vc_version; };
 }
diff --git a/pkgs/development/interpreters/renpy/renpy-system-fribidi.diff b/pkgs/development/interpreters/renpy/renpy-system-fribidi.diff
deleted file mode 100644
index 8c93b75a7b0fc..0000000000000
--- a/pkgs/development/interpreters/renpy/renpy-system-fribidi.diff
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/module/renpybidicore.c b/module/renpybidicore.c
-index 849430d..d883a52 100644
---- a/module/renpybidicore.c
-+++ b/module/renpybidicore.c
-@@ -1,10 +1,6 @@
- #include <Python.h>
- 
--#ifdef RENPY_BUILD
- #include <fribidi.h>
--#else
--#include <fribidi-src/lib/fribidi.h>
--#endif
- 
- #include <stdlib.h>
- 
-diff --git a/module/setup.py b/module/setup.py
-index bd16816..f6b8794 100755
---- a/module/setup.py
-+++ b/module/setup.py
-@@ -118,29 +118,17 @@ cython(
-     sdl + [ png, 'z', 'm' ])
- 
- FRIBIDI_SOURCES = """
--fribidi-src/lib/fribidi.c
--fribidi-src/lib/fribidi-arabic.c
--fribidi-src/lib/fribidi-bidi.c
--fribidi-src/lib/fribidi-bidi-types.c
--fribidi-src/lib/fribidi-deprecated.c
--fribidi-src/lib/fribidi-joining.c
--fribidi-src/lib/fribidi-joining-types.c
--fribidi-src/lib/fribidi-mem.c
--fribidi-src/lib/fribidi-mirroring.c
--fribidi-src/lib/fribidi-run.c
--fribidi-src/lib/fribidi-shape.c
- renpybidicore.c
- """.split()
- cython(
-     "_renpybidi",
-     FRIBIDI_SOURCES,
-+    ["fribidi"],
-     includes=[
--        BASE + "/fribidi-src/",
--        BASE + "/fribidi-src/lib/",
-+        "@fribidi@/include/fribidi/",
-         ],
-     define_macros=[
-         ("FRIBIDI_ENTRY", ""),
--        ("HAVE_CONFIG_H", "1"),
-         ])
- 
- if not (android or ios or emscripten):
diff --git a/pkgs/development/interpreters/renpy/shutup-erofs-errors.patch b/pkgs/development/interpreters/renpy/shutup-erofs-errors.patch
index 519840383b8d3..9889c9f8ef858 100644
--- a/pkgs/development/interpreters/renpy/shutup-erofs-errors.patch
+++ b/pkgs/development/interpreters/renpy/shutup-erofs-errors.patch
@@ -1,7 +1,7 @@
-From 1660c8f20ac807fcd0ce65a8b9dc31e646a40711 Mon Sep 17 00:00:00 2001
+From 09e598ddf1f6af72ccb6c7c9301abff689e64f88 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?=E5=A4=9C=E5=9D=82=E9=9B=85?=
  <23130178+ShadowRZ@users.noreply.github.com>
-Date: Sat, 13 Aug 2022 19:26:42 +0800
+Date: Wed, 17 May 2023 14:32:03 +0800
 Subject: [PATCH] Don't print a backtrace on EROFS
 
 This can shut up EROFS errors caused by writing to read-only /nix/store.
@@ -10,20 +10,20 @@ This can shut up EROFS errors caused by writing to read-only /nix/store.
  1 file changed, 4 insertions(+)
 
 diff --git a/renpy/script.py b/renpy/script.py
-index 3e5dae8..8f103c1 100644
+index de35457ba..b7d511560 100644
 --- a/renpy/script.py
 +++ b/renpy/script.py
-@@ -656,6 +656,10 @@ class Script(object):
-                             rpydigest = hashlib.md5(fullf.read()).digest()
+@@ -705,6 +705,10 @@ class Script(object):
+                                 rpydigest = hashlib.md5(fullf.read()).digest()
  
-                         self.write_rpyc_md5(f, rpydigest)
-+                except OSError as e:
-+                    if e.errno != 30:
-+                        import traceback
-+                        traceback.print_exc()
-                 except Exception:
-                     import traceback
-                     traceback.print_exc()
+                             self.write_rpyc_md5(f, rpydigest)
++                    except OSError as e:
++                        if e.errno != 30:
++                            import traceback
++                            traceback.print_exc()
+                     except Exception:
+                         import traceback
+                         traceback.print_exc()
 -- 
-2.37.1
+2.40.1
 
diff --git a/pkgs/development/interpreters/risor/default.nix b/pkgs/development/interpreters/risor/default.nix
new file mode 100644
index 0000000000000..1408b196f4a37
--- /dev/null
+++ b/pkgs/development/interpreters/risor/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, buildGo121Module
+, fetchFromGitHub
+, testers
+, risor
+}:
+
+buildGo121Module rec {
+  pname = "risor";
+  version = "1.1.2";
+
+  src = fetchFromGitHub {
+    owner = "risor-io";
+    repo = "risor";
+    rev = "v${version}";
+    hash = "sha256-7/pGC2+7KKc+1JZrPnchG3/Zj15lfcvTppuFUcpu/aU=";
+  };
+
+  proxyVendor = true;
+  vendorHash = "sha256-6Zb30IXZsRQ0mvJOf4yDPkk7I+s18ok/V90mSKB/Ev4=";
+
+  subPackages = [
+    "cmd/risor"
+  ];
+
+  ldflags = [
+    "-s"
+    "-w"
+    "-X=main.version=${version}"
+  ];
+
+  passthru.tests = {
+    version = testers.testVersion {
+      package = risor;
+      command = "risor version";
+    };
+  };
+
+  meta = with lib; {
+    description = "Fast and flexible scripting for Go developers and DevOps";
+    homepage = "https://github.com/risor-io/risor";
+    changelog = "https://github.com/risor-io/risor/releases/tag/${src.rev}";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
+
diff --git a/pkgs/development/interpreters/rlci/default.nix b/pkgs/development/interpreters/rlci/default.nix
new file mode 100644
index 0000000000000..ce8e0a9ee8f28
--- /dev/null
+++ b/pkgs/development/interpreters/rlci/default.nix
@@ -0,0 +1,26 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "rlci";
+  version = "1.1.2";
+
+  src = fetchFromGitHub {
+    owner = "orsinium-labs";
+    repo = "rlci";
+    rev = version;
+    hash = "sha256-+Hd1Ymm2LKnHUKoUlfN6D6pwebxgwJQHgqwMHXXtP6Y=";
+  };
+
+  cargoHash = "sha256-7Q6WSEiVLzRsyHNECbPhWN9prrN0A/nSJDtZWi09zzg=";
+
+  meta = with lib; {
+    description = "A lambda calculus interpreter";
+    homepage = "https://github.com/orsinium-labs/rlci";
+    changelog = "https://github.com/orsinium-labs/rlci/releases/tag/${src.rev}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix
index 99a77bfedc7c0..3ccbe1e855a3a 100644
--- a/pkgs/development/interpreters/ruby/default.nix
+++ b/pkgs/development/interpreters/ruby/default.nix
@@ -2,7 +2,7 @@
 , fetchurl, fetchpatch, fetchFromSavannah, fetchFromGitHub
 , zlib, gdbm, ncurses, readline, groff, libyaml, libffi, jemalloc, autoreconfHook, bison
 , autoconf, libiconv, libobjc, libunwind, Foundation
-, buildEnv, bundler, bundix, rustPlatform
+, buildEnv, bundler, bundix, cargo, rustPlatform, rustc
 , makeBinaryWrapper, buildRubyGem, defaultGemConfig, removeReferencesTo
 , openssl, openssl_1_1
 , linuxPackages, libsystemtap
@@ -23,6 +23,8 @@ let
     atLeast30 = lib.versionAtLeast ver.majMin "3.0";
     atLeast31 = lib.versionAtLeast ver.majMin "3.1";
     atLeast32 = lib.versionAtLeast ver.majMin "3.2";
+    # https://github.com/ruby/ruby/blob/v3_2_2/yjit.h#L21
+    yjitSupported = atLeast32 && (stdenv.hostPlatform.isx86_64 || (!stdenv.hostPlatform.isWindows && stdenv.hostPlatform.isAarch64));
     self = lib.makeOverridable (
       { stdenv, buildPackages, lib
       , fetchurl, fetchpatch, fetchFromSavannah, fetchFromGitHub
@@ -46,12 +48,12 @@ let
       #     $(nix-build -A ruby)/lib/ruby/2.6.0/x86_64-linux/rbconfig.rb
       # - In $out/lib/libruby.so and/or $out/lib/libruby.dylib
       , removeReferencesTo, jitSupport ? yjitSupport
-      , rustPlatform, yjitSupport ? atLeast32
+      , cargo, rustPlatform, rustc, yjitSupport ? yjitSupported
       , autoreconfHook, bison, autoconf
       , buildEnv, bundler, bundix
       , libiconv, libobjc, libunwind, Foundation
       , makeBinaryWrapper, buildRubyGem, defaultGemConfig
-      , baseRuby ? buildPackages.ruby_3_1.override {
+      , baseRuby ? buildPackages.ruby.override {
           docSupport = false;
           rubygemsSupport = false;
         }
@@ -76,14 +78,14 @@ let
         nativeBuildInputs = [ autoreconfHook bison ]
           ++ (op docSupport groff)
           ++ (ops (dtraceSupport && stdenv.isLinux) [ systemtap libsystemtap ])
-          ++ ops yjitSupport [ rustPlatform.cargoSetupHook rustPlatform.rust.cargo rustPlatform.rust.rustc ]
+          ++ ops yjitSupport [ rustPlatform.cargoSetupHook cargo rustc ]
           ++ op useBaseRuby baseRuby;
         buildInputs = [ autoconf ]
           ++ (op fiddleSupport libffi)
           ++ (ops cursesSupport [ ncurses readline ])
           ++ (op zlibSupport zlib)
-          ++ (op (lib.versionOlder ver.majMin "3.0" && opensslSupport) openssl_1_1)
-          ++ (op (atLeast30 && opensslSupport) openssl_1_1)
+          ++ (op (atLeast30 && opensslSupport) openssl)
+          ++ (op (!atLeast30 && opensslSupport) openssl_1_1)
           ++ (op gdbmSupport gdbm)
           ++ (op yamlSupport libyaml)
           # Looks like ruby fails to build on darwin without readline even if curses
@@ -111,7 +113,7 @@ let
               url = "https://github.com/ruby/ruby/commit/0acc05caf7518cd0d63ab02bfa036455add02346.patch";
               sha256 = "sha256-43hI9L6bXfeujgmgKFVmiWhg7OXvshPCCtQ4TxqK1zk=";
             })
-          ]
+         ]
           ++ ops (!atLeast30 && rubygemsSupport) [
             # We upgrade rubygems to a version that isn't compatible with the
             # ruby 2.7 installer. Backport the upstream fix.
@@ -284,6 +286,7 @@ let
           license     = licenses.ruby;
           maintainers = with maintainers; [ vrthra manveru marsam ];
           platforms   = platforms.all;
+          knownVulnerabilities = op (lib.versionOlder ver.majMin "3.0") "This Ruby release has reached its end of life. See https://www.ruby-lang.org/en/downloads/branches/.";
         };
 
         passthru = rec {
@@ -318,11 +321,6 @@ in {
     sha256 = "sha256-wtq2PLyPKgVSYQitQZ76Y6Z+1AdNu8+fwrHKZky0W6A=";
   };
 
-  ruby_3_0 = generic {
-    version = rubyVersion "3" "0" "6" "";
-    sha256 = "sha256-bmy9SQAw15EMD/IO3vq0KU380QRvD49H94tZeYesaD4=";
-  };
-
   ruby_3_1 = generic {
     version = rubyVersion "3" "1" "4" "";
     sha256 = "sha256-o9VYeaDfqx1xQf3xDSKgfb+OXNxEFdob3gYSfVzDx7Y=";
@@ -333,4 +331,11 @@ in {
     sha256 = "sha256-lsV1WIcaZ0jeW8nydOk/S1qtBs2PN776Do2U57ikI7w=";
     cargoSha256 = "sha256-6du7RJo0DH+eYMOoh3L31F3aqfR5+iG1iKauSV1uNcQ=";
   };
+
+  ruby_3_3 = generic {
+    version = rubyVersion "3" "3" "0" "preview3";
+    sha256 = "sha256-CWkUG+kuZ+DtuEqPs1SsyY8BvXjmAqI6DxNgRcgvSAk=";
+    cargoSha256 = "sha256-GeelTMRFIyvz1QS2L+Q3KAnyQy7jc0ejhx3TdEFVEbk=";
+  };
+
 }
diff --git a/pkgs/development/interpreters/ruby/dev.nix b/pkgs/development/interpreters/ruby/dev.nix
index 62d561fbc1426..dea21118b2001 100644
--- a/pkgs/development/interpreters/ruby/dev.nix
+++ b/pkgs/development/interpreters/ruby/dev.nix
@@ -1,5 +1,5 @@
 /* An environment for development that bundles ruby, bundler and bundix
-   together. This avoids version conflicts where each is using a diferent
+   together. This avoids version conflicts where each is using a different
    version of each-other.
 */
 { buildEnv, ruby, bundler, bundix }:
diff --git a/pkgs/development/interpreters/ruby/rubygems/default.nix b/pkgs/development/interpreters/ruby/rubygems/default.nix
index 2ff5b6985747d..8e9e35dae59a4 100644
--- a/pkgs/development/interpreters/ruby/rubygems/default.nix
+++ b/pkgs/development/interpreters/ruby/rubygems/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "rubygems";
-  version = "3.4.8";
+  version = "3.4.22";
 
   src = fetchurl {
     url = "https://rubygems.org/rubygems/rubygems-${version}.tgz";
-    sha256 = "sha256-0FlDZJNJJGVkvBmKWNBqNRaTto6ciCOuQEK6uq6dotQ=";
+    hash = "sha256-gD+nd3bRHT0btWOCZhbIERJEJeAzGtH9mDxBRARqYVY=";
   };
 
   patches = [
@@ -26,6 +26,7 @@ stdenv.mkDerivation rec {
     changelog = "https://github.com/rubygems/rubygems/blob/v${version}/CHANGELOG.md";
     homepage = "https://rubygems.org/";
     license = with licenses; [ mit /* or */ ruby ];
+    mainProgram = "gem";
     maintainers = with maintainers; [ zimbatm ];
   };
 }
diff --git a/pkgs/development/interpreters/rune/default.nix b/pkgs/development/interpreters/rune/default.nix
new file mode 100644
index 0000000000000..510ab71bdc68a
--- /dev/null
+++ b/pkgs/development/interpreters/rune/default.nix
@@ -0,0 +1,37 @@
+{ lib
+, rustPlatform
+, fetchCrate
+, stdenv
+, darwin
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "rune";
+  version = "0.13.1";
+
+  src = fetchCrate {
+    pname = "rune-cli";
+    inherit version;
+    hash = "sha256-7GScETlQ/rl9vOB9zSfsCM1ay1F5YV6OAxKe82lMU1I=";
+  };
+
+  cargoHash = "sha256-T6uYe+ZgXgsGN1714Ka+fxeVDoXgjVdfrrw5Rj/95cE=";
+
+  buildInputs = lib.optionals stdenv.isDarwin [
+    darwin.apple_sdk.frameworks.CoreServices
+    darwin.apple_sdk.frameworks.SystemConfiguration
+  ];
+
+  env = {
+    RUNE_VERSION = version;
+  };
+
+  meta = with lib; {
+    description = "An interpreter for the Rune Language, an embeddable dynamic programming language for Rust";
+    homepage = "https://rune-rs.github.io/";
+    changelog = "https://github.com/rune-rs/rune/releases/tag/${version}";
+    license = with licenses; [ asl20 mit ];
+    maintainers = with maintainers; [ figsoda ];
+    mainProgram = "rune";
+  };
+}
diff --git a/pkgs/development/interpreters/scheme48/default.nix b/pkgs/development/interpreters/scheme48/default.nix
index 7a4178d82b15d..82bd58469bd32 100644
--- a/pkgs/development/interpreters/scheme48/default.nix
+++ b/pkgs/development/interpreters/scheme48/default.nix
@@ -14,6 +14,15 @@ stdenv.mkDerivation rec {
     substituteInPlace build/build-usual-image --replace '"(made by $USER on $date)"' '""'
   '';
 
+  # Silence warnings related to use of implicitly declared library functions and implicit ints.
+  # TODO: Remove and/or fix with patches the next time this package is updated.
+  env = lib.optionalAttrs stdenv.cc.isClang {
+    NIX_CFLAGS_COMPILE = toString [
+      "-Wno-error=implicit-function-declaration"
+      "-Wno-error=implicit-int"
+    ];
+  };
+
   meta = with lib; {
     homepage = "https://s48.org/";
     description = "Scheme 48 interpreter for R5RS";
diff --git a/pkgs/development/interpreters/self/default.nix b/pkgs/development/interpreters/self/default.nix
deleted file mode 100644
index 0da843d3f1a3c..0000000000000
--- a/pkgs/development/interpreters/self/default.nix
+++ /dev/null
@@ -1,45 +0,0 @@
-{ lib, stdenv, fetchFromGitHub, libX11, libXext, makeWrapper, ncurses, cmake }:
-
-stdenv.mkDerivation rec {
-  # The Self wrapper stores source in $XDG_DATA_HOME/self or ~/.local/share/self
-  # so that it can be written to when using the Self transposer. Running 'Self'
-  # after installation runs without an image. You can then build a Self image with:
-  #   $ cd ~/.local/share/self/objects
-  #   $ Self
-  #   > 'worldBuilder.self' _RunScript
-  #
-  # This image can later be started with:
-  #   $ Self -s myimage.snap
-  #
-  pname = "self";
-  version = "2017.1";
-
-  src = fetchFromGitHub {
-    owner = "russellallen";
-    repo = pname;
-    rev = version;
-    sha256 = "C/1Q6yFmoXx2F97xuvkm8DxFmmvuBS7uYZOxq/CRNog=";
-  };
-
-  nativeBuildInputs = [ cmake makeWrapper ];
-  buildInputs = [ ncurses libX11 libXext ];
-
-  selfWrapper = ./self;
-
-  installPhase = ''
-    mkdir -p "$out"/bin
-    cp ./vm/Self "$out"/bin/Self.wrapped
-    mkdir -p "$out"/share/self
-    cp -r ../objects "$out"/share/self/
-    makeWrapper $selfWrapper $out/bin/Self \
-      --set SELF_ROOT "$out"
-  '';
-
-  meta = with lib; {
-    description = "A prototype-based dynamic object-oriented programming language, environment, and virtual machine";
-    homepage = "https://selflanguage.org/";
-    license = licenses.bsd3;
-    maintainers = [ ];
-    platforms = platforms.linux;
-  };
-}
diff --git a/pkgs/development/interpreters/self/self b/pkgs/development/interpreters/self/self
deleted file mode 100755
index d504682086b08..0000000000000
--- a/pkgs/development/interpreters/self/self
+++ /dev/null
@@ -1,18 +0,0 @@
-#! /usr/bin/env bash
-
-export SELF_HOME="$HOME/.local/share/self"
-if [ -n "$XDG_DATA_HOME" ]
-  then export SELF_HOME="$XDG_DATA_HOME/self"
-fi
-
-if [ ! -d $SELF_HOME ]; then
-  mkdir -p $SELF_HOME
-fi
-
-if [ ! -d $SELF_HOME/objects ]; then
-  mkdir -p $SELF_HOME/objects
-  cp -r $SELF_ROOT/share/self/objects/* $SELF_HOME/objects
-  chmod -R +w $SELF_HOME/objects
-fi
-
-exec $SELF_ROOT/bin/Self.wrapped "$@"
diff --git a/pkgs/development/interpreters/shen-sbcl/default.nix b/pkgs/development/interpreters/shen-sbcl/default.nix
index 194c67eba98f2..538f5e7f13565 100644
--- a/pkgs/development/interpreters/shen-sbcl/default.nix
+++ b/pkgs/development/interpreters/shen-sbcl/default.nix
@@ -36,6 +36,7 @@ stdenv.mkDerivation rec {
     changelog = "https://github.com/Shen-Language/shen-cl/raw/v${version}/CHANGELOG.md";
     platforms = sbcl.meta.platforms;
     maintainers = with maintainers; [ bsima ];
+    broken = true;
     license = licenses.bsd3;
   };
 }
diff --git a/pkgs/development/interpreters/snobol4/default.nix b/pkgs/development/interpreters/snobol4/default.nix
new file mode 100644
index 0000000000000..c7e703f64eef5
--- /dev/null
+++ b/pkgs/development/interpreters/snobol4/default.nix
@@ -0,0 +1,64 @@
+{ lib
+, fetchurl
+, stdenv
+, bzip2
+, gdbm
+, gnum4
+, gzip
+, libffi
+, openssl
+, readline
+, sqlite
+, tcl
+, xz
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "snobol4";
+  version = "2.3.1";
+
+  src = fetchurl {
+    urls = [
+      "https://ftp.regressive.org/snobol4/snobol4-${version}.tar.gz"
+      # fallback for when the current version is moved to the old folder
+      "https://ftp.regressive.org/snobol4/old/snobol4-${version}.tar.gz"
+    ];
+    hash = "sha256-kSRNZ9TinSqtzlZVvUOC/6tExiSn6krWQRQn86vxdTU=";
+  };
+
+  outputs = [ "out" "man" "doc" ];
+
+  # gzip used by Makefile to compress man pages
+  nativeBuildInputs = [ gnum4 gzip ];
+  # enable all features (undocumented, based on manual review of configure script)
+  buildInputs = [ bzip2 libffi openssl readline sqlite tcl xz zlib ]
+    # ndbm compat library
+    ++ lib.optional stdenv.isLinux gdbm;
+  configureFlags = lib.optional (tcl != null) "--with-tcl=${tcl}/lib/tclConfig.sh";
+
+  # INSTALL says "parallel make will fail"
+  enableParallelBuilding = false;
+
+  patches = [ ./fix-paths.patch ];
+
+  # configure does not support --sbindir and the likes (as introduced by multiple-outputs.sh)
+  # so man, doc outputs must be handled manually
+  preConfigurePhases = [ "prePreConfigurePhase" ];
+  prePreConfigurePhase = ''
+    preConfigureHooks="''${preConfigureHooks//_multioutConfig/}"
+    prependToVar configureFlags --mandir="$man"/share/man
+  '';
+
+  meta = with lib; {
+    description = "The Macro Implementation of SNOBOL4 in C";
+    longDescription = ''
+      An open source port of Macro SNOBOL4 (The original Bell Telephone Labs implementation, written in SIL macros) by Phil Budne.
+      Supports full SNOBOL4 language plus SPITBOL, [Blocks](https://www.regressive.org/snobol4/blocks/) and other extensions.
+    '';
+    homepage = "https://www.regressive.org/snobol4/csnobol4/";
+    license = licenses.bsd2;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ xworld21 ];
+  };
+}
diff --git a/pkgs/development/interpreters/snobol4/fix-paths.patch b/pkgs/development/interpreters/snobol4/fix-paths.patch
new file mode 100644
index 0000000000000..d8b424ed3af6e
--- /dev/null
+++ b/pkgs/development/interpreters/snobol4/fix-paths.patch
@@ -0,0 +1,23 @@
+--- a/configure
++++ b/configure
+@@ -327,9 +327,9 @@
+ SNOLIB_LOCAL="$SNOLIB/local"
+ SNOLIB_DOC="$SNOLIB"
+ # XXX use $PREFIX/include/snobol4 ???
+-INCLUDE_DIR="$SNOLIB/include"
++INCLUDE_DIR="$PREFIX"/include/snolib4
+
+-DOC_DIR="$PREFIX/share/doc/snobol4-$VERSION"
++DOC_DIR="$doc/share/doc/snobol4-$VERSION"
+
+ echo 'BINDIR=$(DESTDIR)'"$BINDIR"    >> $CONFIG_M4
+ echo 'MANDIR=$(DESTDIR)'"$MANDIR"    >> $CONFIG_M4
+@@ -2110,7 +2110,7 @@
+ # IRIX /sbin/install
+
+ # should always find ./install-sh
+-for DIR in /usr/bin /usr/ucb /usr/local/bin /bin .; do
++for DIR in `echo $PATH | tr ':' ' '`; do
+     for INSTALL in install ginstall scoinst install-sh; do
+  IPATH=$DIR/$INSTALL
+  if [ -d $IPATH ]; then
diff --git a/pkgs/development/interpreters/spidermonkey/102.nix b/pkgs/development/interpreters/spidermonkey/102.nix
index ff6808b13b0a1..742e74e512c87 100644
--- a/pkgs/development/interpreters/spidermonkey/102.nix
+++ b/pkgs/development/interpreters/spidermonkey/102.nix
@@ -1,4 +1,4 @@
 import ./common.nix {
-  version = "102.8.0";
-  hash = "sha512-k+qHmXtmCIuUxulDtumemnHRkIRE0JbA9ltodtLFhOVf9hICZvOFH5hrZkvR8S+jEgawNHnCt1Hnw8oJesFCdQ==";
+  version = "102.13.0";
+  hash = "sha512-dF9Kd+TImDE/ERGCdNJ1E/S6oWu0LVtx2b0NvolX2/OaX3roRCzXEayptZe8kJwEtEy42QlMV6o04oXmT4NP3g==";
 }
diff --git a/pkgs/development/interpreters/spidermonkey/115.nix b/pkgs/development/interpreters/spidermonkey/115.nix
new file mode 100644
index 0000000000000..433a16f5da2e4
--- /dev/null
+++ b/pkgs/development/interpreters/spidermonkey/115.nix
@@ -0,0 +1,4 @@
+import ./common.nix {
+  version = "115.2.0";
+  hash = "sha512-3ztO/ZYH6OtJMnF3YMhl6zGsepYkbLQ4UZDDMxbJWV4Hk6HzxF67lnSpuk/OmNg/cbBjvvCe8wfZLRzXjTDYEg==";
+}
diff --git a/pkgs/development/interpreters/spidermonkey/common.nix b/pkgs/development/interpreters/spidermonkey/common.nix
index 244a699fd54b0..ff9bb39e0a294 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 = [
@@ -157,10 +163,13 @@ stdenv.mkDerivation (finalAttrs: rec {
     export AS=$CC
     export AC_MACRODIR=$PWD/build/autoconf/
 
+  '' + lib.optionalString (lib.versionAtLeast version "91" && lib.versionOlder version "115") ''
     pushd js/src
     sh ../../build/autoconf/autoconf.sh --localdir=$PWD configure.in > configure
     chmod +x configure
     popd
+  '' + lib.optionalString (lib.versionAtLeast version "115") ''
+    patchShebangs build/cargo-linker
   '' + ''
     # We can't build in js/src/, so create a build dir
     mkdir obj
@@ -184,6 +193,7 @@ stdenv.mkDerivation (finalAttrs: rec {
     homepage = "https://spidermonkey.dev/";
     license = licenses.mpl20; # TODO: MPL/GPL/LGPL tri-license for 78.
     maintainers = with maintainers; [ abbradar lostnet catap ];
+    broken = stdenv.isDarwin && versionAtLeast version "115"; # Requires SDK 13.3 (see #242666).
     platforms = platforms.unix;
   };
 })
diff --git a/pkgs/development/interpreters/starlark-rust/default.nix b/pkgs/development/interpreters/starlark-rust/default.nix
new file mode 100644
index 0000000000000..bd30fb4f85ae6
--- /dev/null
+++ b/pkgs/development/interpreters/starlark-rust/default.nix
@@ -0,0 +1,26 @@
+{ lib
+, rustPlatform
+, fetchCrate
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "starlark-rust";
+  version = "0.10.0";
+
+  src = fetchCrate {
+    pname = "starlark_bin";
+    inherit version;
+    hash = "sha256-7AoNRTLyTYsUass9bMJMBUN+GrfUzEGM9cED5VsRESs=";
+  };
+
+  cargoHash = "sha256-Q00JJRiubrxnI0nFQqUTbxTTB70XV93HJycjdlvV+74=";
+
+  meta = with lib; {
+    description = "A Rust implementation of the Starlark language";
+    homepage = "https://github.com/facebookexperimental/starlark-rust";
+    changelog = "https://github.com/facebookexperimental/starlark-rust/blob/v${version}/CHANGELOG.md";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ figsoda ];
+    mainProgram = "starlark";
+  };
+}
diff --git a/pkgs/development/interpreters/starlark/default.nix b/pkgs/development/interpreters/starlark/default.nix
index 7ab100bbbdfa1..a387765f833d6 100644
--- a/pkgs/development/interpreters/starlark/default.nix
+++ b/pkgs/development/interpreters/starlark/default.nix
@@ -1,16 +1,16 @@
-{ stdenv, lib, fetchFromGitHub, buildGoModule, fetchpatch }:
+{ lib, fetchFromGitHub, buildGoModule }:
 buildGoModule rec {
   pname = "starlark";
-  version = "unstable-2023-01-12";
+  version = "unstable-2023-11-01";
 
   src = fetchFromGitHub {
     owner = "google";
     repo = "starlark-go";
-    rev = "fae38c8a6d89dc410be86b76dfff475b29dba878";
-    hash = "sha256-7J2bYA84asWvwSOYEr+K9ZuR2ytR9XhGaSEJKxHimYI=";
+    rev = "556fd59b42f68a2fb1f84957741b72811c714e51";
+    hash = "sha256-0IiEtZOQEvE2Qm//lI1eyFFL1q/ZQzO9JzmiGsk0HkQ=";
   };
 
-  vendorHash = "sha256-AvZh7IqRRAAOG10rLodHLNSuTIQHXPTJkRXsAhZGNe0=";
+  vendorHash = "sha256-jQE5fSqJeiDV7PW7BY/dzCxG6b/KEVIobcjJsaL2zMw=";
 
   ldflags = [ "-s" "-w" ];
 
diff --git a/pkgs/development/interpreters/supercollider/default.nix b/pkgs/development/interpreters/supercollider/default.nix
index 7271e5073c32f..79cad7fe64478 100644
--- a/pkgs/development/interpreters/supercollider/default.nix
+++ b/pkgs/development/interpreters/supercollider/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, mkDerivation, fetchurl, fetchpatch, cmake
+{ lib, stdenv, mkDerivation, fetchurl, cmake, runtimeShell
 , pkg-config, alsa-lib, libjack2, libsndfile, fftw
 , curl, gcc, libXt, qtbase, qttools, qtwebengine
 , readline, qtwebsockets, useSCEL ? false, emacs
@@ -8,24 +8,22 @@
 
 mkDerivation rec {
   pname = "supercollider";
-  version = "3.12.2";
+  version = "3.13.0";
 
   src = fetchurl {
     url = "https://github.com/supercollider/supercollider/releases/download/Version-${version}/SuperCollider-${version}-Source.tar.bz2";
-    sha256 = "sha256-1QYorCgSwBK+SVAm4k7HZirr1j+znPmVicFmJdvO3g4=";
+    sha256 = "sha256-D8Xbpbrq43+Qaa0oiFqkBcaiUwnjiGy+ERvTt8BVMc4=";
   };
 
   patches = [
     # add support for SC_DATA_DIR and SC_PLUGIN_DIR env vars to override compile-time values
     ./supercollider-3.12.0-env-dirs.patch
-
-    # fix issue with libsndfile >=1.1.0
-    (fetchpatch {
-      url = "https://github.com/supercollider/supercollider/commit/b9dd70c4c8d61c93d7a70645e0bd18fa76e6834e.patch";
-      hash = "sha256-6FhEHyY0rnE6d7wC+v0U9K+L0aun5LkTqaEFhr3eQNw=";
-    })
   ];
 
+  postPatch = ''
+    substituteInPlace common/sc_popen.cpp --replace '/bin/sh' '${runtimeShell}'
+  '';
+
   strictDeps = true;
 
   nativeBuildInputs = [ cmake pkg-config qttools ];
@@ -72,6 +70,7 @@ mkDerivation rec {
   meta = with lib; {
     description = "Programming language for real time audio synthesis";
     homepage = "https://supercollider.github.io";
+    changelog = "https://github.com/supercollider/supercollider/blob/Version-${version}/CHANGELOG.md";
     maintainers = with maintainers; [ lilyinstarlight ];
     license = licenses.gpl3Plus;
     platforms = platforms.linux;
diff --git a/pkgs/development/interpreters/supercollider/plugins/sc3-plugins.nix b/pkgs/development/interpreters/supercollider/plugins/sc3-plugins.nix
index c7058817722e6..2881922aa1b22 100644
--- a/pkgs/development/interpreters/supercollider/plugins/sc3-plugins.nix
+++ b/pkgs/development/interpreters/supercollider/plugins/sc3-plugins.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "sc3-plugins";
-  version = "3.11.1";
+  version = "3.13.0";
 
   src = fetchurl {
     url = "https://github.com/supercollider/sc3-plugins/releases/download/Version-${version}/sc3-plugins-${version}-Source.tar.bz2";
-    sha256 = "sha256-JjUmu7PJ+x3yRibr+Av2gTREng51fPo7Rk+B4y2JvkQ=";
+    sha256 = "sha256-+N7rhh1ALipy21HUC0jEQ2kCYbWlOveJg9TPe6dnF6I=";
   };
 
   strictDeps = true;
diff --git a/pkgs/development/interpreters/tcl/8.6.nix b/pkgs/development/interpreters/tcl/8.6.nix
index 03fcb8317792d..0edd47e83d6c4 100644
--- a/pkgs/development/interpreters/tcl/8.6.nix
+++ b/pkgs/development/interpreters/tcl/8.6.nix
@@ -2,12 +2,12 @@
 
 callPackage ./generic.nix (args // rec {
   release = "8.6";
-  version = "${release}.11";
+  version = "${release}.13";
 
   # Note: when updating, the hash in pkgs/development/libraries/tk/8.6.nix must also be updated!
 
   src = fetchurl {
     url = "mirror://sourceforge/tcl/tcl${version}-src.tar.gz";
-    sha256 = "0n4211j80mxr6ql0xx52rig8r885rcbminfpjdb2qrw6hmk8c14c";
+    sha256 = "sha256-Q6H650EvYf8R3iz9BdKM/Dpzdi81SkF8YjcKVOLK8GY=";
   };
 })
diff --git a/pkgs/development/interpreters/tcl/generic.nix b/pkgs/development/interpreters/tcl/generic.nix
index 6ce6e35189bf2..5ee967161f832 100644
--- a/pkgs/development/interpreters/tcl/generic.nix
+++ b/pkgs/development/interpreters/tcl/generic.nix
@@ -1,4 +1,5 @@
-{ lib, stdenv, callPackage, makeSetupHook
+{ lib, stdenv, callPackage, makeSetupHook, runCommand
+, tzdata
 
 # Version specific stuff
 , release, version, src
@@ -7,7 +8,7 @@
 
 let
   baseInterp =
-    stdenv.mkDerivation {
+    stdenv.mkDerivation rec {
       pname = "tcl";
       inherit version src;
 
@@ -15,6 +16,14 @@ let
 
       setOutputFlags = false;
 
+      postPatch = ''
+        substituteInPlace library/clock.tcl \
+          --replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo" \
+          --replace "/usr/share/lib/zoneinfo" "" \
+          --replace "/usr/lib/zoneinfo" "" \
+          --replace "/usr/local/etc/zoneinfo" ""
+      '';
+
       preConfigure = ''
         cd unix
       '';
@@ -53,8 +62,17 @@ let
         libdir = "lib/${libPrefix}";
         tclPackageHook = callPackage ({ buildPackages }: makeSetupHook {
           name = "tcl-package-hook";
-          propagatedBuildInputs = [ buildPackages.makeWrapper ];
+          propagatedBuildInputs = [ buildPackages.makeBinaryWrapper ];
+          meta = {
+            inherit (meta) maintainers platforms;
+          };
         } ./tcl-package-hook.sh) {};
+        # verify that Tcl's clock library can access tzdata
+        tests.tzdata = runCommand "${pname}-test-tzdata" {} ''
+          ${baseInterp}/bin/tclsh <(echo "set t [clock scan {2004-10-30 05:00:00} \
+                                        -format {%Y-%m-%d %H:%M:%S} \
+                                        -timezone :America/New_York]") > $out
+        '';
       };
     };
 
diff --git a/pkgs/development/interpreters/tinyscheme/default.nix b/pkgs/development/interpreters/tinyscheme/default.nix
index 1b298af4ac492..fef3f5daceeb0 100644
--- a/pkgs/development/interpreters/tinyscheme/default.nix
+++ b/pkgs/development/interpreters/tinyscheme/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     # We want to have the makefile pick up $CC, etc. so that we don't have
     # to unnecessarily tie this package to the GCC stdenv.
     ./02-use-toolchain-env-vars.patch
-  ] ++ lib.optionals stdenv.targetPlatform.isDarwin [
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
     # On macOS the library suffix is .dylib:
     ./03-macOS-SOsuf.patch
   ];
diff --git a/pkgs/development/interpreters/trealla/default.nix b/pkgs/development/interpreters/trealla/default.nix
deleted file mode 100644
index 84637bed1d091..0000000000000
--- a/pkgs/development/interpreters/trealla/default.nix
+++ /dev/null
@@ -1,54 +0,0 @@
-{ lib, stdenv, fetchFromGitHub, readline, openssl, libffi, valgrind, withThread ? true, withSSL ? true, xxd }:
-
-stdenv.mkDerivation rec {
-  pname = "trealla";
-  version = "2.8.6";
-
-  src = fetchFromGitHub {
-    owner = "trealla-prolog";
-    repo = "trealla";
-    rev = "v${version}";
-    sha256 = "sha256-0sAPexGKriaJVhBDRsopRYD8xrJAaXZiscCcwfWdEgQ=";
-  };
-
-  postPatch = ''
-    substituteInPlace Makefile \
-      --replace '-I/usr/local/include' "" \
-      --replace '-L/usr/local/lib' "" \
-      --replace 'GIT_VERSION :=' 'GIT_VERSION ?='
-  '';
-
-  makeFlags = [
-    "GIT_VERSION=\"v${version}\""
-    (lib.optionalString withThread "THREADS=1")
-    (lib.optionalString (!withSSL) "NOSSL=1")
-    (lib.optionalString stdenv.isDarwin "NOLDLIBS=1")
-  ];
-
-  nativeBuildInputs = [ xxd ];
-  buildInputs = [ readline openssl libffi ];
-  checkInputs = lib.optionals (!(stdenv.isDarwin && stdenv.isAarch64)) [ valgrind ];
-  enableParallelBuilding = true;
-
-  installPhase = ''
-    install -Dm755 -t $out/bin tpl
-  '';
-
-  doCheck = true;
-  preCheck = ''
-    # Disable tests due to floating point error
-    rm tests/issues-OLD/test081.pl
-    rm tests/issues-OLD/test585.pl
-    # Disable test due to Unicode issues
-    rm tests/issues-OLD/test252.pl
-  '';
-
-  meta = with lib; {
-    description = "A compact, efficient Prolog interpreter written in ANSI C";
-    homepage = "https://github.com/trealla-prolog/trealla";
-    license = licenses.mit;
-    maintainers = with maintainers; [ siraben ];
-    mainProgram = "tpl";
-    platforms = platforms.all;
-  };
-}
diff --git a/pkgs/development/interpreters/wamr/default.nix b/pkgs/development/interpreters/wamr/default.nix
new file mode 100644
index 0000000000000..9396f3361afae
--- /dev/null
+++ b/pkgs/development/interpreters/wamr/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "wamr";
+  version = "1.3.0";
+
+  src = fetchFromGitHub {
+    owner = "bytecodealliance";
+    repo = "wasm-micro-runtime";
+    rev = "WAMR-${finalAttrs.version}";
+    hash = "sha256-h+IwCdufimmkVk2XUAFtDcV+5dJWohRc1kmh3zgDKIg=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  sourceRoot = let
+    platform = if stdenv.isLinux then
+        "linux"
+      else if stdenv.isDarwin then
+        "darwin"
+      else throw "unsupported platform";
+  in "${finalAttrs.src.name}/product-mini/platforms/${platform}";
+
+  meta = with lib; {
+    description = "WebAssembly Micro Runtime";
+    homepage = "https://github.com/bytecodealliance/wasm-micro-runtime";
+    license = licenses.asl20;
+    mainProgram = "iwasm";
+    maintainers = with maintainers; [ ereslibre ];
+    # TODO (ereslibre): this derivation should be improved to support
+    # more platforms.
+    broken = !stdenv.isLinux;
+  };
+})
diff --git a/pkgs/development/interpreters/wasm3/default.nix b/pkgs/development/interpreters/wasm3/default.nix
index 036010e1356ac..d5df9e66ebf4c 100644
--- a/pkgs/development/interpreters/wasm3/default.nix
+++ b/pkgs/development/interpreters/wasm3/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   ];
 
   installPhase = ''
-    runHook preInstal
+    runHook preInstall
     install -Dm755 wasm3 -t $out/bin
     runHook postInstall
   '';
diff --git a/pkgs/development/interpreters/wasmer/default.nix b/pkgs/development/interpreters/wasmer/default.nix
index 5666b078b4c32..22b26c5345f03 100644
--- a/pkgs/development/interpreters/wasmer/default.nix
+++ b/pkgs/development/interpreters/wasmer/default.nix
@@ -14,18 +14,20 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "wasmer";
-  version = "3.1.1";
+  version = "4.2.1";
 
   src = fetchFromGitHub {
     owner = "wasmerio";
     repo = pname;
     rev = "refs/tags/v${version}";
-    hash = "sha256-797I3FBBfnAgNfOdMajm3WNkMo3MUXb1347LBggXrLk=";
+    hash = "sha256-GROw9TYKC53ECJUeYhCez8f2jImPla/lGgsP91tTGjQ=";
   };
 
-  cargoHash = "sha256-zUTwhfRLKUixgj3JXiz2QOuwbFhfget+GcFSRL1QJ3w=";
+  cargoHash = "sha256-JE7FDF4MWhqJbL7ZP+yzfV7/Z79x0NuQLYNwWwMjAao=";
 
-  nativeBuildInputs = [ rustPlatform.bindgenHook ];
+  nativeBuildInputs = [
+    rustPlatform.bindgenHook
+  ];
 
   buildInputs = lib.optionals withLLVM [
     llvmPackages.llvm
@@ -37,14 +39,8 @@ rustPlatform.buildRustPackage rec {
     Security
   ];
 
-  LLVM_SYS_120_PREFIX = lib.optionalString withLLVM llvmPackages.llvm.dev;
-
   # check references to `compiler_features` in Makefile on update
-  buildFeatures = checkFeatures ++ [
-    "webc_runner"
-  ];
-
-  checkFeatures = [
+  buildFeatures = [
     "cranelift"
     "wasmer-artifact-create"
     "static-artifact-create"
@@ -56,6 +52,11 @@ rustPlatform.buildRustPackage rec {
 
   cargoBuildFlags = [ "--manifest-path" "lib/cli/Cargo.toml" "--bin" "wasmer" ];
 
+  env.LLVM_SYS_140_PREFIX = lib.optionalString withLLVM llvmPackages.llvm.dev;
+
+  # Tests are failing due to `Cannot allocate memory` and other reasons
+  doCheck = false;
+
   meta = with lib; {
     description = "The Universal WebAssembly Runtime";
     longDescription = ''
diff --git a/pkgs/development/interpreters/wasmtime/default.nix b/pkgs/development/interpreters/wasmtime/default.nix
index 7a3297ba7f072..8613beaef905f 100644
--- a/pkgs/development/interpreters/wasmtime/default.nix
+++ b/pkgs/development/interpreters/wasmtime/default.nix
@@ -1,36 +1,31 @@
-{ rustPlatform, fetchFromGitHub, lib, stdenv }:
+{ rustPlatform, fetchFromGitHub, Security, lib, stdenv }:
 
 rustPlatform.buildRustPackage rec {
   pname = "wasmtime";
-  version = "7.0.0";
+  version = "15.0.1";
 
   src = fetchFromGitHub {
     owner = "bytecodealliance";
     repo = pname;
     rev = "v${version}";
-    hash = "sha256-vbsjUJH6wHmSTwUV5tXrTUljPJNLTms8K6EyWi0mipA=";
+    hash = "sha256-9vArmudz1Avxz46IS9FZIKbs8wZXoeWMd/FGLmpPitw=";
     fetchSubmodules = true;
   };
 
-  cargoHash = "sha256-eTm0FfWiNpEwj2egLrQGPA1lZ0K5GfVOeULsbNyf18Q=";
-
-  cargoBuildFlags = [
-    "--package wasmtime-cli"
-    "--package wasmtime-c-api"
-  ];
+  # Disable cargo-auditable until https://github.com/rust-secure-code/cargo-auditable/issues/124 is solved.
+  auditable = false;
+  cargoHash = "sha256-/mX9zUN+dZoOCOPMeWCJ9U7KfI6JnFl8B2leYosy2jQ=";
+  cargoBuildFlags = [ "--package" "wasmtime-cli" "--package" "wasmtime-c-api" ];
 
   outputs = [ "out" "dev" ];
 
-  # We disable tests on x86_64-darwin because Hydra runners do not
-  # support SSE3, SSSE3, SSE4.1 and SSE4.2 at this time. This is
-  # required by wasmtime. Given this is very specific to Hydra
-  # runners, just disable tests on this platform, so we don't get
-  # false positives of this package being broken due to failed runs on
-  # Hydra (e.g. https://hydra.nixos.org/build/187667794/)
-  doCheck = (stdenv.system != "x86_64-darwin");
-  cargoTestFlags = [
-    "--package wasmtime-runtime"
-  ];
+  buildInputs = lib.optional stdenv.isDarwin Security;
+
+  # SIMD tests are only executed on platforms that support all
+  # required processor features (e.g. SSE3, SSSE3 and SSE4.1 on x86_64):
+  # https://github.com/bytecodealliance/wasmtime/blob/v9.0.0/cranelift/codegen/src/isa/x64/mod.rs#L220
+  doCheck = with stdenv.buildPlatform; (isx86_64 -> sse3Support && ssse3Support && sse4_1Support);
+  cargoTestFlags = ["--package" "wasmtime-runtime"];
 
   postInstall = ''
     # move libs from out to dev
@@ -42,13 +37,20 @@ rustPlatform.buildRustPackage rec {
     install -m0644 $src/crates/c-api/include/*.h $dev/include
     install -m0644 $src/crates/c-api/include/wasmtime/*.h $dev/include/wasmtime
     install -m0644 $src/crates/c-api/wasm-c-api/include/* $dev/include
+  '' + lib.optionalString stdenv.isDarwin ''
+    install_name_tool -id \
+      $dev/lib/libwasmtime.dylib \
+      $dev/lib/libwasmtime.dylib
   '';
 
   meta = with lib; {
-    description = "Standalone JIT-style runtime for WebAssembly, using Cranelift";
-    homepage = "https://github.com/bytecodealliance/wasmtime";
+    description =
+      "Standalone JIT-style runtime for WebAssembly, using Cranelift";
+    homepage = "https://wasmtime.dev/";
     license = licenses.asl20;
+    mainProgram = "wasmtime";
     maintainers = with maintainers; [ ereslibre matthewbauer ];
     platforms = platforms.unix;
+    changelog = "https://github.com/bytecodealliance/wasmtime/blob/v${version}/RELEASES.md";
   };
 }
diff --git a/pkgs/development/interpreters/wavm/default.nix b/pkgs/development/interpreters/wavm/default.nix
new file mode 100644
index 0000000000000..a9ed260a0fd06
--- /dev/null
+++ b/pkgs/development/interpreters/wavm/default.nix
@@ -0,0 +1,26 @@
+{ lib
+, llvmPackages
+, fetchFromGitHub
+, cmake
+}:
+
+llvmPackages.stdenv.mkDerivation (finalAttrs: {
+  pname = "wavm";
+  version = "2022-05-14";
+
+  src = fetchFromGitHub {
+    owner = "WAVM";
+    repo = "WAVM";
+    rev = "nightly/${finalAttrs.version}";
+    hash = "sha256-SHz+oOOkwvVZucJYFSyZc3MnOAy1VatspmZmOAXYAWA=";
+  };
+
+  nativeBuildInputs = [ cmake llvmPackages.llvm ];
+
+  meta = with lib; {
+    description = "WebAssembly Virtual Machine";
+    homepage = "https://wavm.github.io";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ ereslibre ];
+  };
+})
diff --git a/pkgs/development/interpreters/wazero/default.nix b/pkgs/development/interpreters/wazero/default.nix
new file mode 100644
index 0000000000000..18fa05ccc2385
--- /dev/null
+++ b/pkgs/development/interpreters/wazero/default.nix
@@ -0,0 +1,51 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, testers
+, wazero
+}:
+
+buildGoModule rec {
+  pname = "wazero";
+  version = "1.5.0";
+
+  src = fetchFromGitHub {
+    owner = "tetratelabs";
+    repo = "wazero";
+    rev = "v${version}";
+    hash = "sha256-iUPAVOmZNX4qs7bHu9dXtQP/G8FwyblJvZ3pauA9ev0=";
+  };
+
+  vendorHash = null;
+
+  subPackages = [
+    "cmd/wazero"
+  ];
+
+  ldflags = [
+    "-s"
+    "-w"
+    "-X=github.com/tetratelabs/wazero/internal/version.version=${version}"
+  ];
+
+  checkFlags = [
+    # fails when version is specified
+    "-skip=TestCompile|TestRun"
+  ];
+
+  passthru.tests = {
+    version = testers.testVersion {
+      package = wazero;
+      command = "wazero version";
+    };
+  };
+
+  meta = with lib; {
+    description = "A zero dependency WebAssembly runtime for Go developers";
+    homepage = "https://github.com/tetratelabs/wazero";
+    changelog = "https://github.com/tetratelabs/wazero/releases/tag/${src.rev}";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ figsoda ];
+    mainProgram = "wazero";
+  };
+}
diff --git a/pkgs/development/interpreters/yabasic/default.nix b/pkgs/development/interpreters/yabasic/default.nix
index 87e2f2299378c..ee4cb47b68290 100644
--- a/pkgs/development/interpreters/yabasic/default.nix
+++ b/pkgs/development/interpreters/yabasic/default.nix
@@ -8,13 +8,13 @@
 , ncurses
 }:
 
-stdenv.mkDerivation (self: {
+stdenv.mkDerivation (finalAttrs: {
   pname = "yabasic";
-  version = "2.90.3";
+  version = "2.90.4";
 
   src = fetchurl {
-    url = "http://www.yabasic.de/download/yabasic-${self.version}.tar.gz";
-    hash = "sha256-ItmlkraNUE0qlq1RghUJcDq4MHb6HRKNoIRylugjboA=";
+    url = "http://www.yabasic.de/download/yabasic-${finalAttrs.version}.tar.gz";
+    hash = "sha256-td54SC1LnO3z07m3BsVDpiAsmokzB4xn4dbVdfeYH8M=";
   };
 
   buildInputs = [
diff --git a/pkgs/development/interpreters/yaegi/default.nix b/pkgs/development/interpreters/yaegi/default.nix
new file mode 100644
index 0000000000000..dcde678338f05
--- /dev/null
+++ b/pkgs/development/interpreters/yaegi/default.nix
@@ -0,0 +1,45 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, testers
+, yaegi
+}:
+
+buildGoModule rec {
+  pname = "yaegi";
+  version = "0.15.1";
+
+  src = fetchFromGitHub {
+    owner = "traefik";
+    repo = "yaegi";
+    rev = "v${version}";
+    hash = "sha256-ZV1HidHJvwum18QIIwQiCcRcitZdHk5+FxkPs6YgDac=";
+  };
+
+  vendorHash = null;
+
+  subPackages = [
+    "cmd/yaegi"
+  ];
+
+  ldflags = [
+    "-s"
+    "-w"
+    "-X=main.version=${version}"
+  ];
+
+  passthru.tests = {
+    version = testers.testVersion {
+      package = yaegi;
+      command = "yaegi version";
+    };
+  };
+
+  meta = with lib; {
+    description = "A Go interpreter";
+    homepage = "https://github.com/traefik/yaegi";
+    changelog = "https://github.com/traefik/yaegi/releases/tag/${src.rev}";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/pkgs/development/interpreters/zuo/default.nix b/pkgs/development/interpreters/zuo/default.nix
index f0d71673c2fbb..d4ad9811ed5a2 100644
--- a/pkgs/development/interpreters/zuo/default.nix
+++ b/pkgs/development/interpreters/zuo/default.nix
@@ -1,18 +1,20 @@
-{ lib, stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub, unstableGitUpdater }:
 
 stdenv.mkDerivation rec {
   pname = "zuo";
-  version = "unstable-2023-01-02";
+  version = "unstable-2023-11-23";
 
   src = fetchFromGitHub {
     owner = "racket";
     repo = "zuo";
-    rev = "464aae9ae90dcb43ab003b922e4ae4d08611c55b";
-    hash = "sha256-O8p3dEXqAP2UNPNBla9AtkndxgL8UoVp/QygXOmcgWg=";
+    rev = "4d85edb4f221de8a1748ee38dcc6963d8d2da33a";
+    hash = "sha256-pFEXkByZpVnQgXK1DeFSEnalvhCTwOy75WrRojBM78U=";
   };
 
   doCheck = true;
 
+  passthru.updateScript = unstableGitUpdater { };
+
   meta = with lib; {
     description = "A Tiny Racket for Scripting";
     homepage = "https://github.com/racket/zuo";