about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--maintainers/maintainer-list.nix2
-rw-r--r--pkgs/applications/misc/calibre/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/beeper/default.nix6
-rw-r--r--pkgs/applications/networking/instant-messengers/slack/default.nix12
-rw-r--r--pkgs/by-name/un/unciv/package.nix4
-rw-r--r--pkgs/development/compilers/llvm/12/clang/default.nix132
-rw-r--r--pkgs/development/compilers/llvm/12/default.nix16
-rw-r--r--pkgs/development/compilers/llvm/13/clang/default.nix126
-rw-r--r--pkgs/development/compilers/llvm/13/default.nix21
-rw-r--r--pkgs/development/compilers/llvm/14/clang/default.nix129
-rw-r--r--pkgs/development/compilers/llvm/14/default.nix16
-rw-r--r--pkgs/development/compilers/llvm/15/default.nix16
-rw-r--r--pkgs/development/compilers/llvm/16/clang/default.nix137
-rw-r--r--pkgs/development/compilers/llvm/16/default.nix16
-rw-r--r--pkgs/development/compilers/llvm/17/clang/default.nix141
-rw-r--r--pkgs/development/compilers/llvm/17/default.nix16
-rw-r--r--pkgs/development/compilers/llvm/18/default.nix16
-rw-r--r--pkgs/development/compilers/llvm/common/clang/default.nix (renamed from pkgs/development/compilers/llvm/15/clang/default.nix)136
-rw-r--r--pkgs/development/compilers/llvm/git/clang/default.nix139
-rw-r--r--pkgs/development/compilers/llvm/git/default.nix16
-rw-r--r--pkgs/development/ocaml-modules/janestreet/0.12.nix65
-rw-r--r--pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix2
-rw-r--r--pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix2
-rw-r--r--pkgs/development/ocaml-modules/ocaml-result/default.nix8
-rw-r--r--pkgs/development/ocaml-modules/octavius/default.nix8
-rw-r--r--pkgs/development/ocaml-modules/ppx_derivers/default.nix8
-rw-r--r--pkgs/development/ocaml-modules/ppxlib/default.nix4
-rw-r--r--pkgs/development/python-modules/pysimplegui/default.nix3
-rw-r--r--pkgs/development/python-modules/pytest-cases/default.nix4
-rw-r--r--pkgs/development/tools/turso-cli/default.nix6
-rw-r--r--pkgs/tools/admin/awscli2/default.nix4
31 files changed, 243 insertions, 972 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index 6e4e158b8796..047f51eb8990 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -17678,7 +17678,7 @@
     name = "Sanskar Gurdasani";
   };
   sarahec = {
-    email = "sarahec@nextquestion.net";
+    email = "seclark@nextquestion.net";
     github = "sarahec";
     githubId = 11277967;
     name = "Sarah Clark";
diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix
index da1e263107b3..3f57531e099d 100644
--- a/pkgs/applications/misc/calibre/default.nix
+++ b/pkgs/applications/misc/calibre/default.nix
@@ -32,11 +32,11 @@
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "calibre";
-  version = "7.7.0";
+  version = "7.8.0";
 
   src = fetchurl {
     url = "https://download.calibre-ebook.com/${finalAttrs.version}/calibre-${finalAttrs.version}.tar.xz";
-    hash = "sha256-+kz3Fz1RDQ+ROgv7y0WNAWvIESKvHKID8UnSeCh8yA4=";
+    hash = "sha256-FxYuQzzuaWZihSsmeJc6ssG3VBr2YNEi3TkXyyymLUQ=";
   };
 
   patches = [
diff --git a/pkgs/applications/networking/instant-messengers/beeper/default.nix b/pkgs/applications/networking/instant-messengers/beeper/default.nix
index c14f2e8a4385..63d6720aaf0d 100644
--- a/pkgs/applications/networking/instant-messengers/beeper/default.nix
+++ b/pkgs/applications/networking/instant-messengers/beeper/default.nix
@@ -11,11 +11,11 @@
 }:
 let
   pname = "beeper";
-  version = "3.102.14";
+  version = "3.103.36";
   name = "${pname}-${version}";
   src = fetchurl {
-    url = "https://download.todesktop.com/2003241lzgn20jd/beeper-3.102.14-build-24040616ytycz8q-x86_64.AppImage";
-    hash = "sha256-A+0dXAddZq7GWMyi9v1g0B9f7b6COMkFlm8bX4XXvzU=";
+    url = "https://download.todesktop.com/2003241lzgn20jd/beeper-3.103.36-build-240411hw9xbpc7s-x86_64.AppImage";
+    hash = "sha256-qxu/a8eeWeOKCsno51J2IHUXTXH82KXBNajfoEkkid8=";
   };
   appimage = appimageTools.wrapType2 {
     inherit version pname src;
diff --git a/pkgs/applications/networking/instant-messengers/slack/default.nix b/pkgs/applications/networking/instant-messengers/slack/default.nix
index f406181b4511..e0ce9027551c 100644
--- a/pkgs/applications/networking/instant-messengers/slack/default.nix
+++ b/pkgs/applications/networking/instant-messengers/slack/default.nix
@@ -45,14 +45,14 @@ let
 
   pname = "slack";
 
-  x86_64-darwin-version = "4.37.94";
-  x86_64-darwin-sha256 = "01v7v977fq8mfsl0lipdc7ig55p2sknxzr1jmh8qxiq4f4y0rj5g";
+  x86_64-darwin-version = "4.37.101";
+  x86_64-darwin-sha256 = "03k4iv6y7y1z9ac7if35r3lk7kp7ic4aa4rdyzbrzihvpfb3nvdh";
 
-  x86_64-linux-version = "4.37.94";
-  x86_64-linux-sha256 = "1f1spl767ldrarvpxrayry2d0nyr22b8xacxl4g1r8raryvnyz0x";
+  x86_64-linux-version = "4.37.101";
+  x86_64-linux-sha256 = "0vmaam0aiqcqmm8n3zrjmf012d6pdi0g1d08v1zhgx2rhl614ff9";
 
-  aarch64-darwin-version = "4.37.94";
-  aarch64-darwin-sha256 = "0gh45gvlbjzxh0fn24z15glxqih5lggam8w6kpawsxgivkw6rjcc";
+  aarch64-darwin-version = "4.37.101";
+  aarch64-darwin-sha256 = "07qfqrq32sh5cw7vmq2x0s5zvkvcl7j1kkvdncg36fay9276f2pp";
 
   version = {
     x86_64-darwin = x86_64-darwin-version;
diff --git a/pkgs/by-name/un/unciv/package.nix b/pkgs/by-name/un/unciv/package.nix
index 5a256c31bf6a..b73b58113728 100644
--- a/pkgs/by-name/un/unciv/package.nix
+++ b/pkgs/by-name/un/unciv/package.nix
@@ -27,11 +27,11 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "unciv";
-  version = "4.11.2";
+  version = "4.11.4";
 
   src = fetchurl {
     url = "https://github.com/yairm210/Unciv/releases/download/${version}/Unciv.jar";
-    hash = "sha256-ZUDfJf+FgIX8gRoZYlYAJhpLwNWp3MCKEQOSQGQ88T8=";
+    hash = "sha256-QqnM1kTXHHpf8l99J8ydIjTkl/LetijzIJgLYt6OaRA=";
   };
 
   dontUnpack = true;
diff --git a/pkgs/development/compilers/llvm/12/clang/default.nix b/pkgs/development/compilers/llvm/12/clang/default.nix
deleted file mode 100644
index c482a8ee6875..000000000000
--- a/pkgs/development/compilers/llvm/12/clang/default.nix
+++ /dev/null
@@ -1,132 +0,0 @@
-{ lib, stdenv, llvm_meta, fetch, substituteAll, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3
-, buildLlvmTools
-, fixDarwinDylibNames
-, enableManpages ? false
-}:
-
-let
-  self = stdenv.mkDerivation ({
-    pname = "clang";
-    inherit version;
-
-    src = fetch "clang" "0px4gl27az6cdz6adds89qzdwb1cqpjsfvrldbz9qvpmphrj34bf";
-    inherit clang-tools-extra_src;
-
-    unpackPhase = ''
-      unpackFile $src
-      mv clang-* clang
-      sourceRoot=$PWD/clang
-      unpackFile ${clang-tools-extra_src}
-      mv clang-tools-extra-* $sourceRoot/tools/extra
-      substituteInPlace $sourceRoot/tools/extra/clangd/quality/CompletionModel.cmake \
-        --replace ' ''${CMAKE_SOURCE_DIR}/../clang-tools-extra' ' ''${CMAKE_SOURCE_DIR}/tools/extra'
-    '';
-
-    nativeBuildInputs = [ cmake python3 ]
-      ++ lib.optional enableManpages python3.pkgs.sphinx
-      ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
-
-    buildInputs = [ libxml2 libllvm ];
-
-    cmakeFlags = [
-      "-DCLANGD_BUILD_XPC=OFF"
-      "-DLLVM_ENABLE_RTTI=ON"
-    ] ++ lib.optionals enableManpages [
-      "-DCLANG_INCLUDE_DOCS=ON"
-      "-DLLVM_ENABLE_SPHINX=ON"
-      "-DSPHINX_OUTPUT_MAN=ON"
-      "-DSPHINX_OUTPUT_HTML=OFF"
-      "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
-    ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
-      "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen"
-      "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen"
-    ];
-
-    patches = [
-      ./purity.patch
-      # https://reviews.llvm.org/D51899
-      ./gnu-install-dirs.patch
-      (substituteAll {
-        src = ../../common/clang/clang-11-15-LLVMgold-path.patch;
-        libllvmLibdir = "${libllvm.lib}/lib";
-      })
-    ];
-
-    postPatch = ''
-      sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \
-             -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \
-             lib/Driver/ToolChains/*.cpp
-    '' + lib.optionalString stdenv.hostPlatform.isMusl ''
-      sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
-    '';
-
-    outputs = [ "out" "lib" "dev" "python" ];
-
-    postInstall = ''
-      ln -sv $out/bin/clang $out/bin/cpp
-
-      # Move libclang to 'lib' output
-      moveToOutput "lib/libclang.*" "$lib"
-      moveToOutput "lib/libclang-cpp.*" "$lib"
-      substituteInPlace $out/lib/cmake/clang/ClangTargets-release.cmake \
-          --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \
-          --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp."
-
-      mkdir -p $python/bin $python/share/{clang,scan-view}
-      mv $out/bin/{git-clang-format,scan-view} $python/bin
-      if [ -e $out/bin/set-xcode-analyzer ]; then
-        mv $out/bin/set-xcode-analyzer $python/bin
-      fi
-      mv $out/share/clang/*.py $python/share/clang
-      mv $out/share/scan-view/*.py $python/share/scan-view
-      rm $out/bin/c-index-test
-      patchShebangs $python/bin
-
-      mkdir -p $dev/bin
-      cp bin/clang-tblgen $dev/bin
-    '';
-
-    passthru = {
-      inherit libllvm;
-      isClang = true;
-      hardeningUnsupportedFlags = [ "fortify3" "zerocallusedregs" ];
-    };
-
-    meta = llvm_meta // {
-      homepage = "https://clang.llvm.org/";
-      description = "A C language family frontend for LLVM";
-      longDescription = ''
-        The Clang project provides a language front-end and tooling
-        infrastructure for languages in the C language family (C, C++, Objective
-        C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project.
-        It aims to deliver amazingly fast compiles, extremely useful error and
-        warning messages and to provide a platform for building great source
-        level tools. The Clang Static Analyzer and clang-tidy are tools that
-        automatically find bugs in your code, and are great examples of the sort
-        of tools that can be built using the Clang frontend as a library to
-        parse C/C++ code.
-      '';
-      mainProgram = "clang";
-    };
-  } // lib.optionalAttrs enableManpages {
-    pname = "clang-manpages";
-
-    buildPhase = ''
-      make docs-clang-man
-    '';
-
-    installPhase = ''
-      mkdir -p $out/share/man/man1
-      # Manually install clang manpage
-      cp docs/man/*.1 $out/share/man/man1/
-    '';
-
-    outputs = [ "out" ];
-
-    doCheck = false;
-
-    meta = llvm_meta // {
-      description = "man page for Clang ${version}";
-    };
-  });
-in self
diff --git a/pkgs/development/compilers/llvm/12/default.nix b/pkgs/development/compilers/llvm/12/default.nix
index 7bd82c071538..0d9202df8aee 100644
--- a/pkgs/development/compilers/llvm/12/default.nix
+++ b/pkgs/development/compilers/llvm/12/default.nix
@@ -1,6 +1,6 @@
 { lowPrio, newScope, pkgs, lib, stdenv, cmake
 , preLibcCrossHeaders
-, substitute, fetchFromGitHub, fetchpatch
+, substitute, substituteAll, fetchFromGitHub, fetchpatch
 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
 , buildLlvmTools # tools, but from the previous stage, for cross
 , targetLlvmLibraries # libraries, but from the next stage, for cross
@@ -56,7 +56,7 @@ let
     then tools.bintools
     else bootBintools;
 
-  in {
+  in rec {
 
     libllvm = callPackage ./llvm {
       inherit llvm_meta;
@@ -66,7 +66,17 @@ let
     # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
     llvm = tools.libllvm;
 
-    libclang = callPackage ./clang {
+    libclang = callPackage ../common/clang {
+      src = fetch "clang" "0px4gl27az6cdz6adds89qzdwb1cqpjsfvrldbz9qvpmphrj34bf";
+      patches = [
+        ./clang/purity.patch
+        # https://reviews.llvm.org/D51899
+        ./clang/gnu-install-dirs.patch
+        (substituteAll {
+          src = ../common/clang/clang-11-15-LLVMgold-path.patch;
+          libllvmLibdir = "${libllvm.lib}/lib";
+        })
+      ];
       inherit clang-tools-extra_src llvm_meta;
     };
 
diff --git a/pkgs/development/compilers/llvm/13/clang/default.nix b/pkgs/development/compilers/llvm/13/clang/default.nix
deleted file mode 100644
index 2d02ffb60b36..000000000000
--- a/pkgs/development/compilers/llvm/13/clang/default.nix
+++ /dev/null
@@ -1,126 +0,0 @@
-{ lib, stdenv, llvm_meta, src, substituteAll, cmake, libxml2, libllvm, version, python3
-, buildLlvmTools
-, fixDarwinDylibNames
-, enableManpages ? false
-}:
-
-let
-  self = stdenv.mkDerivation ({
-    pname = "clang";
-    inherit version;
-
-    inherit src;
-    sourceRoot = "${src.name}/clang";
-
-    nativeBuildInputs = [ cmake python3 ]
-      ++ lib.optional enableManpages python3.pkgs.sphinx
-      ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
-
-    buildInputs = [ libxml2 libllvm ];
-
-    cmakeFlags = [
-      "-DCLANGD_BUILD_XPC=OFF"
-      "-DLLVM_ENABLE_RTTI=ON"
-    ] ++ lib.optionals enableManpages [
-      "-DCLANG_INCLUDE_DOCS=ON"
-      "-DLLVM_ENABLE_SPHINX=ON"
-      "-DSPHINX_OUTPUT_MAN=ON"
-      "-DSPHINX_OUTPUT_HTML=OFF"
-      "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
-    ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
-      "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen"
-      "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen"
-    ];
-
-    patches = [
-      ./purity.patch
-      # https://reviews.llvm.org/D51899
-      ./gnu-install-dirs.patch
-      # Revert of https://reviews.llvm.org/D100879
-      # The malloc alignment assumption is incorrect for jemalloc and causes
-      # mis-compilation in firefox.
-      # See: https://bugzilla.mozilla.org/show_bug.cgi?id=1741454
-      ./revert-malloc-alignment-assumption.patch
-      ../../common/clang/add-nostdlibinc-flag.patch
-      (substituteAll {
-        src = ../../common/clang/clang-11-15-LLVMgold-path.patch;
-        libllvmLibdir = "${libllvm.lib}/lib";
-      })
-    ];
-
-    postPatch = ''
-      (cd tools && ln -s ../../clang-tools-extra extra)
-    '' + lib.optionalString stdenv.hostPlatform.isMusl ''
-      sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
-    '';
-
-    outputs = [ "out" "lib" "dev" "python" ];
-
-    postInstall = ''
-      ln -sv $out/bin/clang $out/bin/cpp
-
-      # Move libclang to 'lib' output
-      moveToOutput "lib/libclang.*" "$lib"
-      moveToOutput "lib/libclang-cpp.*" "$lib"
-      substituteInPlace $out/lib/cmake/clang/ClangTargets-release.cmake \
-          --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \
-          --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp."
-
-      mkdir -p $python/bin $python/share/{clang,scan-view}
-      mv $out/bin/{git-clang-format,scan-view} $python/bin
-      if [ -e $out/bin/set-xcode-analyzer ]; then
-        mv $out/bin/set-xcode-analyzer $python/bin
-      fi
-      mv $out/share/clang/*.py $python/share/clang
-      mv $out/share/scan-view/*.py $python/share/scan-view
-      rm $out/bin/c-index-test
-      patchShebangs $python/bin
-
-      mkdir -p $dev/bin
-      cp bin/clang-tblgen $dev/bin
-    '';
-
-    passthru = {
-      inherit libllvm;
-      isClang = true;
-      hardeningUnsupportedFlags = [ "fortify3" "zerocallusedregs" ];
-    };
-
-    meta = llvm_meta // {
-      homepage = "https://clang.llvm.org/";
-      description = "A C language family frontend for LLVM";
-      longDescription = ''
-        The Clang project provides a language front-end and tooling
-        infrastructure for languages in the C language family (C, C++, Objective
-        C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project.
-        It aims to deliver amazingly fast compiles, extremely useful error and
-        warning messages and to provide a platform for building great source
-        level tools. The Clang Static Analyzer and clang-tidy are tools that
-        automatically find bugs in your code, and are great examples of the sort
-        of tools that can be built using the Clang frontend as a library to
-        parse C/C++ code.
-      '';
-      mainProgram = "clang";
-    };
-  } // lib.optionalAttrs enableManpages {
-    pname = "clang-manpages";
-
-    buildPhase = ''
-      make docs-clang-man
-    '';
-
-    installPhase = ''
-      mkdir -p $out/share/man/man1
-      # Manually install clang manpage
-      cp docs/man/*.1 $out/share/man/man1/
-    '';
-
-    outputs = [ "out" ];
-
-    doCheck = false;
-
-    meta = llvm_meta // {
-      description = "man page for Clang ${version}";
-    };
-  });
-in self
diff --git a/pkgs/development/compilers/llvm/13/default.nix b/pkgs/development/compilers/llvm/13/default.nix
index 712c6e160d1e..ecdbd14e98e7 100644
--- a/pkgs/development/compilers/llvm/13/default.nix
+++ b/pkgs/development/compilers/llvm/13/default.nix
@@ -1,7 +1,7 @@
 { lowPrio, newScope, pkgs, lib, stdenv, cmake
 , preLibcCrossHeaders
 , fetchpatch
-, libxml2, python3, isl, fetchFromGitHub, substitute, overrideCC, wrapCCWith, wrapBintoolsWith
+, libxml2, python3, isl, fetchFromGitHub, substitute, substituteAll, overrideCC, wrapCCWith, wrapBintoolsWith
 , buildLlvmTools # tools, but from the previous stage, for cross
 , targetLlvmLibraries # libraries, but from the next stage, for cross
 , targetLlvm
@@ -82,7 +82,7 @@ in let
     then tools.bintools
     else bootBintools;
 
-  in {
+  in rec {
 
     libllvm = callPackage ./llvm {
       inherit llvm_meta;
@@ -92,7 +92,22 @@ in let
     # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
     llvm = tools.libllvm;
 
-    libclang = callPackage ./clang {
+    libclang = callPackage ../common/clang {
+      patches = [
+        ./clang/purity.patch
+        # https://reviews.llvm.org/D51899
+        ./clang/gnu-install-dirs.patch
+        # Revert of https://reviews.llvm.org/D100879
+        # The malloc alignment assumption is incorrect for jemalloc and causes
+        # mis-compilation in firefox.
+        # See: https://bugzilla.mozilla.org/show_bug.cgi?id=1741454
+        ./clang/revert-malloc-alignment-assumption.patch
+        ../common/clang/add-nostdlibinc-flag.patch
+        (substituteAll {
+          src = ../common/clang/clang-11-15-LLVMgold-path.patch;
+          libllvmLibdir = "${libllvm.lib}/lib";
+        })
+      ];
       inherit llvm_meta;
     };
 
diff --git a/pkgs/development/compilers/llvm/14/clang/default.nix b/pkgs/development/compilers/llvm/14/clang/default.nix
deleted file mode 100644
index 829edb15d600..000000000000
--- a/pkgs/development/compilers/llvm/14/clang/default.nix
+++ /dev/null
@@ -1,129 +0,0 @@
-{ lib, stdenv, llvm_meta
-, monorepoSrc, runCommand
-, substituteAll, cmake, libxml2, libllvm, version, python3
-, buildLlvmTools
-, fixDarwinDylibNames
-, enableManpages ? false
-}:
-
-let
-  self = stdenv.mkDerivation (rec {
-    pname = "clang";
-    inherit version;
-
-    src = runCommand "${pname}-src-${version}" {} ''
-      mkdir -p "$out"
-      cp -r ${monorepoSrc}/cmake "$out"
-      cp -r ${monorepoSrc}/${pname} "$out"
-      cp -r ${monorepoSrc}/clang-tools-extra "$out"
-    '';
-
-    sourceRoot = "${src.name}/${pname}";
-
-    nativeBuildInputs = [ cmake python3 ]
-      ++ lib.optional enableManpages python3.pkgs.sphinx
-      ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
-
-    buildInputs = [ libxml2 libllvm ];
-
-    cmakeFlags = [
-      "-DCLANGD_BUILD_XPC=OFF"
-      "-DLLVM_ENABLE_RTTI=ON"
-    ] ++ lib.optionals enableManpages [
-      "-DCLANG_INCLUDE_DOCS=ON"
-      "-DLLVM_ENABLE_SPHINX=ON"
-      "-DSPHINX_OUTPUT_MAN=ON"
-      "-DSPHINX_OUTPUT_HTML=OFF"
-      "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
-    ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
-      "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen"
-      "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen"
-    ];
-
-    patches = [
-      ./purity.patch
-      # https://reviews.llvm.org/D51899
-      ./gnu-install-dirs.patch
-      ../../common/clang/add-nostdlibinc-flag.patch
-      (substituteAll {
-        src = ../../common/clang/clang-11-15-LLVMgold-path.patch;
-        libllvmLibdir = "${libllvm.lib}/lib";
-      })
-    ];
-
-    postPatch = ''
-      (cd tools && ln -s ../../clang-tools-extra extra)
-    '' + lib.optionalString stdenv.hostPlatform.isMusl ''
-      sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
-    '';
-
-    outputs = [ "out" "lib" "dev" "python" ];
-
-    postInstall = ''
-      ln -sv $out/bin/clang $out/bin/cpp
-
-      # Move libclang to 'lib' output
-      moveToOutput "lib/libclang.*" "$lib"
-      moveToOutput "lib/libclang-cpp.*" "$lib"
-      substituteInPlace $out/lib/cmake/clang/ClangTargets-release.cmake \
-          --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \
-          --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp."
-
-      mkdir -p $python/bin $python/share/{clang,scan-view}
-      mv $out/bin/{git-clang-format,scan-view} $python/bin
-      if [ -e $out/bin/set-xcode-analyzer ]; then
-        mv $out/bin/set-xcode-analyzer $python/bin
-      fi
-      mv $out/share/clang/*.py $python/share/clang
-      mv $out/share/scan-view/*.py $python/share/scan-view
-      rm $out/bin/c-index-test
-      patchShebangs $python/bin
-
-      mkdir -p $dev/bin
-      cp bin/clang-tblgen $dev/bin
-    '';
-
-    passthru = {
-      inherit libllvm;
-      isClang = true;
-      hardeningUnsupportedFlags = [ "fortify3" "zerocallusedregs" ];
-    };
-
-    meta = llvm_meta // {
-      homepage = "https://clang.llvm.org/";
-      description = "A C language family frontend for LLVM";
-      longDescription = ''
-        The Clang project provides a language front-end and tooling
-        infrastructure for languages in the C language family (C, C++, Objective
-        C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project.
-        It aims to deliver amazingly fast compiles, extremely useful error and
-        warning messages and to provide a platform for building great source
-        level tools. The Clang Static Analyzer and clang-tidy are tools that
-        automatically find bugs in your code, and are great examples of the sort
-        of tools that can be built using the Clang frontend as a library to
-        parse C/C++ code.
-      '';
-      mainProgram = "clang";
-    };
-  } // lib.optionalAttrs enableManpages {
-    pname = "clang-manpages";
-
-    buildPhase = ''
-      make docs-clang-man
-    '';
-
-    installPhase = ''
-      mkdir -p $out/share/man/man1
-      # Manually install clang manpage
-      cp docs/man/*.1 $out/share/man/man1/
-    '';
-
-    outputs = [ "out" ];
-
-    doCheck = false;
-
-    meta = llvm_meta // {
-      description = "man page for Clang ${version}";
-    };
-  });
-in self
diff --git a/pkgs/development/compilers/llvm/14/default.nix b/pkgs/development/compilers/llvm/14/default.nix
index efab4ca73572..fb1b8743b6eb 100644
--- a/pkgs/development/compilers/llvm/14/default.nix
+++ b/pkgs/development/compilers/llvm/14/default.nix
@@ -1,6 +1,6 @@
 { lowPrio, newScope, pkgs, lib, stdenv, cmake
 , preLibcCrossHeaders
-, libxml2, python3, fetchFromGitHub, substitute, overrideCC, wrapCCWith, wrapBintoolsWith
+, libxml2, python3, fetchFromGitHub, substitute, substituteAll, overrideCC, wrapCCWith, wrapBintoolsWith
 , buildLlvmTools # tools, but from the previous stage, for cross
 , targetLlvmLibraries # libraries, but from the next stage, for cross
 , targetLlvm
@@ -78,7 +78,7 @@ in let
     then tools.bintools
     else bootBintools;
 
-  in {
+  in rec {
 
     libllvm = callPackage ./llvm {
       inherit llvm_meta;
@@ -88,7 +88,17 @@ in let
     # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
     llvm = tools.libllvm;
 
-    libclang = callPackage ./clang {
+    libclang = callPackage ../common/clang {
+      patches = [
+        ./clang/purity.patch
+        # https://reviews.llvm.org/D51899
+        ./clang/gnu-install-dirs.patch
+        ../common/clang/add-nostdlibinc-flag.patch
+        (substituteAll {
+          src = ../common/clang/clang-11-15-LLVMgold-path.patch;
+          libllvmLibdir = "${libllvm.lib}/lib";
+        })
+      ];
       inherit llvm_meta;
     };
 
diff --git a/pkgs/development/compilers/llvm/15/default.nix b/pkgs/development/compilers/llvm/15/default.nix
index 01112e0165e4..ce8426857ebe 100644
--- a/pkgs/development/compilers/llvm/15/default.nix
+++ b/pkgs/development/compilers/llvm/15/default.nix
@@ -1,6 +1,6 @@
 { lowPrio, newScope, pkgs, lib, stdenv, cmake, ninja
 , preLibcCrossHeaders
-, libxml2, python3, fetchFromGitHub, fetchpatch, substitute, overrideCC, wrapCCWith, wrapBintoolsWith
+, libxml2, python3, fetchFromGitHub, fetchpatch, substitute, substituteAll, overrideCC, wrapCCWith, wrapBintoolsWith
 , buildLlvmTools # tools, but from the previous stage, for cross
 , targetLlvmLibraries # libraries, but from the next stage, for cross
 , targetLlvm
@@ -84,7 +84,7 @@ in let
     then tools.bintools
     else bootBintools;
 
-  in {
+  in rec {
 
     libllvm = callPackage ./llvm {
       inherit llvm_meta;
@@ -94,7 +94,17 @@ in let
     # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
     llvm = tools.libllvm;
 
-    libclang = callPackage ./clang {
+    libclang = callPackage ../common/clang {
+      patches = [
+        ./clang/purity.patch
+        # https://reviews.llvm.org/D51899
+        ./clang/gnu-install-dirs.patch
+        ../common/clang/add-nostdlibinc-flag.patch
+        (substituteAll {
+          src = ../common/clang/clang-11-15-LLVMgold-path.patch;
+          libllvmLibdir = "${libllvm.lib}/lib";
+        })
+      ];
       inherit llvm_meta;
     };
 
diff --git a/pkgs/development/compilers/llvm/16/clang/default.nix b/pkgs/development/compilers/llvm/16/clang/default.nix
deleted file mode 100644
index c5d9af356d9e..000000000000
--- a/pkgs/development/compilers/llvm/16/clang/default.nix
+++ /dev/null
@@ -1,137 +0,0 @@
-{ lib, stdenv, llvm_meta
-, monorepoSrc, runCommand
-, substituteAll, cmake, ninja, libxml2, libllvm, version, python3
-, buildLlvmTools
-, fixDarwinDylibNames
-, enableManpages ? false
-}:
-
-let
-  self = stdenv.mkDerivation (finalAttrs: rec {
-    pname = "clang";
-    inherit version;
-
-    src = runCommand "${pname}-src-${version}" {} ''
-      mkdir -p "$out"
-      cp -r ${monorepoSrc}/cmake "$out"
-      cp -r ${monorepoSrc}/${pname} "$out"
-      cp -r ${monorepoSrc}/clang-tools-extra "$out"
-    '';
-
-    sourceRoot = "${src.name}/${pname}";
-
-    nativeBuildInputs = [ cmake ninja python3 ]
-      ++ lib.optional enableManpages python3.pkgs.sphinx
-      ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
-
-    buildInputs = [ libxml2 libllvm ];
-
-    cmakeFlags = [
-      "-DCLANG_INSTALL_PACKAGE_DIR=${placeholder "dev"}/lib/cmake/clang"
-      "-DCLANGD_BUILD_XPC=OFF"
-      "-DLLVM_ENABLE_RTTI=ON"
-    ] ++ lib.optionals enableManpages [
-      "-DCLANG_INCLUDE_DOCS=ON"
-      "-DLLVM_ENABLE_SPHINX=ON"
-      "-DSPHINX_OUTPUT_MAN=ON"
-      "-DSPHINX_OUTPUT_HTML=OFF"
-      "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
-    ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
-      "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen"
-      "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen"
-      # Added in LLVM15:
-      # `clang-tidy-confusable-chars-gen`: https://github.com/llvm/llvm-project/commit/c3574ef739fbfcc59d405985a3a4fa6f4619ecdb
-      # `clang-pseudo-gen`: https://github.com/llvm/llvm-project/commit/cd2292ef824591cc34cc299910a3098545c840c7
-      "-DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${buildLlvmTools.libclang.dev}/bin/clang-tidy-confusable-chars-gen"
-      "-DCLANG_PSEUDO_GEN=${buildLlvmTools.libclang.dev}/bin/clang-pseudo-gen"
-    ];
-
-    patches = [
-      ./purity.patch
-      # https://reviews.llvm.org/D51899
-      ./gnu-install-dirs.patch
-      ../../common/clang/add-nostdlibinc-flag.patch
-      (substituteAll {
-        src = ../../common/clang/clang-at-least-16-LLVMgold-path.patch;
-       libllvmLibdir = "${libllvm.lib}/lib";
-      })
-    ];
-
-    postPatch = ''
-      (cd tools && ln -s ../../clang-tools-extra extra)
-    '' + lib.optionalString stdenv.hostPlatform.isMusl ''
-      sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
-    '';
-
-    outputs = [ "out" "lib" "dev" "python" ];
-
-    postInstall = ''
-      ln -sv $out/bin/clang $out/bin/cpp
-
-      # Move libclang to 'lib' output
-      moveToOutput "lib/libclang.*" "$lib"
-      moveToOutput "lib/libclang-cpp.*" "$lib"
-      substituteInPlace $dev/lib/cmake/clang/ClangTargets-release.cmake \
-          --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \
-          --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp."
-
-      mkdir -p $python/bin $python/share/clang/
-      mv $out/bin/{git-clang-format,scan-view} $python/bin
-      if [ -e $out/bin/set-xcode-analyzer ]; then
-        mv $out/bin/set-xcode-analyzer $python/bin
-      fi
-      mv $out/share/clang/*.py $python/share/clang
-      rm $out/bin/c-index-test
-      patchShebangs $python/bin
-
-      mkdir -p $dev/bin
-      cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen,clang-pseudo-gen} $dev/bin
-    '';
-
-    passthru = {
-      inherit libllvm;
-      isClang = true;
-      hardeningUnsupportedFlags = [
-        "fortify3"
-      ];
-      hardeningUnsupportedFlagsByTargetPlatform = targetPlatform:
-        lib.optional (!(targetPlatform.isx86_64 || targetPlatform.isAarch64)) "zerocallusedregs"
-        ++ (finalAttrs.passthru.hardeningUnsupportedFlags or []);
-    };
-
-    meta = llvm_meta // {
-      homepage = "https://clang.llvm.org/";
-      description = "A C language family frontend for LLVM";
-      longDescription = ''
-        The Clang project provides a language front-end and tooling
-        infrastructure for languages in the C language family (C, C++, Objective
-        C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project.
-        It aims to deliver amazingly fast compiles, extremely useful error and
-        warning messages and to provide a platform for building great source
-        level tools. The Clang Static Analyzer and clang-tidy are tools that
-        automatically find bugs in your code, and are great examples of the sort
-        of tools that can be built using the Clang frontend as a library to
-        parse C/C++ code.
-      '';
-      mainProgram = "clang";
-    };
-  } // lib.optionalAttrs enableManpages {
-    pname = "clang-manpages";
-
-    ninjaFlags = [ "docs-clang-man" ];
-
-    installPhase = ''
-      mkdir -p $out/share/man/man1
-      # Manually install clang manpage
-      cp docs/man/*.1 $out/share/man/man1/
-    '';
-
-    outputs = [ "out" ];
-
-    doCheck = false;
-
-    meta = llvm_meta // {
-      description = "man page for Clang ${version}";
-    };
-  });
-in self
diff --git a/pkgs/development/compilers/llvm/16/default.nix b/pkgs/development/compilers/llvm/16/default.nix
index 99ab725273b8..5716267426b2 100644
--- a/pkgs/development/compilers/llvm/16/default.nix
+++ b/pkgs/development/compilers/llvm/16/default.nix
@@ -1,6 +1,6 @@
 { lowPrio, newScope, pkgs, lib, stdenv, cmake, ninja
 , preLibcCrossHeaders
-, libxml2, python3, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith
+, libxml2, python3, fetchFromGitHub, substituteAll, overrideCC, wrapCCWith, wrapBintoolsWith
 , buildLlvmTools # tools, but from the previous stage, for cross
 , targetLlvmLibraries # libraries, but from the next stage, for cross
 , targetLlvm
@@ -85,7 +85,7 @@ in let
     then tools.bintools
     else bootBintools;
 
-  in {
+  in rec {
 
     libllvm = callPackage ./llvm {
       inherit llvm_meta;
@@ -95,7 +95,17 @@ in let
     # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
     llvm = tools.libllvm;
 
-    libclang = callPackage ./clang {
+    libclang = callPackage ../common/clang {
+      patches = [
+        ./clang/purity.patch
+        # https://reviews.llvm.org/D51899
+        ./clang/gnu-install-dirs.patch
+        ../common/clang/add-nostdlibinc-flag.patch
+        (substituteAll {
+          src = ../common/clang/clang-at-least-16-LLVMgold-path.patch;
+         libllvmLibdir = "${libllvm.lib}/lib";
+        })
+      ];
       inherit llvm_meta;
     };
 
diff --git a/pkgs/development/compilers/llvm/17/clang/default.nix b/pkgs/development/compilers/llvm/17/clang/default.nix
deleted file mode 100644
index f7922f3d9951..000000000000
--- a/pkgs/development/compilers/llvm/17/clang/default.nix
+++ /dev/null
@@ -1,141 +0,0 @@
-{ lib, stdenv, llvm_meta
-, monorepoSrc, runCommand
-, substituteAll, cmake, ninja, libxml2, libllvm, version, python3
-, buildLlvmTools
-, fixDarwinDylibNames
-, enableManpages ? false
-}:
-
-let
-  self = stdenv.mkDerivation (finalAttrs: rec {
-    pname = "clang";
-    inherit version;
-
-    src = runCommand "${pname}-src-${version}" {} ''
-      mkdir -p "$out"
-      cp -r ${monorepoSrc}/cmake "$out"
-      cp -r ${monorepoSrc}/${pname} "$out"
-      cp -r ${monorepoSrc}/clang-tools-extra "$out"
-    '';
-
-    sourceRoot = "${src.name}/${pname}";
-
-    nativeBuildInputs = [ cmake ninja python3 ]
-      ++ lib.optional enableManpages python3.pkgs.sphinx
-      ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
-
-    buildInputs = [ libxml2 libllvm ];
-
-    cmakeFlags = [
-      "-DCLANG_INSTALL_PACKAGE_DIR=${placeholder "dev"}/lib/cmake/clang"
-      "-DCLANGD_BUILD_XPC=OFF"
-      "-DLLVM_ENABLE_RTTI=ON"
-      "-DLLVM_INCLUDE_TESTS=OFF"
-    ] ++ lib.optionals enableManpages [
-      "-DCLANG_INCLUDE_DOCS=ON"
-      "-DLLVM_ENABLE_SPHINX=ON"
-      "-DSPHINX_OUTPUT_MAN=ON"
-      "-DSPHINX_OUTPUT_HTML=OFF"
-      "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
-    ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
-      "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen"
-      "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen"
-      # Added in LLVM15:
-      # `clang-tidy-confusable-chars-gen`: https://github.com/llvm/llvm-project/commit/c3574ef739fbfcc59d405985a3a4fa6f4619ecdb
-      # `clang-pseudo-gen`: https://github.com/llvm/llvm-project/commit/cd2292ef824591cc34cc299910a3098545c840c7
-      "-DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${buildLlvmTools.libclang.dev}/bin/clang-tidy-confusable-chars-gen"
-      "-DCLANG_PSEUDO_GEN=${buildLlvmTools.libclang.dev}/bin/clang-pseudo-gen"
-    ];
-
-    patches = [
-      ./purity.patch
-      # https://reviews.llvm.org/D51899
-      ./gnu-install-dirs.patch
-      ../../common/clang/add-nostdlibinc-flag.patch
-      (substituteAll {
-        src = ../../common/clang/clang-at-least-16-LLVMgold-path.patch;
-       libllvmLibdir = "${libllvm.lib}/lib";
-      })
-    ];
-
-    postPatch = ''
-      (cd tools && ln -s ../../clang-tools-extra extra)
-    '' + lib.optionalString stdenv.hostPlatform.isMusl ''
-      sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
-    '';
-
-    outputs = [ "out" "lib" "dev" "python" ];
-
-    postInstall = ''
-      ln -sv $out/bin/clang $out/bin/cpp
-
-      mkdir -p $lib/lib/clang
-      mv $lib/lib/17 $lib/lib/clang/17
-
-      # Move libclang to 'lib' output
-      moveToOutput "lib/libclang.*" "$lib"
-      moveToOutput "lib/libclang-cpp.*" "$lib"
-      substituteInPlace $dev/lib/cmake/clang/ClangTargets-release.cmake \
-          --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \
-          --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp."
-
-      mkdir -p $python/bin $python/share/clang/
-      mv $out/bin/{git-clang-format,scan-view} $python/bin
-      if [ -e $out/bin/set-xcode-analyzer ]; then
-        mv $out/bin/set-xcode-analyzer $python/bin
-      fi
-      mv $out/share/clang/*.py $python/share/clang
-      rm $out/bin/c-index-test
-      patchShebangs $python/bin
-
-      mkdir -p $dev/bin
-      cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen,clang-pseudo-gen} $dev/bin
-    '';
-
-    passthru = {
-      inherit libllvm;
-      isClang = true;
-      hardeningUnsupportedFlags = [
-        "fortify3"
-      ];
-      hardeningUnsupportedFlagsByTargetPlatform = targetPlatform:
-        lib.optional (!(targetPlatform.isx86_64 || targetPlatform.isAarch64)) "zerocallusedregs"
-        ++ (finalAttrs.passthru.hardeningUnsupportedFlags or []);
-    };
-
-    meta = llvm_meta // {
-      homepage = "https://clang.llvm.org/";
-      description = "A C language family frontend for LLVM";
-      longDescription = ''
-        The Clang project provides a language front-end and tooling
-        infrastructure for languages in the C language family (C, C++, Objective
-        C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project.
-        It aims to deliver amazingly fast compiles, extremely useful error and
-        warning messages and to provide a platform for building great source
-        level tools. The Clang Static Analyzer and clang-tidy are tools that
-        automatically find bugs in your code, and are great examples of the sort
-        of tools that can be built using the Clang frontend as a library to
-        parse C/C++ code.
-      '';
-      mainProgram = "clang";
-    };
-  } // lib.optionalAttrs enableManpages {
-    pname = "clang-manpages";
-
-    ninjaFlags = [ "docs-clang-man" ];
-
-    installPhase = ''
-      mkdir -p $out/share/man/man1
-      # Manually install clang manpage
-      cp docs/man/*.1 $out/share/man/man1/
-    '';
-
-    outputs = [ "out" ];
-
-    doCheck = false;
-
-    meta = llvm_meta // {
-      description = "man page for Clang ${version}";
-    };
-  });
-in self
diff --git a/pkgs/development/compilers/llvm/17/default.nix b/pkgs/development/compilers/llvm/17/default.nix
index 2f2663217653..2f60666536f3 100644
--- a/pkgs/development/compilers/llvm/17/default.nix
+++ b/pkgs/development/compilers/llvm/17/default.nix
@@ -1,6 +1,6 @@
 { lowPrio, newScope, pkgs, lib, stdenv, cmake, ninja
 , preLibcCrossHeaders
-, libxml2, python3, fetchFromGitHub, fetchpatch, overrideCC, wrapCCWith, wrapBintoolsWith
+, libxml2, python3, fetchFromGitHub, fetchpatch, substituteAll, overrideCC, wrapCCWith, wrapBintoolsWith
 , buildLlvmTools # tools, but from the previous stage, for cross
 , targetLlvmLibraries # libraries, but from the next stage, for cross
 , targetLlvm
@@ -80,7 +80,7 @@ in let
     then tools.bintools
     else bootBintools;
 
-  in {
+  in rec {
 
     libllvm = callPackage ./llvm {
       inherit llvm_meta;
@@ -90,7 +90,17 @@ in let
     # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
     llvm = tools.libllvm;
 
-    libclang = callPackage ./clang {
+    libclang = callPackage ../common/clang {
+      patches = [
+        ./clang/purity.patch
+        # https://reviews.llvm.org/D51899
+        ./clang/gnu-install-dirs.patch
+        ../common/clang/add-nostdlibinc-flag.patch
+        (substituteAll {
+          src = ../common/clang/clang-at-least-16-LLVMgold-path.patch;
+          libllvmLibdir = "${libllvm.lib}/lib";
+        })
+      ];
       inherit llvm_meta;
     };
 
diff --git a/pkgs/development/compilers/llvm/18/default.nix b/pkgs/development/compilers/llvm/18/default.nix
index 4bc56be45b3e..0a30288755e6 100644
--- a/pkgs/development/compilers/llvm/18/default.nix
+++ b/pkgs/development/compilers/llvm/18/default.nix
@@ -1,6 +1,6 @@
 { lowPrio, newScope, pkgs, lib, stdenv, cmake, ninja
 , preLibcCrossHeaders
-, libxml2, python3, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith
+, libxml2, python3, fetchFromGitHub, substituteAll, overrideCC, wrapCCWith, wrapBintoolsWith
 , buildLlvmTools # tools, but from the previous stage, for cross
 , targetLlvmLibraries # libraries, but from the next stage, for cross
 , targetLlvm
@@ -80,7 +80,7 @@ in let
     then tools.bintools
     else bootBintools;
 
-  in {
+  in rec {
 
     libllvm = callPackage ./llvm {
       inherit llvm_meta;
@@ -90,7 +90,17 @@ in let
     # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
     llvm = tools.libllvm;
 
-    libclang = callPackage ./clang {
+    libclang = callPackage ../common/clang {
+      patches = [
+        ./clang/purity.patch
+        # https://reviews.llvm.org/D51899
+        ./clang/gnu-install-dirs.patch
+        ../common/clang/add-nostdlibinc-flag.patch
+        (substituteAll {
+          src = ../common/clang/clang-at-least-16-LLVMgold-path.patch;
+          libllvmLibdir = "${libllvm.lib}/lib";
+        })
+      ];
       inherit llvm_meta;
     };
 
diff --git a/pkgs/development/compilers/llvm/15/clang/default.nix b/pkgs/development/compilers/llvm/common/clang/default.nix
index de789edaa9ff..2373795b49fd 100644
--- a/pkgs/development/compilers/llvm/15/clang/default.nix
+++ b/pkgs/development/compilers/llvm/common/clang/default.nix
@@ -1,109 +1,145 @@
-{ lib, stdenv, llvm_meta
-, monorepoSrc, runCommand
-, substituteAll, cmake, ninja, libxml2, libllvm, version, python3
+{ lib
+, stdenv
+, llvm_meta
+, patches ? []
+, src ? null
+, monorepoSrc ? null
+, runCommand
+, substituteAll
+, cmake
+, ninja
+, libxml2
+, libllvm
+, release_version
+, version
+, python3
 , buildLlvmTools
 , fixDarwinDylibNames
 , enableManpages ? false
+, clang-tools-extra_src ? null
 }:
 
 let
-  self = stdenv.mkDerivation (finalAttrs: rec {
-    pname = "clang";
-    inherit version;
+  pname = "clang";
 
-    src = runCommand "${pname}-src-${version}" {} ''
+  src' = if monorepoSrc != null then
+    runCommand "${pname}-src-${version}" {} ''
       mkdir -p "$out"
       cp -r ${monorepoSrc}/cmake "$out"
       cp -r ${monorepoSrc}/${pname} "$out"
       cp -r ${monorepoSrc}/clang-tools-extra "$out"
-    '';
+    '' else src;
+
+  self = stdenv.mkDerivation (finalAttrs: rec {
+    inherit pname version patches;
 
-    sourceRoot = "${src.name}/${pname}";
+    src = src';
 
-    nativeBuildInputs = [ cmake ninja python3 ]
+    sourceRoot = if lib.versionOlder release_version "13" then null
+      else "${src.name}/${pname}";
+
+    nativeBuildInputs = [ cmake ]
+      ++ (lib.optional (lib.versionAtLeast release_version "15") ninja)
+      ++ [ python3 ]
+      ++ lib.optional (lib.versionAtLeast version "18" && enableManpages) python3.pkgs.myst-parser
       ++ lib.optional enableManpages python3.pkgs.sphinx
       ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
     buildInputs = [ libxml2 libllvm ];
 
-    cmakeFlags = [
+    cmakeFlags = (lib.optionals (lib.versionAtLeast release_version "15") [
       "-DCLANG_INSTALL_PACKAGE_DIR=${placeholder "dev"}/lib/cmake/clang"
+    ]) ++ [
       "-DCLANGD_BUILD_XPC=OFF"
       "-DLLVM_ENABLE_RTTI=ON"
+    ] ++ lib.optionals (lib.versionAtLeast release_version "17") [
+      "-DLLVM_INCLUDE_TESTS=OFF"
     ] ++ lib.optionals enableManpages [
       "-DCLANG_INCLUDE_DOCS=ON"
       "-DLLVM_ENABLE_SPHINX=ON"
       "-DSPHINX_OUTPUT_MAN=ON"
       "-DSPHINX_OUTPUT_HTML=OFF"
       "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
-    ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
+    ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) ([
       "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen"
       "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen"
+    ] ++ lib.optionals (lib.versionAtLeast release_version "15") [
       # Added in LLVM15:
       # `clang-tidy-confusable-chars-gen`: https://github.com/llvm/llvm-project/commit/c3574ef739fbfcc59d405985a3a4fa6f4619ecdb
       # `clang-pseudo-gen`: https://github.com/llvm/llvm-project/commit/cd2292ef824591cc34cc299910a3098545c840c7
       "-DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${buildLlvmTools.libclang.dev}/bin/clang-tidy-confusable-chars-gen"
       "-DCLANG_PSEUDO_GEN=${buildLlvmTools.libclang.dev}/bin/clang-pseudo-gen"
-    ];
-
-    patches = [
-      ./purity.patch
-      # https://reviews.llvm.org/D51899
-      ./gnu-install-dirs.patch
-      ../../common/clang/add-nostdlibinc-flag.patch
-      (substituteAll {
-        src = ../../common/clang/clang-11-15-LLVMgold-path.patch;
-        libllvmLibdir = "${libllvm.lib}/lib";
-      })
-    ];
-
-    postPatch = ''
+    ]);
+
+    postPatch = (if lib.versionOlder release_version "13" then ''
+      sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \
+             -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \
+             lib/Driver/ToolChains/*.cpp
+    '' else ''
       (cd tools && ln -s ../../clang-tools-extra extra)
-    '' + lib.optionalString stdenv.hostPlatform.isMusl ''
+    '') + lib.optionalString stdenv.hostPlatform.isMusl ''
       sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
     '';
 
     outputs = [ "out" "lib" "dev" "python" ];
 
-    env = lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) {
-      # The following warning is triggered with (at least) gcc >=
-      # 12, but appears to occur only for cross compiles.
-      NIX_CFLAGS_COMPILE = "-Wno-maybe-uninitialized";
-    };
-
     postInstall = ''
       ln -sv $out/bin/clang $out/bin/cpp
+    '' + (lib.optionalString (lib.versions.major release_version == "17") ''
+
+      mkdir -p $lib/lib/clang
+      mv $lib/lib/17 $lib/lib/clang/17
+    '') + ''
 
       # Move libclang to 'lib' output
       moveToOutput "lib/libclang.*" "$lib"
       moveToOutput "lib/libclang-cpp.*" "$lib"
+    '' + (if lib.versionOlder release_version "15" then ''
+      substituteInPlace $out/lib/cmake/clang/ClangTargets-release.cmake \
+          --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \
+          --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp."
+    '' else ''
       substituteInPlace $dev/lib/cmake/clang/ClangTargets-release.cmake \
           --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \
           --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp."
+    '') + ''
 
+    '' + (if lib.versionOlder release_version "15" then ''
+      mkdir -p $python/bin $python/share/{clang,scan-view}
+    '' else ''
       mkdir -p $python/bin $python/share/clang/
+    '') + ''
       mv $out/bin/{git-clang-format,scan-view} $python/bin
       if [ -e $out/bin/set-xcode-analyzer ]; then
         mv $out/bin/set-xcode-analyzer $python/bin
       fi
       mv $out/share/clang/*.py $python/share/clang
+    '' + (lib.optionalString (lib.versionOlder release_version "15") ''
+      mv $out/share/scan-view/*.py $python/share/scan-view
+    '') + ''
       rm $out/bin/c-index-test
       patchShebangs $python/bin
 
       mkdir -p $dev/bin
+    '' + (if lib.versionOlder release_version "15" then ''
+      cp bin/clang-tblgen $dev/bin
+    '' else ''
       cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen,clang-pseudo-gen} $dev/bin
-    '';
+    '');
 
     passthru = {
       inherit libllvm;
       isClang = true;
+    } // (lib.optionalAttrs (lib.versionAtLeast release_version "15") {
       hardeningUnsupportedFlags = [
         "fortify3"
       ];
       hardeningUnsupportedFlagsByTargetPlatform = targetPlatform:
         lib.optional (!(targetPlatform.isx86_64 || targetPlatform.isAarch64)) "zerocallusedregs"
         ++ (finalAttrs.passthru.hardeningUnsupportedFlags or []);
-    };
+    }) // (lib.optionalAttrs (lib.versionOlder release_version "15") {
+      hardeningUnsupportedFlags = [ "fortify3" "zerocallusedregs" ];
+    });
 
     meta = llvm_meta // {
       homepage = "https://clang.llvm.org/";
@@ -121,11 +157,9 @@ let
       '';
       mainProgram = "clang";
     };
-  } // lib.optionalAttrs enableManpages {
+  } // lib.optionalAttrs enableManpages ({
     pname = "clang-manpages";
 
-    ninjaFlags = [ "docs-clang-man" ];
-
     installPhase = ''
       mkdir -p $out/share/man/man1
       # Manually install clang manpage
@@ -139,5 +173,29 @@ let
     meta = llvm_meta // {
       description = "man page for Clang ${version}";
     };
-  });
+  } // (if lib.versionOlder release_version "15" then {
+    buildPhase = ''
+      make docs-clang-man
+    '';
+  } else {
+    ninjaFlags = [ "docs-clang-man" ];
+  })) // (lib.optionalAttrs (clang-tools-extra_src != null) { inherit clang-tools-extra_src; })
+    // (lib.optionalAttrs (lib.versionOlder release_version "13") {
+      unpackPhase = ''
+        unpackFile $src
+        mv clang-* clang
+        sourceRoot=$PWD/clang
+        unpackFile ${clang-tools-extra_src}
+        mv clang-tools-extra-* $sourceRoot/tools/extra
+        substituteInPlace $sourceRoot/tools/extra/clangd/quality/CompletionModel.cmake \
+          --replace ' ''${CMAKE_SOURCE_DIR}/../clang-tools-extra' ' ''${CMAKE_SOURCE_DIR}/tools/extra'
+      '';
+    })
+  // (lib.optionalAttrs (lib.versionAtLeast release_version "15") {
+    env = lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) {
+      # The following warning is triggered with (at least) gcc >=
+      # 12, but appears to occur only for cross compiles.
+      NIX_CFLAGS_COMPILE = "-Wno-maybe-uninitialized";
+    };
+  }));
 in self
diff --git a/pkgs/development/compilers/llvm/git/clang/default.nix b/pkgs/development/compilers/llvm/git/clang/default.nix
deleted file mode 100644
index 1e777c6132e4..000000000000
--- a/pkgs/development/compilers/llvm/git/clang/default.nix
+++ /dev/null
@@ -1,139 +0,0 @@
-{ lib, stdenv, llvm_meta
-, monorepoSrc, runCommand
-, substituteAll, cmake, ninja, libxml2, libllvm, version, python3
-, buildLlvmTools
-, fixDarwinDylibNames
-, enableManpages ? false
-}:
-
-let
-  self = stdenv.mkDerivation (finalAttrs: rec {
-    pname = "clang";
-    inherit version;
-
-    src = runCommand "${pname}-src-${version}" {} ''
-      mkdir -p "$out"
-      cp -r ${monorepoSrc}/cmake "$out"
-      cp -r ${monorepoSrc}/${pname} "$out"
-      cp -r ${monorepoSrc}/clang-tools-extra "$out"
-    '';
-
-    sourceRoot = "${src.name}/${pname}";
-
-    nativeBuildInputs = [ cmake ninja python3 ]
-      ++ lib.optional (lib.versionAtLeast version "18" && enableManpages) python3.pkgs.myst-parser
-      ++ lib.optional enableManpages python3.pkgs.sphinx
-      ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
-
-    buildInputs = [ libxml2 libllvm ];
-
-    cmakeFlags = [
-      "-DCLANG_INSTALL_PACKAGE_DIR=${placeholder "dev"}/lib/cmake/clang"
-      "-DCLANGD_BUILD_XPC=OFF"
-      "-DLLVM_ENABLE_RTTI=ON"
-      "-DLLVM_INCLUDE_TESTS=OFF"
-    ] ++ lib.optionals enableManpages [
-      "-DCLANG_INCLUDE_DOCS=ON"
-      "-DLLVM_ENABLE_SPHINX=ON"
-      "-DSPHINX_OUTPUT_MAN=ON"
-      "-DSPHINX_OUTPUT_HTML=OFF"
-      "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
-    ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
-      "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen"
-      "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen"
-      # Added in LLVM15:
-      # `clang-tidy-confusable-chars-gen`: https://github.com/llvm/llvm-project/commit/c3574ef739fbfcc59d405985a3a4fa6f4619ecdb
-      # `clang-pseudo-gen`: https://github.com/llvm/llvm-project/commit/cd2292ef824591cc34cc299910a3098545c840c7
-      "-DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${buildLlvmTools.libclang.dev}/bin/clang-tidy-confusable-chars-gen"
-      "-DCLANG_PSEUDO_GEN=${buildLlvmTools.libclang.dev}/bin/clang-pseudo-gen"
-    ];
-
-    patches = [
-      ./purity.patch
-      # https://reviews.llvm.org/D51899
-      ./gnu-install-dirs.patch
-      ../../common/clang/add-nostdlibinc-flag.patch
-      (substituteAll {
-        src = ../../common/clang/clang-at-least-16-LLVMgold-path.patch;
-       libllvmLibdir = "${libllvm.lib}/lib";
-      })
-    ];
-
-    postPatch = ''
-      (cd tools && ln -s ../../clang-tools-extra extra)
-    '' + lib.optionalString stdenv.hostPlatform.isMusl ''
-      sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
-    '';
-
-    outputs = [ "out" "lib" "dev" "python" ];
-
-    postInstall = ''
-      ln -sv $out/bin/clang $out/bin/cpp
-
-      # Move libclang to 'lib' output
-      moveToOutput "lib/libclang.*" "$lib"
-      moveToOutput "lib/libclang-cpp.*" "$lib"
-      substituteInPlace $dev/lib/cmake/clang/ClangTargets-release.cmake \
-          --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \
-          --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp."
-
-      mkdir -p $python/bin $python/share/clang/
-      mv $out/bin/{git-clang-format,scan-view} $python/bin
-      if [ -e $out/bin/set-xcode-analyzer ]; then
-        mv $out/bin/set-xcode-analyzer $python/bin
-      fi
-      mv $out/share/clang/*.py $python/share/clang
-      rm $out/bin/c-index-test
-      patchShebangs $python/bin
-
-      mkdir -p $dev/bin
-      cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen,clang-pseudo-gen} $dev/bin
-    '';
-
-    passthru = {
-      inherit libllvm;
-      isClang = true;
-      hardeningUnsupportedFlags = [
-        "fortify3"
-      ];
-      hardeningUnsupportedFlagsByTargetPlatform = targetPlatform:
-        lib.optional (!(targetPlatform.isx86_64 || targetPlatform.isAarch64)) "zerocallusedregs"
-        ++ (finalAttrs.passthru.hardeningUnsupportedFlags or []);
-    };
-
-    meta = llvm_meta // {
-      homepage = "https://clang.llvm.org/";
-      description = "A C language family frontend for LLVM";
-      longDescription = ''
-        The Clang project provides a language front-end and tooling
-        infrastructure for languages in the C language family (C, C++, Objective
-        C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project.
-        It aims to deliver amazingly fast compiles, extremely useful error and
-        warning messages and to provide a platform for building great source
-        level tools. The Clang Static Analyzer and clang-tidy are tools that
-        automatically find bugs in your code, and are great examples of the sort
-        of tools that can be built using the Clang frontend as a library to
-        parse C/C++ code.
-      '';
-      mainProgram = "clang";
-    };
-  } // lib.optionalAttrs enableManpages {
-    pname = "clang-manpages";
-
-    ninjaFlags = [ "docs-clang-man" ];
-
-    installPhase = ''
-      mkdir -p $out/share/man/man1
-      # Manually install clang manpage
-      cp docs/man/*.1 $out/share/man/man1/
-    '';
-
-    outputs = [ "out" ];
-
-    doCheck = false;
-
-    meta = llvm_meta // {
-      description = "man page for Clang ${version}";
-    };
-  });
-in self
diff --git a/pkgs/development/compilers/llvm/git/default.nix b/pkgs/development/compilers/llvm/git/default.nix
index 1b65ce81055b..56fae64d59d8 100644
--- a/pkgs/development/compilers/llvm/git/default.nix
+++ b/pkgs/development/compilers/llvm/git/default.nix
@@ -1,6 +1,6 @@
 { lowPrio, newScope, pkgs, lib, stdenv, cmake, ninja
 , preLibcCrossHeaders
-, libxml2, python3, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith
+, libxml2, python3, fetchFromGitHub, substituteAll, overrideCC, wrapCCWith, wrapBintoolsWith
 , buildLlvmTools # tools, but from the previous stage, for cross
 , targetLlvmLibraries # libraries, but from the next stage, for cross
 , targetLlvm
@@ -85,7 +85,7 @@ in let
     then tools.bintools
     else bootBintools;
 
-  in {
+  in rec {
 
     libllvm = callPackage ./llvm {
       inherit llvm_meta;
@@ -95,7 +95,17 @@ in let
     # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get*
     llvm = tools.libllvm;
 
-    libclang = callPackage ./clang {
+    libclang = callPackage ../common/clang {
+      patches = [
+        ./clang/purity.patch
+        # https://reviews.llvm.org/D51899
+        ./clang/gnu-install-dirs.patch
+        ../common/clang/add-nostdlibinc-flag.patch
+        (substituteAll {
+          src = ../common/clang/clang-at-least-16-LLVMgold-path.patch;
+          libllvmLibdir = "${libllvm.lib}/lib";
+        })
+      ];
       inherit llvm_meta;
     };
 
diff --git a/pkgs/development/ocaml-modules/janestreet/0.12.nix b/pkgs/development/ocaml-modules/janestreet/0.12.nix
index 2ea593e10b44..a3b2ac581555 100644
--- a/pkgs/development/ocaml-modules/janestreet/0.12.nix
+++ b/pkgs/development/ocaml-modules/janestreet/0.12.nix
@@ -24,7 +24,7 @@ with self;
     hash = "0gl89zpgsf3n30nb6v5cns27g2bfg4rf3s2427gqvwbkr5gcf7ri";
     meta.description = "Full standard library replacement for OCaml";
     propagatedBuildInputs = [ sexplib0 ];
-    buildInputs = [ dune_1 ];
+    buildInputs = [ dune-configurator ];
   };
 
   stdio = janePackage {
@@ -106,7 +106,6 @@ with self;
   };
 
   ppx_expect = janePackage {
-    duneVersion = "3";
     pname = "ppx_expect";
     hash = "1wawsbjfkri4sw52n8xqrzihxc3xfpdicv3ahz83a1rsn4lb8j5q";
     meta.description = "Cram like framework for OCaml";
@@ -170,8 +169,9 @@ with self;
   };
 
   base_quickcheck = janePackage {
+    version = "0.12.1";
     pname = "base_quickcheck";
-    hash = "1la6qgq1zwmfyq1hqy6i337w435ym5yqgx2ygk86qip6nws0s6r3";
+    hash = "sha256-ABfUtOzdtGrYR6EgtVYkmxRvsH48jJwSVVOwf4Od12Y=";
     meta.description = "Randomized testing framework, designed for compatibility with Base";
     propagatedBuildInputs = [ ppx_base ppx_fields_conv ppx_let splittable_random ];
   };
@@ -209,7 +209,7 @@ with self;
     pname = "jst-config";
     hash = "0yxcz13vda1mdh9ah7qqxwfxpcqang5sgdssd8721rszbwqqaw93";
     meta.description = "Compile-time configuration for Jane Street libraries";
-    buildInputs = [ dune_1 ppx_assert ];
+    buildInputs = [ dune-configurator ppx_assert ];
   };
 
   ppx_optcomp = janePackage {
@@ -276,7 +276,6 @@ with self;
   };
 
   ppx_jane = janePackage {
-    duneVersion = "3";
     pname = "ppx_jane";
     hash = "1a2602isqzsh640q20qbmarx0sc316mlsqc3i25ysv2kdyhh0kyw";
     meta.description = "Standard Jane Street ppx rewriters";
@@ -284,7 +283,6 @@ with self;
   };
 
   base_bigstring = janePackage {
-    duneVersion = "3";
     pname = "base_bigstring";
     hash = "0rbgyg511847fbnxad40prz2dyp4da6sffzyzl88j18cxqxbh1by";
     meta.description = "String type based on [Bigarray], for use in I/O and C-bindings";
@@ -306,7 +304,6 @@ with self;
   };
 
   core_kernel = janePackage {
-    duneVersion = "3";
     pname = "core_kernel";
     version = "0.12.3";
     hash = "sha256-bDgxuOILAs4FYB8o92ysPHDdEzflZMsU/jk5hB9xfuc=";
@@ -316,7 +313,6 @@ with self;
   };
 
   spawn = janePackage {
-    duneVersion = "3";
     pname = "spawn";
     version = "0.13.0";
     hash = "1w003k1kw1lmyiqlk58gkxx8rac7dchiqlz6ah7aj7bh49b36ppf";
@@ -325,7 +321,6 @@ with self;
   };
 
   core = janePackage {
-    duneVersion = "3";
     pname = "core";
     version = "0.12.3";
     hash = "1vmjqiafkg45hqfvahx6jnlaww1q4a4215k8znbgprf0qn3zymnj";
@@ -335,7 +330,6 @@ with self;
   };
 
   async_kernel = janePackage {
-    duneVersion = "3";
     pname = "async_kernel";
     hash = "1d9illx7vvpblj1i2r9y0f2yff2fbhy3rp4hhvamq1n9n3lvxmh2";
     meta.description = "Monadic concurrency library";
@@ -343,7 +337,6 @@ with self;
   };
 
   protocol_version_header = janePackage {
-    duneVersion = "3";
     pname = "protocol_version_header";
     hash = "14vqhx3r84rlfhcjq52gxdqksckiaswlck9s47g7y2z1lsc17v7r";
     meta.description = "Protocol versioning";
@@ -351,7 +344,6 @@ with self;
   };
 
   async_rpc_kernel = janePackage {
-    duneVersion = "3";
     pname = "async_rpc_kernel";
     hash = "1znhqbzx4fp58i7dbcgyv5rx7difbhb5d8cbqzv96yqvbn67lsjk";
     meta.description = "Platform-independent core of Async RPC library";
@@ -359,7 +351,6 @@ with self;
   };
 
   async_unix = janePackage {
-    duneVersion = "3";
     pname = "async_unix";
     hash = "09h10rdyykbm88n6r9nb5a22mlb6vcxa04q6hvrcr0kys6qhhqmb";
     meta.description = "Monadic concurrency library";
@@ -367,7 +358,6 @@ with self;
   };
 
   async_extra = janePackage {
-    duneVersion = "3";
     pname = "async_extra";
     hash = "10j4mwlyqvf67yrp5dwd857llqjinpnnykmlzw2gpmks9azxk6mh";
     meta.description = "Monadic concurrency library";
@@ -375,7 +365,6 @@ with self;
   };
 
   textutils = janePackage {
-    duneVersion = "3";
     pname = "textutils";
     hash = "0302awqihf3abib9mvzvn4g8m364hm6jxry1r3kc01hzybhy9acq";
     meta.description = "Text output utilities";
@@ -383,7 +372,6 @@ with self;
   };
 
   async = janePackage {
-    duneVersion = "3";
     pname = "async";
     hash = "0pk7z3h2gi21nfchvmjz2wx516bynf9vgwf84zf5qhvlvqqsmyrx";
     meta.description = "Monadic concurrency library";
@@ -391,7 +379,6 @@ with self;
   };
 
   async_find = janePackage {
-    duneVersion = "3";
     pname = "async_find";
     hash = "0qsz9f15s5rlk6za10s810v6nlkdxg2g9p1827lcpa7nhjcpi673";
     meta.description = "Directory traversal with Async";
@@ -399,7 +386,6 @@ with self;
   };
 
   re2 = janePackage {
-    duneVersion = "3";
     pname = "re2";
     version = "0.12.1";
     hash = "sha256-NPQKKUSwckZx4GN4wX2sc0Mn7bes6p79oZrN6xouc6o=";
@@ -412,7 +398,6 @@ with self;
   };
 
   shell = janePackage {
-    duneVersion = "3";
     pname = "shell";
     hash = "158857rdr6qgglc5iksg0l54jgf51b5lmsw7nlazpxwdwc9fcn5n";
     meta.description = "Yet another implementation of fork&exec and related functionality";
@@ -421,7 +406,6 @@ with self;
   };
 
   async_shell = janePackage {
-    duneVersion = "3";
     pname = "async_shell";
     hash = "0cxln9hkc3cy522la9yi9p23qjwl69kqmadsq4lnjh5bxdad06sv";
     meta.description = "Shell helpers for Async";
@@ -429,7 +413,6 @@ with self;
   };
 
   core_bench = janePackage {
-    duneVersion = "3";
     pname = "core_bench";
     hash = "00hyzbbj19dkcw0vhfnc8w0ca3zkjriwwvl00ssa0a2g9mygijdm";
     meta.description = "Benchmarking library";
@@ -437,7 +420,6 @@ with self;
   };
 
   core_extended = janePackage {
-    duneVersion = "3";
     pname = "core_extended";
     hash = "1gwx66235irpf5krb1r25a3c7w52qhmass8hp7rdv89il9jn49w4";
     meta.description = "Extra components that are not as closely vetted or as stable as Core";
@@ -445,7 +427,6 @@ with self;
   };
 
   sexp_pretty = janePackage {
-    duneVersion = "3";
     pname = "sexp_pretty";
     hash = "06hdsaszc5cd7fphiblbn4r1sh36xgjwf2igzr2rvlzqs7jiv2v4";
     meta.description = "S-expression pretty-printer";
@@ -453,7 +434,6 @@ with self;
   };
 
   expect_test_helpers_kernel = janePackage {
-    duneVersion = "3";
     pname = "expect_test_helpers_kernel";
     hash = "18ya187y2i2hfxr771sd9vy5jdsa30vhs56yjdhwk06v01b2fzbq";
     meta.description = "Helpers for writing expectation tests";
@@ -462,7 +442,6 @@ with self;
   };
 
   expect_test_helpers = janePackage {
-    duneVersion = "3";
     pname = "expect_test_helpers";
     hash = "0ixqck2lnsmz107yw0q2sr8va80skjpldx7lz4ymjiq2vsghk0rb";
     meta.description = "Async helpers for writing expectation tests";
@@ -470,7 +449,6 @@ with self;
   };
 
   patience_diff = janePackage {
-    duneVersion = "3";
     pname = "patience_diff";
     hash = "055kd3piadjnplip8c8q99ssh79d4irmhg2wng7aida5pbqp2p9f";
     meta.description = "Diff library using Bram Cohen's patience diff algorithm";
@@ -478,45 +456,10 @@ with self;
   };
 
   ecaml = janePackage {
-    duneVersion = "3";
     pname = "ecaml";
     hash = "0n9xi6agc3lgyj2nsi10cbif0xwn57xyaranad9r285rmbxrgjh7";
     meta.description = "Library for writing Emacs plugin in OCaml";
     propagatedBuildInputs = [ async expect_test_helpers_kernel ];
   };
 
-  ### Packages at version 0.11, with dependencies at version 0.12
-
-  configurator = janePackage {
-    pname = "configurator";
-    version = "0.11.0";
-    hash = "0h686630cscav7pil8c3w0gbh6rj4b41dvbnwmicmlkc746q5bfk";
-    propagatedBuildInputs = [ stdio ];
-    meta.description = "Helper library for gathering system configuration";
-  };
-
-  ppx_core = janePackage {
-    pname = "ppx_core";
-    version = "0.11.0";
-    hash = "11hgm9mxig4cm3c827f6dns9mjv3pf8g6skf10x0gw9xnp1dmzmx";
-    propagatedBuildInputs = [ ppxlib ];
-    meta.description = "Deprecated (see ppxlib)";
-  };
-
-  ppx_driver = janePackage {
-    pname = "ppx_driver";
-    version = "0.11.0";
-    hash = "00kfx6js2kxk57k4v7hiqvwk7h35whgjihnxf75m82rnaf4yzvfi";
-    propagatedBuildInputs = [ ppxlib ];
-    meta.description = "Deprecated (see ppxlib)";
-  };
-
-  ppx_type_conv = janePackage {
-    pname = "ppx_type_conv";
-    version = "0.11.0";
-    hash = "04dbrglqqhkas25cpjz8xhjcbpk141c35qggzw66bn69izczfmaf";
-    propagatedBuildInputs = [ ppxlib ];
-    meta.description = "Deprecated (see ppxlib)";
-  };
-
 }
diff --git a/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix b/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix
index e5a79ba598f4..bbfd492cb64f 100644
--- a/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix
+++ b/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix
@@ -1,6 +1,6 @@
 { lib, fetchFromGitHub, buildDunePackage, defaultVersion ? "0.12.0" }:
 
-{ pname, version ? defaultVersion, duneVersion ? "1", hash, ...}@args:
+{ pname, version ? defaultVersion, duneVersion ? "3", hash, ...}@args:
 
 buildDunePackage (args // {
   inherit version duneVersion;
diff --git a/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix b/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix
index daed1a7fbffb..9802d07d4a4f 100644
--- a/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix
+++ b/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix
@@ -8,8 +8,6 @@ buildDunePackage rec {
    pname = "ocaml-migrate-parsetree";
    version = "1.8.0";
 
-   duneVersion = if lib.versionAtLeast ocaml.version "4.08" then "3" else "1";
-
    src = fetchFromGitHub {
      owner = "ocaml-ppx";
      repo = pname;
diff --git a/pkgs/development/ocaml-modules/ocaml-result/default.nix b/pkgs/development/ocaml-modules/ocaml-result/default.nix
index 15e8f96a4846..2814c6c52806 100644
--- a/pkgs/development/ocaml-modules/ocaml-result/default.nix
+++ b/pkgs/development/ocaml-modules/ocaml-result/default.nix
@@ -1,6 +1,6 @@
-{ lib, buildDunePackage, fetchurl, ocaml }:
+{ lib, buildDunePackage, fetchurl }:
 
-buildDunePackage (rec {
+buildDunePackage rec {
   pname = "result";
   version = "1.5";
 
@@ -19,6 +19,4 @@ buildDunePackage (rec {
     '';
     license = lib.licenses.bsd3;
   };
-} // lib.optionalAttrs (!lib.versionAtLeast ocaml.version "4.08") {
-  duneVersion = "1";
-})
+}
diff --git a/pkgs/development/ocaml-modules/octavius/default.nix b/pkgs/development/ocaml-modules/octavius/default.nix
index 5c108ac6b80e..1a973da5e84d 100644
--- a/pkgs/development/ocaml-modules/octavius/default.nix
+++ b/pkgs/development/ocaml-modules/octavius/default.nix
@@ -1,6 +1,6 @@
-{ lib, fetchFromGitHub, buildDunePackage, ocaml }:
+{ lib, fetchFromGitHub, buildDunePackage }:
 
-buildDunePackage (rec {
+buildDunePackage rec {
   pname = "octavius";
   version = "1.2.2";
 
@@ -21,6 +21,4 @@ buildDunePackage (rec {
     license = licenses.isc;
     maintainers = with maintainers; [ vbgl ];
   };
-} // lib.optionalAttrs (!lib.versionAtLeast ocaml.version "4.08") {
-  duneVersion = "1";
-})
+}
diff --git a/pkgs/development/ocaml-modules/ppx_derivers/default.nix b/pkgs/development/ocaml-modules/ppx_derivers/default.nix
index 49217781b8ac..ebf19c70ff30 100644
--- a/pkgs/development/ocaml-modules/ppx_derivers/default.nix
+++ b/pkgs/development/ocaml-modules/ppx_derivers/default.nix
@@ -1,6 +1,6 @@
-{ lib, fetchFromGitHub, buildDunePackage, ocaml }:
+{ lib, fetchFromGitHub, buildDunePackage }:
 
-buildDunePackage (rec {
+buildDunePackage rec {
   pname = "ppx_derivers";
   version = "1.2.1";
 
@@ -19,6 +19,4 @@ buildDunePackage (rec {
     maintainers = [ lib.maintainers.vbgl ];
     inherit (src.meta) homepage;
   };
-} // lib.optionalAttrs (!lib.versionAtLeast ocaml.version "4.08") {
-  duneVersion = "1";
-})
+}
diff --git a/pkgs/development/ocaml-modules/ppxlib/default.nix b/pkgs/development/ocaml-modules/ppxlib/default.nix
index 0998b5d6a134..ab0e6bd30c38 100644
--- a/pkgs/development/ocaml-modules/ppxlib/default.nix
+++ b/pkgs/development/ocaml-modules/ppxlib/default.nix
@@ -12,14 +12,12 @@ let param = {
   "0.8.1" = {
     sha256 = "sha256-pct57oO7qAMEtlvEfymFOCvviWaLG0b5/7NzTC8vdSE=";
     max_version = "4.10";
-    useDune2 = false;
     OMP = [ ocaml-migrate-parsetree ];
   };
   "0.13.0" = {
     sha256 = "sha256-geHz0whQDg5/YQjVsN2iuHlkClwh7z3Eqb2QOBzuOdk=";
     min_version = "4.07";
     max_version = "4.11";
-    useDune2 = false;
     OMP = [ ocaml-migrate-parsetree ];
   };
   "0.15.0" = {
@@ -80,8 +78,6 @@ buildDunePackage rec {
   pname = "ppxlib";
   inherit version;
 
-  duneVersion = if param.useDune2 or true then "3" else "1";
-
   src = fetchurl {
     url = "https://github.com/ocaml-ppx/ppxlib/releases/download/${version}/ppxlib-${version}.tbz";
     inherit (param) sha256;
diff --git a/pkgs/development/python-modules/pysimplegui/default.nix b/pkgs/development/python-modules/pysimplegui/default.nix
index 30e5de7abd8d..58deefb4f3d3 100644
--- a/pkgs/development/python-modules/pysimplegui/default.nix
+++ b/pkgs/development/python-modules/pysimplegui/default.nix
@@ -29,7 +29,8 @@ buildPythonPackage rec {
   meta = with lib; {
     description = "Python GUIs for Humans";
     homepage = "https://github.com/PySimpleGUI/PySimpleGUI";
-    license = licenses.lgpl3Plus;
+    license = licenses.unfree;
     maintainers = with maintainers; [ lucasew ];
+    broken = true; # update to v5 broke the package, it now needs rsa and is trying to access an X11 socket?
   };
 }
diff --git a/pkgs/development/python-modules/pytest-cases/default.nix b/pkgs/development/python-modules/pytest-cases/default.nix
index 410f0da478ce..9c89a38c1059 100644
--- a/pkgs/development/python-modules/pytest-cases/default.nix
+++ b/pkgs/development/python-modules/pytest-cases/default.nix
@@ -10,14 +10,14 @@
 
 buildPythonPackage rec {
   pname = "pytest-cases";
-  version = "3.8.4";
+  version = "3.8.5";
   pyproject = true;
 
   disabled = pythonOlder "3.6";
 
   src = fetchPypi {
     inherit pname version;
-    hash = "sha256-tM7DNRVvRPO8+oXnnys0tfpS5jMqhULd8+hPoT+qzXY=";
+    hash = "sha256-ySBUGHhHp9MNirZwn7FnCoMOThkjS+cAyFyWttcQLBY=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/development/tools/turso-cli/default.nix b/pkgs/development/tools/turso-cli/default.nix
index c68b1a3010a8..84113832cb34 100644
--- a/pkgs/development/tools/turso-cli/default.nix
+++ b/pkgs/development/tools/turso-cli/default.nix
@@ -8,16 +8,16 @@
 }:
 buildGoModule rec {
   pname = "turso-cli";
-  version = "0.90.3";
+  version = "0.90.7";
 
   src = fetchFromGitHub {
     owner = "tursodatabase";
     repo = "turso-cli";
     rev = "v${version}";
-    hash = "sha256-NkCkInQLwGwb8bFeRTSk2rpuPBOkMvWBgVx2IFFyRFQ=";
+    hash = "sha256-+pd2bRyu1BFhzJ1iGDmBv/DR8oZHC0hGZBgZZIxpaYo=";
   };
 
-  vendorHash = "sha256-oxlIaSSLZ6JirvUPOIHirp43G5qrDFJhNd6HjA9UYKo=";
+  vendorHash = "sha256-2NjdjB09WYzHjQEl2hMUWN1/xsj/Hlr8lVYU/pkxTqQ=";
 
   nativeBuildInputs = [ installShellFiles ];
 
diff --git a/pkgs/tools/admin/awscli2/default.nix b/pkgs/tools/admin/awscli2/default.nix
index a556d7cb90f0..9e10746b5363 100644
--- a/pkgs/tools/admin/awscli2/default.nix
+++ b/pkgs/tools/admin/awscli2/default.nix
@@ -59,14 +59,14 @@ let
 in
 with py.pkgs; buildPythonApplication rec {
   pname = "awscli2";
-  version = "2.15.34"; # N.B: if you change this, check if overrides are still up-to-date
+  version = "2.15.38"; # N.B: if you change this, check if overrides are still up-to-date
   pyproject = true;
 
   src = fetchFromGitHub {
     owner = "aws";
     repo = "aws-cli";
     rev = "refs/tags/${version}";
-    hash = "sha256-lFovWxPlo3WlKE4yOlTtILbsRsILgioqVmPptOQO0bM=";
+    hash = "sha256-ddZqexGrO2m8iUE9RDkks0ohm27dpitbsj+20aWUrJw=";
   };
 
   postPatch = ''