diff --git a/packages/bazel/bazelconfiguration-0.3.patch b/packages/bazel/bazelconfiguration-0.3.patch
deleted file mode 100644
index e6a974a98a9cbb6dd4118c3d056c61949571af07..0000000000000000000000000000000000000000
--- a/packages/bazel/bazelconfiguration-0.3.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelConfiguration.java
-+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelConfiguration.java
-@@ -150,6 +150,13 @@
-       builder.put("PATH", null);
-       builder.put("LD_LIBRARY_PATH", null);
-     }
-+
-+    Map<String, String> spackEnv = System.getenv();
-+    for (String envName : spackEnv.keySet()) {
-+      if (envName.startsWith("SPACK_")) {
-+        builder.put(envName, spackEnv.get(envName));
-+      }
-+    }
-   }
- 
-   private static PathFragment determineShellExecutable(OS os, PathFragment fromOption) {
diff --git a/packages/bazel/bazelruleclassprovider-0.14.patch b/packages/bazel/bazelruleclassprovider-0.14.patch
deleted file mode 100644
index b0aebdf359b6cd2e69bdca3820aa6faab9b03040..0000000000000000000000000000000000000000
--- a/packages/bazel/bazelruleclassprovider-0.14.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
-+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
-@@ -168,6 +168,13 @@ public class BazelRuleClassProvider {
-       env.put("PATH", null);
-     }
- 
-+    Map<String, String> spackEnv = System.getenv();
-+    for (String envName : spackEnv.keySet()) {
-+      if (envName.startsWith("SPACK_")) {
-+        env.put(envName, spackEnv.get(envName));
-+      }
-+    }
-+
-     // Shell environment variables specified via options take precedence over the
-     // ones inherited from the fragments. In the long run, these fragments will
-     // be replaced by appropriate default rc files anyway.
diff --git a/packages/bazel/build-0.29.1.patch b/packages/bazel/build-0.29.1.patch
deleted file mode 100644
index c3ed9ab254b253066ce37f9b0eb497ebb1e589d4..0000000000000000000000000000000000000000
--- a/packages/bazel/build-0.29.1.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 9c9d27561780bc56d9f0867e325c7421a94ee1cb Mon Sep 17 00:00:00 2001
-From: Harsh Bhatia <bhatia4@llnl.gov>
-Date: Tue, 15 Dec 2020 15:56:10 -0800
-Subject: [PATCH] https://github.com/bazelbuild/bazel/commit/ab62a6e097590dac5ec946ad7a796ea0e8593ae0 
-
----
- src/conditions/BUILD | 6 ++++++
- third_party/BUILD    | 8 ++++++--
- 2 files changed, 12 insertions(+), 2 deletions(-)
-
-diff --git a/src/conditions/BUILD b/src/conditions/BUILD
-index 2b28e28057..faa41a439d 100644
---- a/src/conditions/BUILD
-+++ b/src/conditions/BUILD
-@@ -10,6 +10,12 @@ filegroup(
-     visibility = ["//src:__pkg__"],
- )
- 
-+config_setting(
-+    name = "linux_ppc",
-+    values = {"cpu": "ppc"},
-+    visibility = ["//visibility:public"],
-+)
-+
- config_setting(
-     name = "linux_x86_64",
-     values = {"cpu": "k8"},
-diff --git a/third_party/BUILD b/third_party/BUILD
-index 159006d741..4fcae54c00 100644
---- a/third_party/BUILD
-+++ b/third_party/BUILD
-@@ -523,12 +523,13 @@ UNNECESSARY_DYNAMIC_LIBRARIES = select({
-     "//src/conditions:darwin": "*.so *.dll",
-     "//src/conditions:darwin_x86_64": "*.so *.dll",
-     "//src/conditions:linux_x86_64": "*.jnilib *.dll",
-+    "//src/conditions:linux_ppc": "*.so *.jnilib *.dll",
-     # The .so file is an x86 one, so we can just remove it if the CPU is not x86
-     "//src/conditions:arm": "*.so *.jnilib *.dll",
-     "//src/conditions:linux_aarch64": "*.so *.jnilib *.dll",
-     # Play it safe -- better have a big binary than a slow binary
-     # zip -d does require an argument. Supply something bogus.
--    "//conditions:default": "*.bogusextension",
-+    "//conditions:default": "",
- })
- 
- # Remove native libraries that are for a platform different from the one we are
-@@ -537,7 +538,10 @@ genrule(
-     name = "filter_netty_dynamic_libs",
-     srcs = ["netty_tcnative/netty-tcnative-boringssl-static-2.0.24.Final.jar"],
-     outs = ["netty_tcnative/netty-tcnative-filtered.jar"],
--    cmd = "cp $< $@ && zip -qd $@ " + UNNECESSARY_DYNAMIC_LIBRARIES,
-+    cmd = "cp $< $@ && " +
-+      # End successfully if there is nothing to be deleted from the archive
-+      "if [ -n '" + UNNECESSARY_DYNAMIC_LIBRARIES + "' ]; then " +
-+      "zip -qd $@ " + UNNECESSARY_DYNAMIC_LIBRARIES + "; fi",
- )
- 
- java_import(
--- 
-2.21.0 (Apple Git-122.2)
-
diff --git a/packages/bazel/cc_configure-0.3.0.patch b/packages/bazel/cc_configure-0.3.0.patch
deleted file mode 100644
index 79e12269a6bfeb05e684400a68450a9f3a709470..0000000000000000000000000000000000000000
--- a/packages/bazel/cc_configure-0.3.0.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/tools/cpp/cc_configure.bzl
-+++ b/tools/cpp/cc_configure.bzl
-@@ -173,8 +173,19 @@
-   else:
-     inc_dirs = result.stderr[index1 + 1:index2].strip()
- 
--  return [repository_ctx.path(_cxx_inc_convert(p))
--          for p in inc_dirs.split("\n")]
-+  default_inc_directories = [
-+    repository_ctx.path(_cxx_inc_convert(p))
-+    for p in inc_dirs.split("\n")
-+  ]
-+
-+  env = repository_ctx.os.environ
-+  if "SPACK_INCLUDE_DIRS" in env:
-+    for path in env["SPACK_INCLUDE_DIRS"].split(":"):
-+      default_inc_directories.append(
-+        repository_ctx.path(_cxx_inc_convert(path))
-+      )
-+
-+  return default_inc_directories
- 
- def _add_option_if_supported(repository_ctx, cc, option):
-   """Checks that `option` is supported by the C compiler."""
diff --git a/packages/bazel/cc_configure-0.5.0.patch b/packages/bazel/cc_configure-0.5.0.patch
deleted file mode 100644
index 470986bec6650579a8a58951752fb0bfc43943a7..0000000000000000000000000000000000000000
--- a/packages/bazel/cc_configure-0.5.0.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/tools/cpp/cc_configure.bzl
-+++ b/tools/cpp/cc_configure.bzl
-@@ -200,8 +200,19 @@
-   else:
-     inc_dirs = result.stderr[index1 + 1:index2].strip()
- 
--  return [_escape_string(repository_ctx.path(_cxx_inc_convert(p)))
--          for p in inc_dirs.split("\n")]
-+  default_inc_directories = [
-+    _escape_string(repository_ctx.path(_cxx_inc_convert(p)))
-+    for p in inc_dirs.split("\n")
-+  ]
-+
-+  env = repository_ctx.os.environ
-+  if "SPACK_INCLUDE_DIRS" in env:
-+    for path in env["SPACK_INCLUDE_DIRS"].split(":"):
-+      default_inc_directories.append(
-+        repository_ctx.path(_cxx_inc_convert(path))
-+      )
-+
-+  return default_inc_directories
- 
- 
- def _add_option_if_supported(repository_ctx, cc, option):
diff --git a/packages/bazel/compile-0.13.patch b/packages/bazel/compile-0.13.patch
deleted file mode 100644
index 13c82e7631bbcde85d0fd4301297166a32815721..0000000000000000000000000000000000000000
--- a/packages/bazel/compile-0.13.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/compile.sh
-+++ b/compile.sh
-@@ -92,7 +92,7 @@
- log "Building output/bazel"
- # We set host and target platform directly since the defaults in @bazel_tools
- # have not yet been generated.
--bazel_build "src:bazel${EXE_EXT}" \
-+CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel${EXE_EXT}" \
-   --host_platform=@bazel_tools//platforms:host_platform \
-   --platforms=@bazel_tools//platforms:target_platform \
-   || fail "Could not build Bazel"
diff --git a/packages/bazel/compile-0.16.patch b/packages/bazel/compile-0.16.patch
deleted file mode 100644
index f61f521a15b9affe110a6b8c703c6ad31c234fa0..0000000000000000000000000000000000000000
--- a/packages/bazel/compile-0.16.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/compile.sh
-+++ b/compile.sh
-@@ -92,7 +92,7 @@ display "."
- log "Building output/bazel"
- # We set host and target platform directly since the defaults in @bazel_tools
- # have not yet been generated.
--bazel_build "src:bazel_nojdk${EXE_EXT}" \
-+CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel_nojdk${EXE_EXT}" \
-   --host_platform=@bazel_tools//platforms:host_platform \
-   --platforms=@bazel_tools//platforms:target_platform \
-   || fail "Could not build Bazel"
diff --git a/packages/bazel/compile-0.21.patch b/packages/bazel/compile-0.21.patch
deleted file mode 100644
index d666a0f055ca04560c5cb0c885708b8c42acd794..0000000000000000000000000000000000000000
--- a/packages/bazel/compile-0.21.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/compile.sh
-+++ b/compile.sh
-@@ -92,7 +92,7 @@ display "."
- log "Building output/bazel"
- # We set host and target platform directly since the defaults in @bazel_tools
- # have not yet been generated.
--bazel_build "src:bazel_nojdk${EXE_EXT}" \
-+CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel_nojdk${EXE_EXT}" \
-   --action_env=PATH \
-   --host_platform=@bazel_tools//platforms:host_platform \
-   --platforms=@bazel_tools//platforms:target_platform \
diff --git a/packages/bazel/compile-0.3.patch b/packages/bazel/compile-0.3.patch
deleted file mode 100644
index 82db6efb6e86f766c169d93f11e8272385e30eba..0000000000000000000000000000000000000000
--- a/packages/bazel/compile-0.3.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/compile.sh
-+++ b/compile.sh
-@@ -99,7 +99,7 @@
-   new_step 'Building Bazel with Bazel'
-   display "."
-   log "Building output/bazel"
--  bazel_build "src:bazel${EXE_EXT}"
-+  CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel${EXE_EXT}"
-   cp -f "bazel-bin/src/bazel${EXE_EXT}" "output/bazel${EXE_EXT}"
-   chmod 0755 "output/bazel${EXE_EXT}"
-   BAZEL="$(pwd)/output/bazel${EXE_EXT}"
diff --git a/packages/bazel/compile-0.4.patch b/packages/bazel/compile-0.4.patch
deleted file mode 100644
index 80eab26a88279781198f6a23e6ccf4675175dd45..0000000000000000000000000000000000000000
--- a/packages/bazel/compile-0.4.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/compile.sh
-+++ b/compile.sh
-@@ -124,7 +124,7 @@
-   new_step 'Building Bazel with Bazel'
-   display "."
-   log "Building output/bazel"
--  bazel_build "src:bazel${EXE_EXT}" \
-+  CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel${EXE_EXT}" \
-     || fail "Could not build Bazel"
-   bazel_bin_path="$(get_bazel_bin_path)/src/bazel${EXE_EXT}"
-   [ -e "$bazel_bin_path" ] \
diff --git a/packages/bazel/compile-0.6.patch b/packages/bazel/compile-0.6.patch
deleted file mode 100644
index 64eb408e5df8743d6083e904d7b3049575115c49..0000000000000000000000000000000000000000
--- a/packages/bazel/compile-0.6.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/compile.sh
-+++ b/compile.sh
-@@ -85,7 +85,7 @@
- log "Building output/bazel"
- # We set host and target platform directly since the defaults in @bazel_tools
- # have not yet been generated.
--bazel_build "src:bazel${EXE_EXT}" \
-+CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel${EXE_EXT}" \
-   --experimental_host_platform=//tools/platforms:host_platform \
-   --experimental_platforms=//tools/platforms:target_platform \
-   || fail "Could not build Bazel"
diff --git a/packages/bazel/compile-0.9.patch b/packages/bazel/compile-0.9.patch
deleted file mode 100644
index 135de3a00fdadc3e1e4fa3b6d64d1da90f2ec67e..0000000000000000000000000000000000000000
--- a/packages/bazel/compile-0.9.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/compile.sh
-+++ b/compile.sh
-@@ -92,7 +92,7 @@
- log "Building output/bazel"
- # We set host and target platform directly since the defaults in @bazel_tools
- # have not yet been generated.
--bazel_build "src:bazel${EXE_EXT}" \
-+CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel${EXE_EXT}" \
-   --host_platform=//tools/platforms:host_platform \
-   --platforms=//tools/platforms:target_platform \
-   || fail "Could not build Bazel"
diff --git a/packages/bazel/cppcompileaction-0.3.0.patch b/packages/bazel/cppcompileaction-0.3.0.patch
deleted file mode 100644
index dd23972d9925de9b9631361ad5d7759e985f6d66..0000000000000000000000000000000000000000
--- a/packages/bazel/cppcompileaction-0.3.0.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java.orig    2020-06-08 13:42:14.035342560 -0400
-+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java 2020-06-08 13:42:25.149375458 -0400
-@@ -963,7 +963,7 @@
-           // are, it's probably due to a non-hermetic #include, & we should stop
-           // the build with an error.
-           if (execPath.startsWith(execRoot)) {
--            execPathFragment = execPath.relativeTo(execRoot); // funky but tolerable path
-+             //  execPathFragment = execPath.relativeTo(execRoot); // funky but tolerable path
-           } else {
-             problems.add(execPathFragment.getPathString());
-             continue;
diff --git a/packages/bazel/cppcompileaction-7.0.0.patch b/packages/bazel/cppcompileaction-7.0.0.patch
new file mode 100644
index 0000000000000000000000000000000000000000..b182f98f82c2bc86394d7065cd4bd58e2b3cc4f4
--- /dev/null
+++ b/packages/bazel/cppcompileaction-7.0.0.patch
@@ -0,0 +1,12 @@
+diff --color=auto --color=auto -Naur a/src/main/java/com/google/devtools/build/lib/rules/cpp/HeaderDiscovery.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/HeaderDiscovery.java
+--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/HeaderDiscovery.java	1980-01-01 00:00:00
++++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/HeaderDiscovery.java	2024-02-15 13:36:37
+@@ -143,7 +143,7 @@
+               LabelConstants.EXPERIMENTAL_EXTERNAL_PATH_PREFIX.getRelative(
+                   execPath.relativeTo(execRoot.getParentDirectory()));
+         } else {
+-          absolutePathProblems.add(execPathFragment.getPathString());
++          // absolutePathProblems.add(execPathFragment.getPathString());
+           continue;
+         }
+       }
diff --git a/packages/bazel/package.py b/packages/bazel/package.py
index 102bb5c5771ddec533b4c83dbfd65a0584e60186..b11514228484299ca70a3c2100f63801b9ce5bc4 100644
--- a/packages/bazel/package.py
+++ b/packages/bazel/package.py
@@ -18,8 +18,23 @@ class Bazel(Package):
     homepage = "https://bazel.build/"
     url = "https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-dist.zip"
 
+    maintainers("LydDeb")
+
     tags = ["build-tools"]
 
+    license("Apache-2.0")
+
+    version("7.0.2", sha256="dea2b90575d43ef3e41c402f64c2481844ecbf0b40f8548b75a204a4d504e035")
+    version("7.0.1", sha256="596b13e071d27c43343ec8f5d263cb5312fafe7ef8702401f7ed492f182f4e6c")
+    version("7.0.0", sha256="477e54f6374001f439a9471ba1de9d7824daf129db95510849ecc5e19ce88170")
+    version("6.5.0", sha256="fc89da919415289f29e4ff18a5e01270ece9a6fe83cb60967218bac4a3bb3ed2")
+    version("6.4.0", sha256="bd88ff602c8bbb29ee82ba2a6b12ad092d51ec668c6577f9628f18e48ff4e51e")
+    version("6.3.2", sha256="8cd7feac58193be2bcba451ba6688a46824d37ca6359ff58e0d44eb98f042948")
+    version("6.3.1", sha256="2676319e86c5aeab142dccd42434364a33aa330a091c13562b7de87a10e68775")
+    version("6.3.0", sha256="902198981b1d26112fc05913e79f1b3e9772c3f95594caf85619d041ba06ede0")
+    version("6.2.1", sha256="4cf4d264bff388ee0012735728630d23832d3c9d021383b2fadceadb0775dd6b")
+    version("6.2.0", sha256="f1e8f788637ac574d471d619d2096baaca04a19b57a034399e079633db441945")
+    version("6.1.2", sha256="6fb3ee22fe9fa86d82e173572d504c089f10825d749725592626e090b38c9679")
     version("6.1.1", sha256="6b900f26d676c7eca1d2e7dff9b71890dabd3ff59cab2a2d2178bc8a0395342a")
     version("6.1.0", sha256="c4b85675541cf66ee7cb71514097fdd6c5fc0e02527243617a4f20ca6b4f2932")
     version("6.0.0", sha256="7bc0c5145c19a56d82a08fce6908c5e1a0e75e4fbfb3b6f12b4deae7f4b38cbc")
@@ -31,6 +46,7 @@ class Bazel(Package):
     version("5.1.1", sha256="7f5d3bc1d344692b2400f3765fd4b5c0b636eb4e7a8a7b17923095c7b56a4f78")
     version("5.1.0", sha256="4de301f509fc6d0cbc697b2017384ecdc94df8f36245bbcbedc7ea6780acc9f5")
     version("5.0.0", sha256="072dd62d237dbc11e0bac02e118d8c2db4d0ba3ba09f1a0eb1e2a460fb8419db")
+    version("4.2.4", sha256="d5ba2ef28da5275f22e832aaa7f9319c61ea5db9b6a3e23b28a6a64ad03078f3")
     version("4.2.3", sha256="b0e84d0538f3ec2b95a49bae31a5066f0967281a3ca99965016fbe178acd2d3d")
     version("4.2.2", sha256="9981d0d53a356c4e87962847750a97c9e8054e460854748006c80f0d7e2b2d33")
     version("4.2.1", sha256="12ea7aa11e2bdb12de1dceb9939a22e96f5a480437cb17c123379d8e0fdf5e82")
@@ -55,356 +71,6 @@ class Bazel(Package):
     version("2.1.0", sha256="3371cd9050989173a3b27364668328653a65653a50a85c320adc53953b4d5f46")
     version("2.0.1", sha256="a863ed9e6fc420fbd92e63a12fe1a5b9be1a7a36f11f61f1fdc582c813bbe543")
     version("2.0.0", sha256="724da3c656f68e787a86ebb9844773aa1c2e3a873cc39462a8f1b336153d6cbb")
-    version(
-        "1.2.1",
-        sha256="255da49d0f012bc4f2c1d6d3ccdbe578e22fe97b8d124e1629a486fe2a09d3e1",
-        deprecated=True,
-    )
-    version(
-        "1.2.0",
-        sha256="9cb46b0a18b9166730307a0e82bf4c02281a1cc6da0fb11239e6fe4147bdee6e",
-        deprecated=True,
-    )
-    version(
-        "1.1.0",
-        sha256="4b66a8c93af7832ed32e7236cf454a05f3aa06d25a8576fc3f83114f142f95ab",
-        deprecated=True,
-    )
-    version(
-        "1.0.1",
-        sha256="f4d2dfad011ff03a5fae41b9b02cd96cd7297c1205d496603d66516934fbcfee",
-        deprecated=True,
-    )
-    version(
-        "1.0.0",
-        sha256="c61daf0b69dd95205c695b2f9022d296d052c727062cfd396d54ffb2154f8cac",
-        deprecated=True,
-    )
-    version(
-        "0.29.1",
-        sha256="872a52cff208676e1169b3e1cae71b1fe572c4109cbd66eab107d8607c378de5",
-        deprecated=True,
-    )
-    version(
-        "0.29.0",
-        sha256="01cb6f2e808bd016cf0e217e12373c9efb808123e58b37885be8364458d3a40a",
-        deprecated=True,
-    )
-    version(
-        "0.28.1",
-        sha256="2cea463d611f5255d2f3d41c8de5dcc0961adccb39cf0ac036f07070ba720314",
-        deprecated=True,
-    )
-    version(
-        "0.28.0",
-        sha256="26ad8cdadd413b8432cf46d9fc3801e8db85d9922f85dd8a7f5a92fec876557f",
-        deprecated=True,
-    )
-    version(
-        "0.27.2",
-        sha256="5e1bf2b48e54eb7e518430667d29aef53695d6dd7c718665a52131ab27aadab2",
-        deprecated=True,
-    )
-    version(
-        "0.27.1",
-        sha256="8051d77da4ec338acd91770f853e4c25f4407115ed86fd35a6de25921673e779",
-        deprecated=True,
-    )
-    version(
-        "0.27.0",
-        sha256="c3080d3b959ac08502ad5c84a51608c291accb1481baad88a628bbf79b30c67a",
-        deprecated=True,
-    )
-    version(
-        "0.26.1",
-        sha256="c0e94f8f818759f3f67af798c38683520c540f469cb41aea8f5e5a0e43f11600",
-        deprecated=True,
-    )
-    version(
-        "0.26.0",
-        sha256="d26dadf62959255d58e523da3448a6222af768fe1224e321b120c1d5bbe4b4f2",
-        deprecated=True,
-    )
-    version(
-        "0.25.3",
-        sha256="23eafd3e439bc71baba9c592b52cb742dabc8640a13b9da1751fec090a2dda99",
-        deprecated=True,
-    )
-    version(
-        "0.25.2",
-        sha256="7456032199852c043e6c5b3e4c71dd8089c1158f72ec554e6ec1c77007f0ab51",
-        deprecated=True,
-    )
-    version(
-        "0.25.1",
-        sha256="a52bb31aeb1f821e649d25ef48023cfb54a12887aff875c6349ebcac36c2f056",
-        deprecated=True,
-    )
-    version(
-        "0.25.0",
-        sha256="f624fe9ca8d51de192655369ac538c420afb7cde16e1ad052554b582fff09287",
-        deprecated=True,
-    )
-    version(
-        "0.24.1",
-        sha256="56ea1b199003ad832813621744178e42b39e6206d34fbae342562c287da0cd54",
-        deprecated=True,
-    )
-    version(
-        "0.24.0",
-        sha256="621d2a97899a88850a913eabf9285778331a309fd4658b225b1377f80060fa85",
-        deprecated=True,
-    )
-    version(
-        "0.23.2",
-        sha256="293a5a7d851e0618eeb5e6958d94a11d45b6a00f2ba9376de61ac2bd5f917439",
-        deprecated=True,
-    )
-    version(
-        "0.23.1",
-        sha256="dd47199f92452bf67b2c5d60ad4b7143554eaf2c6196ab6e8713449d81a0491d",
-        deprecated=True,
-    )
-    version(
-        "0.23.0",
-        sha256="2daf9c2c6498836ed4ebae7706abb809748b1350cacd35b9f89452f31ac0acc1",
-        deprecated=True,
-    )
-    version(
-        "0.22.0",
-        sha256="6860a226c8123770b122189636fb0c156c6e5c9027b5b245ac3b2315b7b55641",
-        deprecated=True,
-    )
-    version(
-        "0.21.0",
-        sha256="6ccb831e683179e0cfb351cb11ea297b4db48f9eab987601c038aa0f83037db4",
-        deprecated=True,
-    )
-    version(
-        "0.20.0",
-        sha256="1945afa84fd8858b0a3c68c09915a4bc81065c61df2591387b2985e2297d30bd",
-        deprecated=True,
-    )
-    version(
-        "0.19.2",
-        sha256="11234cce4f6bdc62c3ac688f41c7b5c178eecb6f7e2c4ba0bcf00ba8565b1d19",
-        deprecated=True,
-    )
-    version(
-        "0.19.1",
-        sha256="c9405f7b8c79ebc81f9f0e49bb656df4a0da246771d010c2cdd6bb30e2500ac0",
-        deprecated=True,
-    )
-    version(
-        "0.19.0",
-        sha256="ee6135c5c47306c8421d43ad83aabc4f219cb065376ee37797f2c8ba9a615315",
-        deprecated=True,
-    )
-    version(
-        "0.18.1",
-        sha256="baed9f28c317000a4ec1ad2571b3939356d22746ca945ac2109148d7abb860d4",
-        deprecated=True,
-    )
-    version(
-        "0.18.0",
-        sha256="d0e86d2f7881ec8742a9823a986017452d2da0dfe4e989111da787cb89257155",
-        deprecated=True,
-    )
-    version(
-        "0.17.2",
-        sha256="b6e87acfa0a405bb8b3417c58477b66d5bc27dc0d31ba6fa12bc255b9278d33b",
-        deprecated=True,
-    )
-    version(
-        "0.17.1",
-        sha256="23e4281c3628cbd746da3f51330109bbf69780bd64461b63b386efae37203f20",
-        deprecated=True,
-    )
-    version(
-        "0.16.1",
-        sha256="09c66b94356c82c52f212af52a81ac28eb06de1313755a2f23eeef84d167b36c",
-        deprecated=True,
-    )
-    version(
-        "0.16.0",
-        sha256="c730593916ef0ba62f3d113cc3a268e45f7e8039daf7b767c8641b6999bd49b1",
-        deprecated=True,
-    )
-    version(
-        "0.15.2",
-        sha256="bf53ec73be3a6d412d85ef612cec6e9c85db45da42001fab0cf1dad44cfc03f1",
-        deprecated=True,
-    )
-    version(
-        "0.15.1",
-        sha256="c62b351fa4c1ba5aeb34d0a137176f8e8f1d89a32f548a10e96c11df176ffc6c",
-        deprecated=True,
-    )
-    version(
-        "0.15.0",
-        sha256="c3b716e6625e6b8c323350c95cd3ae0f56aeb00458dddd10544d5bead8a7b602",
-        deprecated=True,
-    )
-    version(
-        "0.14.1",
-        sha256="d49cdcd82618ae7a7a190e6f0a80d9bf85c1a66b732f994f37732dc14ffb0025",
-        deprecated=True,
-    )
-    version(
-        "0.14.0",
-        sha256="259627de8b9d415cc80904523facf3d50e6e8e68448ab968eb1c9cb8ca1ef843",
-        deprecated=True,
-    )
-    version(
-        "0.13.1",
-        sha256="b0269e75b40d87ff87886e5f3432cbf88f70c96f907ab588e6c21b2922d72db0",
-        deprecated=True,
-    )
-    version(
-        "0.13.0",
-        sha256="82e9035084660b9c683187618a29aa896f8b05b5f16ae4be42a80b5e5b6a7690",
-        deprecated=True,
-    )
-    version(
-        "0.12.0",
-        sha256="3b3e7dc76d145046fdc78db7cac9a82bc8939d3b291e53a7ce85315feb827754",
-        deprecated=True,
-    )
-    version(
-        "0.11.1",
-        sha256="e8d762bcc01566fa50952c8028e95cfbe7545a39b8ceb3a0d0d6df33b25b333f",
-        deprecated=True,
-    )
-    version(
-        "0.11.0",
-        sha256="abfeccc94728cb46be8dbb3507a23ccffbacef9fbda96a977ef4ea8d6ab0d384",
-        deprecated=True,
-    )
-    version(
-        "0.10.1",
-        sha256="708248f6d92f2f4d6342006c520f22dffa2f8adb0a9dc06a058e3effe7fee667",
-        deprecated=True,
-    )
-    version(
-        "0.10.0",
-        sha256="47e0798caaac4df499bce5fe554a914abd884a855a27085a4473de1d737d9548",
-        deprecated=True,
-    )
-    version(
-        "0.9.0",
-        sha256="efb28fed4ffcfaee653e0657f6500fc4cbac61e32104f4208da385676e76312a",
-        deprecated=True,
-    )
-    version(
-        "0.8.1",
-        sha256="dfd0761e0b7e36c1d74c928ad986500c905be5ebcfbc29914d574af1db7218cf",
-        deprecated=True,
-    )
-    version(
-        "0.8.0",
-        sha256="aa840321d056abd3c6be10c4a1e98a64f9f73fff9aa89c468dae8c003974a078",
-        deprecated=True,
-    )
-    version(
-        "0.7.0",
-        sha256="a084a9c5d843e2343bf3f319154a48abe3d35d52feb0ad45dec427a1c4ffc416",
-        deprecated=True,
-    )
-    version(
-        "0.6.1",
-        sha256="dada1f60a512789747011184b2767d2b44136ef3b036d86947f1896d200d2ba7",
-        deprecated=True,
-    )
-    version(
-        "0.6.0",
-        sha256="a0e53728a9541ef87934831f3d05f2ccfdc3b8aeffe3e037be2b92b12400598e",
-        deprecated=True,
-    )
-    version(
-        "0.5.4",
-        sha256="2157b05309614d6af0e4bbc6065987aede590822634a0522161f3af5d647abc9",
-        deprecated=True,
-    )
-    version(
-        "0.5.3",
-        sha256="76b5c5880a0b15f5b91f7d626c5bc3b76ce7e5d21456963c117ab711bf1c5333",
-        deprecated=True,
-    )
-    version(
-        "0.5.2",
-        sha256="2418c619bdd44257a170b85b9d2ecb75def29e751b725e27186468ada2e009ea",
-        deprecated=True,
-    )
-    version(
-        "0.5.1",
-        sha256="85e6a18b111afeea2e475fe991db2a441ec3824211d659bee7b0012c36be9a40",
-        deprecated=True,
-    )
-    version(
-        "0.5.0",
-        sha256="ebba7330a8715e96a6d6dc0aa085125d529d0740d788f0544c6169d892e4f861",
-        deprecated=True,
-    )
-    version(
-        "0.4.5",
-        sha256="2b737be42678900470ae9e48c975ac5b2296d9ae23c007bf118350dbe7c0552b",
-        deprecated=True,
-    )
-    version(
-        "0.4.4",
-        sha256="d52a21dda271ae645711ce99c70cf44c5d3a809138e656bbff00998827548ebb",
-        deprecated=True,
-    )
-    version(
-        "0.4.3",
-        sha256="cbd2ab580181c17317cf18b2bf825bcded2d97cab01cd5b5fe4f4d520b64f90f",
-        deprecated=True,
-    )
-    version(
-        "0.4.2",
-        sha256="8e6f41252abadcdb2cc7a07f910ec4b45fb12c46f0a578672c6a186c7efcdb36",
-        deprecated=True,
-    )
-    version(
-        "0.4.1",
-        sha256="008c648d3c46ece063ae8b5008480d8ae6d359d35967356685d1c09da07e1064",
-        deprecated=True,
-    )
-    version(
-        "0.4.0",
-        sha256="6474714eee72ba2d4e271ed00ce8c05d67a9d15327bc03962b821b2af2c5ca36",
-        deprecated=True,
-    )
-    version(
-        "0.3.2",
-        sha256="ca5caf7b2b48c7639f45d815b32e76d69650f3199eb8caa541d402722e3f6c10",
-        deprecated=True,
-    )
-    version(
-        "0.3.1",
-        sha256="218d0e28b4d1ee34585f2ac6b18d169c81404d93958815e73e60cc0368efcbb7",
-        deprecated=True,
-    )
-    version(
-        "0.3.0",
-        sha256="357fd8bdf86034b93902616f0844bd52e9304cccca22971ab7007588bf9d5fb3",
-        deprecated=True,
-    )
-    version(
-        "0.2.0",
-        sha256="e9ba2740d9727ae6d0f9b1ac0c5df331814fd03518fe4b511396ed10780d5272",
-        deprecated=True,
-    )
-    version(
-        "0.1.4",
-        sha256="f3c395f5cd78cfef96f4008fe842f327bc8b03b77f46999387bc0ad223b5d970",
-        deprecated=True,
-    )
-    version(
-        "0.1.1",
-        sha256="c6ae19610b936a0aa940b44a3626d6e660fc457a8187d295cdf0b21169453d20",
-        deprecated=True,
-    )
 
     variant(
         "nodepfail",
@@ -416,47 +82,30 @@ class Bazel(Package):
     # begin EBRAINS (added): to provide ld via GCC_HOST_COMPILER_PREFIX
     depends_on("binutils", type=("build"))
     # end EBRAINS
-
+    
     # https://bazel.build/install/compile-source#bootstrap-unix-prereq
-    depends_on("java", type=("build", "run"))
     depends_on("java@11", when="@5.3:", type=("build", "run"))
     depends_on("java@8,11", when="@3.3:5.2", type=("build", "run"))
     depends_on("java@8", when="@0.6:3.2", type=("build", "run"))
-    depends_on("java@7:8", when="@:0.5", type=("build", "run"))
     depends_on("python+pythoncmd", type=("build", "run"))
     depends_on("zip", when="platform=linux", type=("build", "run"))
 
     # Pass Spack environment variables to the build
-    patch("bazelruleclassprovider-0.25.patch", when="@0.25:")
-    patch("bazelruleclassprovider-0.14.patch", when="@0.14:0.24")
-    patch("bazelconfiguration-0.3.patch", when="@:0.13")
+    patch("bazelruleclassprovider-0.25.patch")
 
     # Inject include paths
     patch("unix_cc_configure-3.0.patch", when="@3:")
-    patch("unix_cc_configure-0.15.patch", when="@0.15:2")
-    patch("unix_cc_configure-0.10.patch", when="@0.10:0.14")
-    patch("unix_cc_configure-0.5.3.patch", when="@0.5.3:0.9")
-    patch("cc_configure-0.5.0.patch", when="@0.5.0:0.5.2")
-    patch("cc_configure-0.3.0.patch", when="@0.3:0.4")
+    patch("unix_cc_configure-0.15.patch", when="@:2")
 
     # Set CC and CXX
-    # begin EBRAINS (modified): bring upstream after checking since when this is breaking the build
-    patch("compile-0.29.patch", when="@0.29:5.3")
-    # end EBRAINS
-    patch("compile-0.21.patch", when="@0.21:0.28")
-    patch("compile-0.16.patch", when="@0.16:0.20")
-    patch("compile-0.13.patch", when="@0.13:0.15")
-    patch("compile-0.9.patch", when="@0.9:0.12")
-    patch("compile-0.6.patch", when="@0.6:0.8")
-    patch("compile-0.4.patch", when="@0.4:0.5")
-    patch("compile-0.3.patch", when="@0.2:0.3")
+    patch("compile-0.29.patch")
 
     # Disable dependency search
-    patch("cppcompileaction-0.3.2.patch", when="@0.3.2:+nodepfail")
-    patch("cppcompileaction-0.3.0.patch", when="@0.3.0:0.3.1+nodepfail")
+    patch("cppcompileaction-7.0.0.patch", when="@7: +nodepfail")
+    patch("cppcompileaction-0.3.2.patch", when="@:6 +nodepfail")
 
     # https://github.com/bazelbuild/bazel/issues/17956
-    patch("apple-clang-14.0.3.patch", when="@0.3:5.4.0,6.0:6.1")
+    patch("apple-clang-14.0.3.patch", when="@:4.2.3,5:6.1.1")
 
     # https://github.com/bazelbuild/bazel/issues/17958
     patch(
@@ -465,56 +114,71 @@ class Bazel(Package):
         when="@5.0:5.4.0,6.0",
     )
 
-    # Fix build on power9 (2x commits)
-    # https://github.com/bazelbuild/bazel/commit/5cff4f1edf8b95bf0612791632255852332f72b5
-    # https://github.com/bazelbuild/bazel/commit/ab62a6e097590dac5ec946ad7a796ea0e8593ae0
-    patch("build-0.29.1.patch", when="@0.29.1")
-
     # Fix build with Fujitsu compiler
-    patch("blaze_util_posix-0.29.1.patch", when="@0.29.1:%fj")
+    patch("blaze_util_posix-0.29.1.patch", when="%fj")
     patch("unix_cc_configure_fj-5.2.patch", when="@5.2:%fj")
     patch("unix_cc_configure_fj-5.0.patch", when="@5.0:5.1%fj")
-    patch("unix_cc_configure_fj-0.29.1.patch", when="@0.29.1:4%fj")
-    patch("bazelruleclassprovider_fj-0.25.patch", when="@0.25:%fj")
-    conflicts(
-        "%fj",
-        when="@:0.24.1",
-        msg="Fujitsu Compiler cannot build 0.24.1 or less, " "please use a newer release.",
-    )
+    patch("unix_cc_configure_fj-0.29.1.patch", when="@:4%fj")
+    patch("bazelruleclassprovider_fj-0.25.patch", when="%fj")
 
     # https://blog.bazel.build/2021/05/21/bazel-4-1.html
     conflicts("platform=darwin target=aarch64:", when="@:4.0")
 
-    # patches for compiling various older bazels which had ICWYU
-    # violations revealed by (but not unique to) GCC 11 header changes.
-    # these are derived from
+    # Patches for compiling various older bazels which had ICWYU violations revealed by
+    # (but not unique to) GCC 11 header changes. These are derived from
     # https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/29084/
-    patch("gcc11_1.patch", when="@0.3.2:4")
-    patch("gcc11_2.patch", when="@0.3.2:4")
-    patch("gcc11_3.patch", when="@0.3:4")
+    patch("gcc11_1.patch", when="@:4")
+    patch("gcc11_2.patch", when="@:4")
+    patch("gcc11_3.patch", when="@:4")
     patch("gcc11_4.patch", when="@4.1:4")
 
-    # bazel-4.0.0 does not compile with gcc-11
-    # newer versions of grpc and abseil dependencies are needed but are not in
-    # bazel-4.0.0
-    conflicts("@:0.2,4.0.0", when="%gcc@11:")
+    # Bazel-4.0.0 does not compile with gcc-11
+    # Newer versions of grpc and abseil dependencies are needed but are not in bazel-4.0.0
+    conflicts("@4.0.0", when="%gcc@11:")
+    # https://github.com/bazelbuild/bazel/issues/18642
+    conflicts("@:6", when="%gcc@13:")
 
     executables = ["^bazel$"]
 
+    # Download resources to perform offline build with bazel.
+    # The following URLs and sha256 are in the file distdir_deps.bzl at the root of bazel sources.
+    resource_dictionary = {}
+    resource_dictionary["bazel_skylib"] = {
+        "url": "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.1/bazel-skylib-1.0.1.tar.gz",
+        "sha256": "f1c8360c01fcf276778d3519394805dc2a71a64274a3a0908bc9edff7b5aebc8",
+        "when": "@4:6",
+    }
+    resource_dictionary["zulu_11_56_19"] = {
+        "url": "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-linux_x64.tar.gz",
+        "sha256": "e064b61d93304012351242bf0823c6a2e41d9e28add7ea7f05378b7243d34247",
+        "when": "@6",
+    }
+    resource_dictionary["zulu_11_50_19"] = {
+        "url": "https://mirror.bazel.build/openjdk/azul-zulu11.50.19-ca-jdk11.0.12/zulu11.50.19-ca-jdk11.0.12-linux_x64.tar.gz",
+        "sha256": "b8e8a63b79bc312aa90f3558edbea59e71495ef1a9c340e38900dd28a1c579f3",
+        "when": "@5",
+    }
+    resource_dictionary["zulu_11_37_17"] = {
+        "url": "https://mirror.bazel.build/openjdk/azul-zulu11.37.17-ca-jdk11.0.6/zulu11.37.17-ca-jdk11.0.6-linux_x64.tar.gz",
+        "sha256": "360626cc19063bc411bfed2914301b908a8f77a7919aaea007a977fa8fb3cde1",
+        "when": "@4",
+    }
+    for resource_name in resource_dictionary.keys():
+        resource(
+            when=resource_dictionary[resource_name]["when"],
+            name=resource_name,
+            url=resource_dictionary[resource_name]["url"],
+            sha256=resource_dictionary[resource_name]["sha256"],
+            destination="archive",
+            expand=False,
+        )
+
     @classmethod
     def determine_version(cls, exe):
         output = Executable(exe)("version", output=str, error=str)
         match = re.search(r"Build label: ([\d.]+)", output)
         return match.group(1) if match else None
 
-    def url_for_version(self, version):
-        if version >= Version("0.4.1"):
-            url = "https://github.com/bazelbuild/bazel/releases/download/{0}/bazel-{0}-dist.zip"
-        else:
-            url = "https://github.com/bazelbuild/bazel/archive/{0}.tar.gz"
-
-        return url.format(version)
-
     # begin EBRAINS (added)
     def setup_dependent_build_environment(self, env, dependent_spec):
         env.prepend_path("GCC_HOST_COMPILER_PREFIX", self.spec['binutils'].prefix.bin)
@@ -526,20 +190,27 @@ class Bazel(Package):
         env.set("BAZEL_LINKOPTS", "")
         env.set("BAZEL_LINKLIBS", "-lstdc++")
 
-        env.set(
-            "EXTRA_BAZEL_ARGS",
-            # Spack's logs don't handle colored output well
-            "--color=no --host_javabase=@local_jdk//:jdk"
-            # Enable verbose output for failures
-            " --verbose_failures"
-            # begin EBRAINS (modified): bring upstream after checking since when the compile-x.patch is breaking the build
-            # expose CC and CXX (the spack compiler wrappers)
-            " --action_env=CC"
-            " --action_env=CXX"
-            # end EBRAINS
-            " --jobs={0}".format(make_jobs),
+        # .WARNING: Option 'host_javabase' is deprecated
+        # Use local java installation
+        # begin EBRAINS (modified): bring upstream after checking since when the compile-x.patch is breaking the build
+        # expose CC and CXX (the spack compiler wrappers)
+        args = "--color=no --define=ABSOLUTE_JAVABASE={0} --verbose_failures --action_env=CC --action_env=CXX --jobs={1}".format(
+        # end EBRAINS
+                self.spec["java"].prefix, make_jobs
         )
 
+        resource_stages = self.stage[1:]
+        for _resource in resource_stages:
+            try:
+                resource_name = _resource.resource.name
+                if self.spec.satisfies(self.resource_dictionary[resource_name]["when"]):
+                    archive_path = _resource.source_path
+                    args += " --distdir={0}".format(archive_path)
+            except AttributeError:
+                continue
+
+        env.set("EXTRA_BAZEL_ARGS", args)
+
     @run_before("install")
     def bootstrap(self):
         bash = which("bash")
diff --git a/packages/bazel/unix_cc_configure-0.10.patch b/packages/bazel/unix_cc_configure-0.10.patch
deleted file mode 100644
index bdd24e1152b5ac76c027690b720068550c9ef8e6..0000000000000000000000000000000000000000
--- a/packages/bazel/unix_cc_configure-0.10.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- a/tools/cpp/unix_cc_configure.bzl
-+++ b/tools/cpp/unix_cc_configure.bzl
-@@ -147,9 +147,18 @@ def get_escaped_cxx_inc_directories(repository_ctx, cc, additional_flags = []):
-   else:
-     inc_dirs = result.stderr[index1 + 1:index2].strip()
- 
--  return [_prepare_include_path(repository_ctx, _cxx_inc_convert(p))
--          for p in inc_dirs.split("\n")]
-+  default_inc_directories = [
-+    _prepare_include_path(repository_ctx, _cxx_inc_convert(p))
-+      for p in inc_dirs.split("\n")
-+  ]
-+ 
-+  env = repository_ctx.os.environ
-+  if "SPACK_INCLUDE_DIRS" in env:
-+    for path in env["SPACK_INCLUDE_DIRS"].split(":"):
-+      default_inc_directories.append(path)
-+
-+  return default_inc_directories
- 
-
- def _is_option_supported(repository_ctx, cc, option):
diff --git a/packages/bazel/unix_cc_configure-0.5.3.patch b/packages/bazel/unix_cc_configure-0.5.3.patch
deleted file mode 100644
index 79b583ba84606d75fa35797229e08f723f538dc6..0000000000000000000000000000000000000000
--- a/packages/bazel/unix_cc_configure-0.5.3.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/tools/cpp/unix_cc_configure.bzl
-+++ b/tools/cpp/unix_cc_configure.bzl
-@@ -117,9 +117,19 @@ def get_escaped_cxx_inc_directories(repository_ctx, cc):
-   else:
-     inc_dirs = result.stderr[index1 + 1:index2].strip()
- 
--  return [escape_string(repository_ctx.path(_cxx_inc_convert(p)))
--          for p in inc_dirs.split("\n")]
-+  default_inc_directories = [
-+    escape_string(repository_ctx.path(_cxx_inc_convert(p)))
-+          for p in inc_dirs.split("\n")
-+  ]
- 
-+  env = repository_ctx.os.environ
-+  if "SPACK_INCLUDE_DIRS" in env:
-+    for path in env["SPACK_INCLUDE_DIRS"].split(":"):
-+      default_inc_directories.append(
-+        repository_ctx.path(_cxx_inc_convert(path))
-+      )
-+
-+  return default_inc_directories
- 
- def _add_option_if_supported(repository_ctx, cc, option):
-   """Checks that `option` is supported by the C compiler. Doesn't %-escape the option."""
diff --git a/packages/gcc/detection_test.yaml b/packages/gcc/detection_test.yaml
index 5e53101a699d77c314c0c07e939c9195a09f6d04..7269c0301c17408aee98e5fb09b6ce70b0c36f56 100644
--- a/packages/gcc/detection_test.yaml
+++ b/packages/gcc/detection_test.yaml
@@ -1,38 +1,96 @@
 paths:
-  # Ubuntu 18.04, system compilers without Fortran
-  - layout:
-      - executables:
-        - "bin/gcc"
-        - "bin/g++"
-        script: "echo 7.5.0"
-    results:
-      - spec: "gcc@7.5.0 languages=c,c++"
-  # Mock a version < 7 of GCC that requires -dumpversion and
-  # errors with -dumpfullversion
-  - layout:
-      - executables:
-        - "bin/gcc-5"
-        - "bin/g++-5"
-        - "bin/gfortran-5"
-        script: |
-          if [[ "$1" == "-dumpversion" ]] ; then
-            echo "5.5.0"
-          else
-            echo "gcc-5: fatal error: no input files"
-            echo "compilation terminated."
-            exit 1
-          fi
-    results:
-      - spec: "gcc@5.5.0 languages=c,c++,fortran"
-  # Multiple compilers present at the same time
-  - layout:
-      - executables:
-        - "bin/x86_64-linux-gnu-gcc-6"
-        script: 'echo 6.5.0'
-      - executables:
-        - "bin/x86_64-linux-gnu-gcc-10"
-        - "bin/x86_64-linux-gnu-g++-10"
-        script: "echo 10.1.0"
-    results:
-      - spec: "gcc@6.5.0 languages=c"
-      - spec: "gcc@10.1.0 languages=c,c++"
\ No newline at end of file
+# Ubuntu 20.04, system compilers without Fortran. This
+# test also covers which flags are expected to be used
+# during the detection of gcc.
+- layout:
+  - executables:
+    - "bin/gcc"
+    - "bin/g++"
+    script: |
+      if [ "$1" = "-dumpversion" ] ; then
+        echo "9"
+      elif [ "$1" = "-dumpfullversion" ] ; then
+        echo "9.4.0"
+      elif [ "$1" = "--version" ] ; then
+        echo "gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
+        echo "Copyright (C) 2019 Free Software Foundation, Inc."
+        echo "This is free software; see the source for copying conditions.  There is NO"
+        echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+      else
+        echo "mock executable got an unexpected flag: $1"
+        exit 1
+      fi
+  platforms: ["darwin", "linux"]
+  results:
+  - spec: "gcc@9.4.0 languages=c,c++"
+    extra_attributes:
+      compilers:
+        c: ".*/bin/gcc"
+        cxx: ".*/bin/g++"
+
+# Mock a version < 7 of GCC that requires -dumpversion and
+# errors with -dumpfullversion
+- layout:
+  - executables:
+    - "bin/gcc-5"
+    - "bin/g++-5"
+    - "bin/gfortran-5"
+    script: |
+      if [ "$1" = "-dumpversion" ] ; then
+        echo "5.5.0"
+      else
+        echo "gcc-5: fatal error: no input files"
+        echo "compilation terminated."
+        exit 1
+      fi
+  platforms: ["darwin", "linux"]
+  results:
+  - spec: "gcc@5.5.0 languages=c,c++,fortran"
+    extra_attributes:
+      compilers:
+        c: ".*/bin/gcc-5$"
+        cxx: ".*/bin/g[+][+]-5$"
+        fortran: ".*/bin/gfortran-5$"
+
+# Multiple compilers present at the same time
+- layout:
+  - executables:
+    - "bin/x86_64-linux-gnu-gcc-6"
+    script: 'echo 6.5.0'
+  - executables:
+    - "bin/x86_64-linux-gnu-gcc-10"
+    - "bin/x86_64-linux-gnu-g++-10"
+    script: "echo 10.1.0"
+  platforms: [darwin, linux]
+  results:
+  - spec: "gcc@6.5.0 languages=c"
+    extra_attributes:
+      compilers:
+        c: ".*/bin/x86_64-linux-gnu-gcc-6$"
+  - spec: "gcc@10.1.0 languages=c,c++"
+    extra_attributes:
+      compilers:
+        c: ".*/bin/x86_64-linux-gnu-gcc-10$"
+        cxx: ".*/bin/x86_64-linux-gnu-g[+][+]-10$"
+
+# Apple clang under disguise as gcc should not be detected
+- layout:
+  - executables:
+    - "bin/gcc"
+    script: |
+      if [ "$1" = "-dumpversion" ] ; then
+        echo "15.0.0"
+      elif [ "$1" = "-dumpfullversion" ] ; then
+        echo "clang: error: no input files" >&2
+        exit 1
+      elif [ "$1" = "--version" ] ; then
+        echo "Apple clang version 15.0.0 (clang-1500.3.9.4)"
+        echo "Target: x86_64-apple-darwin23.4.0"
+        echo "Thread model: posix"
+        echo "InstalledDir: /Library/Developer/CommandLineTools/usr/bin"
+      else
+        echo "mock executable got an unexpected flag: $1"
+        exit 1
+      fi
+  platforms: ["darwin"]
+  results: []
diff --git a/packages/gcc/package.py b/packages/gcc/package.py
index 4eb88a25ac7f0e2f7ea8aeef333fb17a1e38cb48..92d3f2fc041b4e91369e7ba55d28294548d00380 100644
--- a/packages/gcc/package.py
+++ b/packages/gcc/package.py
@@ -2,26 +2,24 @@
 # Spack Project Developers. See the top-level COPYRIGHT file for details.
 #
 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
 import glob
 import itertools
 import os
-import re
 import sys
 
 from archspec.cpu import UnsupportedMicroarchitecture
 
 import llnl.util.tty as tty
-from llnl.util.lang import classproperty
+from llnl.util.symlink import readlink
 
 import spack.platforms
 import spack.util.executable
-from spack.build_environment import dso_suffix
+import spack.util.libc
 from spack.operating_systems.mac_os import macos_sdk_path, macos_version
 from spack.package import *
 
 
-class Gcc(AutotoolsPackage, GNUMirrorPackage):
+class Gcc(AutotoolsPackage, GNUMirrorPackage, CompilerPackage):
     """The GNU Compiler Collection includes front ends for C, C++, Objective-C,
     Fortran, Ada, and Go, as well as libraries for these languages."""
 
@@ -34,6 +32,8 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
 
     maintainers("michaelkuhn", "alalazo")
 
+    license("GPL-2.0-or-later AND LGPL-2.1-or-later")
+
     version("master", branch="master")
 
     version("13.2.0", sha256="e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da")
@@ -308,14 +308,10 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
             destination="newlibsource",
             fetch_options=timeout,
         )
-        # nvptx-tools does not seem to work as a dependency,
-        # but does fine when the source is inside the gcc build directory
-        # nvptx-tools doesn't have any releases, so grabbing the last commit
-        resource(
-            name="nvptx-tools",
-            git="https://github.com/MentorEmbedded/nvptx-tools",
-            commit="d0524fbdc86dfca068db5a21cc78ac255b335be5",
-        )
+
+        nvptx_tools_ver = "2023-09-13"
+        depends_on("nvptx-tools@" + nvptx_tools_ver, type="build")
+
         # NVPTX offloading supported in 7 and later by limited languages
         conflicts("@:6", msg="NVPTX only supported in gcc 7 and above")
         conflicts("languages=ada")
@@ -455,8 +451,8 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
 
     # Backport libsanitizer patch for glibc >= 2.36
     # https://reviews.llvm.org/D129471
-    patch("glibc-2.36-libsanitizer-gcc-5-9.patch", when="@5.1:5.5,6.1:6.5,7.1:7.5,8.1:8.5,9.1:9.5")
-    patch("glibc-2.36-libsanitizer-gcc-10-12.patch", when="@10.1:10.4,11.1:11.3,12.1.0")
+    patch("glibc-2.36-libsanitizer-gcc-5-9.patch", when="@5:9")
+    patch("glibc-2.36-libsanitizer-gcc-10-12.patch", when="@10:10.4,11:11.3,12.1.0")
 
     # Older versions do not compile with newer versions of glibc
     # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81712
@@ -491,13 +487,52 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
     )
     # end EBRAINS
 
+    # patch ICE on aarch64 in tree-vect-slp, cf: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111478
+    # patch taken from releases/gcc-12 branch
+    patch(
+        "https://github.com/gcc-mirror/gcc/commit/9d033155254ac6df5f47ab32896dbf336f991589.patch?full_index=1",
+        sha256="8b76fe575ef095b48ac45e8b56544c331663f840ce4b63abdb61510bf3647597",
+        when="@12.3.0 target=aarch64:",
+    )
+    # patch taken from releases/gcc-13 branch
+    patch(
+        "https://github.com/gcc-mirror/gcc/commit/7c67939ec384425a3d7383dfb4fb39aa7e9ad20a.patch?full_index=1",
+        sha256="f0826d7a9c9808af40f3434918f24ad942f1c6a6daec73f11cf52c544cf5fc01",
+        when="@13.2.0 target=aarch64:",
+    )
+
     build_directory = "spack-build"
 
-    @classproperty
-    def executables(cls):
-        names = [r"gcc", r"[^\w]?g\+\+", r"gfortran", r"gdc", r"gccgo"]
-        suffixes = [r"", r"-mp-\d+\.\d", r"-\d+\.\d", r"-\d+", r"\d\d"]
-        return [r"".join(x) for x in itertools.product(names, suffixes)]
+    compiler_languages = ["c", "cxx", "fortran", "d", "go"]
+
+    @property
+    def supported_languages(self):
+        # This weirdness is because it could be called on an abstract spec
+        if "languages" not in self.spec.variants:
+            return self.compiler_languages
+        return [x for x in self.compiler_languages if x in self.spec.variants["languages"].value]
+
+    c_names = ["gcc"]
+    cxx_names = ["g++"]
+    fortran_names = ["gfortran"]
+    d_names = ["gdc"]
+    go_names = ["gccgo"]
+    compiler_prefixes = [r"\w+-\w+-\w+-"]
+    compiler_suffixes = [r"-mp-\d+(?:\.\d+)?", r"-\d+(?:\.\d+)?", r"\d\d"]
+    compiler_version_regex = r"(?<!clang version)\s?([0-9.]+)"
+    compiler_version_argument = ("-dumpfullversion", "-dumpversion")
+
+    @classmethod
+    def determine_version(cls, exe):
+        try:
+            output = spack.compiler.get_compiler_version_output(exe, "--version")
+        except Exception:
+            output = ""
+        # Apple's gcc is actually apple clang, so skip it.
+        if "Apple" in output:
+            return None
+
+        return super().determine_version(exe)
 
     @classmethod
     def filter_detected_exes(cls, prefix, exes_in_prefix):
@@ -527,58 +562,14 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
 
         return result
 
-    @classmethod
-    def determine_version(cls, exe):
-        try:
-            output = spack.compiler.get_compiler_version_output(exe, "--version")
-        except Exception:
-            output = ""
-        # Apple's gcc is actually apple clang, so skip it.
-        # Users can add it manually to compilers.yaml at their own risk.
-        if "Apple" in output:
-            return None
-
-        version_regex = re.compile(r"([\d\.]+)")
-        for vargs in ("-dumpfullversion", "-dumpversion"):
-            try:
-                output = spack.compiler.get_compiler_version_output(exe, vargs)
-                match = version_regex.search(output)
-                if match:
-                    return match.group(1)
-            except spack.util.executable.ProcessError:
-                pass
-            except Exception as e:
-                tty.debug(e)
-
-        return None
-
     @classmethod
     def determine_variants(cls, exes, version_str):
-        languages, compilers = set(), {}
-        # There are often at least two copies (not symlinks) of each compiler executable in the
-        # same directory: one with a canonical name, e.g. "gfortran", and another one with the
-        # target prefix, e.g. "x86_64-pc-linux-gnu-gfortran". There also might be a copy of "gcc"
-        # with the version suffix, e.g. "x86_64-pc-linux-gnu-gcc-6.3.0". To ensure the consistency
-        # of values in the "compilers" dictionary (i.e. we prefer all of them to reference copies
-        # with canonical names if possible), we iterate over the executables in the reversed sorted
-        # order:
-        for exe in sorted(exes, reverse=True):
-            basename = os.path.basename(exe)
-            if "g++" in basename:
-                languages.add("c++")
-                compilers["cxx"] = exe
-            elif "gfortran" in basename:
-                languages.add("fortran")
-                compilers["fortran"] = exe
-            elif "gcc" in basename:
-                languages.add("c")
-                compilers["c"] = exe
-            elif "gccgo" in basename:
-                languages.add("go")
-                compilers["go"] = exe
-            elif "gdc" in basename:
-                languages.add("d")
-                compilers["d"] = exe
+        compilers = cls.determine_compiler_paths(exes=exes)
+
+        languages = set()
+        translation = {"cxx": "c++"}
+        for lang, compiler in compilers.items():
+            languages.add(translation.get(lang, lang))
         variant_str = "languages={0}".format(",".join(languages))
         return variant_str, {"compilers": compilers}
 
@@ -694,10 +685,10 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
         """Get the right (but pessimistic) architecture specific flags supported by
         both host gcc and to-be-built gcc. For example: gcc@7 %gcc@12 target=znver3
         should pick -march=znver1, since that's what gcc@7 supports."""
-        archs = [spec.target] + spec.target.ancestors
-        for arch in archs:
+        microarchitectures = [spec.target] + spec.target.ancestors
+        for uarch in microarchitectures:
             try:
-                return arch.optimization_flags("gcc", spec.version)
+                return uarch.optimization_flags("gcc", str(spec.version))
             except UnsupportedMicroarchitecture:
                 pass
         # no arch specific flags in common, unlikely to happen.
@@ -861,6 +852,28 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
 
         return options
 
+    # Copy nvptx-tools into the GCC install prefix
+    def copy_nvptx_tools(self):
+        nvptx_tools_bin_path = self.spec["nvptx-tools"].prefix.bin
+        gcc_bin_path = self.prefix.bin
+        mkdirp(gcc_bin_path)
+        copy_list = ["as", "ld", "nm", "run", "run-single"]
+        for file in copy_list:
+            fullname = f"nvptx-none-{file}"
+            copy(join_path(nvptx_tools_bin_path, fullname), join_path(gcc_bin_path, fullname))
+        link_list = ["ar", "ranlib"]
+        for file in link_list:
+            fullname = f"nvptx-none-{file}"
+            orig_target = readlink(join_path(nvptx_tools_bin_path, fullname))
+            symlink(orig_target, join_path(gcc_bin_path, fullname))
+        util_dir_path = join_path(self.prefix, "nvptx-none", "bin")
+        mkdirp(util_dir_path)
+        util_list = ["ar", "as", "ld", "nm", "ranlib"]
+        for file in util_list:
+            rel_target = join_path("..", "..", "bin", f"nvptx-none-{file}")
+            dest_link = join_path(util_dir_path, file)
+            symlink(rel_target, dest_link)
+
     # run configure/make/make(install) for the nvptx-none target
     # before running the host compiler phases
     @run_before("configure")
@@ -883,11 +896,7 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
             "--with-cuda-driver-lib={0}".format(spec["cuda"].libs.directories[0]),
         ]
 
-        with working_dir("nvptx-tools"):
-            configure = Executable("./configure")
-            configure(*options)
-            make()
-            make("install")
+        self.copy_nvptx_tools()
 
         pattern = join_path(self.stage.source_path, "newlibsource", "*")
         files = glob.glob(pattern)
@@ -929,76 +938,43 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
     @property
     def spec_dir(self):
         # e.g. lib/gcc/x86_64-unknown-linux-gnu/4.9.2
-        spec_dir = glob.glob("{0}/gcc/*/*".format(self.prefix.lib))
+        spec_dir = glob.glob(f"{self.prefix.lib}/gcc/*/*")
         return spec_dir[0] if spec_dir else None
 
     @run_after("install")
-    def write_rpath_specs(self):
-        """Generate a spec file so the linker adds a rpath to the libs
-        the compiler used to build the executable.
-
-        .. caution::
-
-           The custom spec file by default with *always* pass ``-Wl,-rpath
-           ...`` to the linker, which will cause the linker to *ignore* the
-           value of ``LD_RUN_PATH``, which otherwise would be saved to the
-           binary as the default rpath. See the mitigation below for how to
-           temporarily disable this behavior.
-
-        Structure the specs file so that users can define a custom spec file
-        to suppress the spack-linked rpaths to facilitate rpath adjustment
-        for relocatable binaries. The custom spec file
-        :file:`{norpath}.spec` will have a single
-        line followed by two blanks lines::
-
-            *link_libgcc_rpath:
-
-
-
-        It can be passed to the GCC linker using the argument
-        ``--specs=norpath.spec`` to disable the automatic rpath and restore
-        the behavior of ``LD_RUN_PATH``."""
+    def write_specs_file(self):
+        """(1) inject an rpath to its runtime library dir, (2) add a default programs search path
+        to <binutils>/bin."""
         if not self.spec_dir:
-            tty.warn(
-                "Could not install specs for {0}.".format(self.spec.format("{name}{@version}"))
-            )
+            tty.warn(f"Could not install specs for {self.spec.format('{name}{@version}')}.")
             return
 
-        gcc = self.spec["gcc"].command
-        lines = gcc("-dumpspecs", output=str).splitlines(True)
-        specs_file = join_path(self.spec_dir, "specs")
-
-        # Save a backup
-        with open(specs_file + ".orig", "w") as out:
-            out.writelines(lines)
-
         # Find which directories have shared libraries
-        rpath_libdirs = []
-        for dir in ["lib", "lib64"]:
+        for dir in ["lib64", "lib"]:
             libdir = join_path(self.prefix, dir)
-            if glob.glob(join_path(libdir, "*." + dso_suffix)):
-                rpath_libdirs.append(libdir)
-
-        if not rpath_libdirs:
-            # No shared libraries
+            if glob.glob(join_path(libdir, "libgcc_s.*")):
+                rpath_dir = libdir
+                break
+        else:
             tty.warn("No dynamic libraries found in lib/lib64")
-            return
+            rpath_dir = None
 
-        # Overwrite the specs file
-        with open(specs_file, "w") as out:
-            for line in lines:
-                out.write(line)
-                if line.startswith("*link_libgcc:"):
-                    # Insert at start of line following link_libgcc, which gets
-                    # inserted into every call to the linker
-                    out.write("%(link_libgcc_rpath) ")
-
-            # Add easily-overridable rpath string at the end
-            out.write("*link_libgcc_rpath:\n")
-            out.write(" ".join("-rpath " + lib for lib in rpath_libdirs))
-            out.write("\n")
+        specs_file = join_path(self.spec_dir, "specs")
+        with open(specs_file, "w") as f:
+            # can't extend the builtins without dumping them first
+            f.write(self.spec["gcc"].command("-dumpspecs", output=str, error=os.devnull).strip())
+
+            f.write("\n\n# Generated by Spack\n\n")
+
+            # rpath
+            if rpath_dir:
+                f.write(f"*link_libgcc:\n+ -rpath {rpath_dir}\n\n")
+
+            # programs search path
+            if self.spec.satisfies("+binutils"):
+                f.write(f"*self_spec:\n+ -B{self.spec['binutils'].prefix.bin}\n\n")
         set_install_permissions(specs_file)
-        tty.info("Wrote new spec file to {0}".format(specs_file))
+        tty.info(f"Wrote new spec file to {specs_file}")
 
     def setup_run_environment(self, env):
         # Search prefix directory for possibly modified compiler names
@@ -1019,7 +995,9 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
                     continue
 
                 abspath = os.path.join(bin_path, filename)
-                if os.path.islink(abspath):
+
+                # Skip broken symlinks (https://github.com/spack/spack/issues/41327)
+                if not os.path.exists(abspath):
                     continue
 
                 # Set the proper environment variable
@@ -1112,3 +1090,110 @@ class Gcc(AutotoolsPackage, GNUMirrorPackage):
                         ),
                     ),
                 )
+
+    @classmethod
+    def runtime_constraints(cls, *, spec, pkg):
+        """Callback function to inject runtime-related rules into the solver.
+
+        Rule-injection is obtained through method calls of the ``pkg`` argument.
+
+        Documentation for this function is temporary. When the API will be in its final state,
+        we'll document the behavior at https://spack.readthedocs.io/en/latest/
+
+        Args:
+            spec: spec that will inject runtime dependencies
+            pkg: object used to forward information to the solver
+        """
+        pkg("*").depends_on(
+            "gcc-runtime",
+            when="%gcc",
+            type="link",
+            description="If any package uses %gcc, it depends on gcc-runtime",
+        )
+        pkg("*").depends_on(
+            f"gcc-runtime@{str(spec.version)}:",
+            when=f"%{str(spec)}",
+            type="link",
+            description=f"If any package uses %{str(spec)}, "
+            f"it depends on gcc-runtime@{str(spec.version)}:",
+        )
+
+        gfortran_str = "libgfortran@5"
+        if spec.satisfies("gcc@:6"):
+            gfortran_str = "libgfortran@3"
+        elif spec.satisfies("gcc@7"):
+            gfortran_str = "libgfortran@4"
+
+        for fortran_virtual in ("fortran-rt", gfortran_str):
+            pkg("*").depends_on(
+                fortran_virtual,
+                when=f"%{str(spec)}",
+                languages=["fortran"],
+                type="link",
+                description=f"Add a dependency on '{gfortran_str}' for nodes compiled with "
+                f"{str(spec)} and using the 'fortran' language",
+            )
+        # The version of gcc-runtime is the same as the %gcc used to "compile" it
+        pkg("gcc-runtime").requires(f"@={str(spec.version)}", when=f"%{str(spec)}")
+
+        # If a node used %gcc@X.Y its dependencies must use gcc-runtime@:X.Y
+        # (technically @:X is broader than ... <= @=X but this should work in practice)
+        pkg("*").propagate(f"%gcc@:{str(spec.version)}", when=f"%{str(spec)}")
+
+    def _post_buildcache_install_hook(self):
+        if not self.spec.satisfies("platform=linux"):
+            return
+
+        # Setting up the runtime environment shouldn't be necessary here.
+        relocation_args = []
+        gcc = self.spec["gcc"].command
+        specs_file = os.path.join(self.spec_dir, "specs")
+        dryrun = gcc("test.c", "-###", output=os.devnull, error=str).strip()
+        if not dryrun:
+            tty.warn(f"Cannot relocate {specs_file}, compiler might not be working properly")
+            return
+        dynamic_linker = spack.util.libc.parse_dynamic_linker(dryrun)
+        if not dynamic_linker:
+            tty.warn(f"Cannot relocate {specs_file}, compiler might not be working properly")
+            return
+
+        libc = spack.util.libc.libc_from_dynamic_linker(dynamic_linker)
+
+        # We search for crt1.o ourselves because `gcc -print-prile-name=crt1.o` can give a rather
+        # convoluted relative path from a different prefix.
+        startfile_prefix = spack.util.libc.startfile_prefix(libc.external_path, dynamic_linker)
+
+        gcc_can_locate = lambda p: os.path.isabs(
+            gcc(f"-print-file-name={p}", output=str, error=os.devnull).strip()
+        )
+
+        if not gcc_can_locate("crt1.o"):
+            relocation_args.append(f"-B{startfile_prefix}")
+
+        # libc headers may also be in a multiarch subdir.
+        header_dir = spack.util.libc.libc_include_dir_from_startfile_prefix(
+            libc.external_path, startfile_prefix
+        )
+        if header_dir and all(
+            os.path.exists(os.path.join(header_dir, h))
+            for h in libc.package_class.representative_headers
+        ):
+            relocation_args.append(f"-idirafter {header_dir}")
+        else:
+            tty.warn(
+                f"Cannot relocate {specs_file} include directories, "
+                f"compiler might not be working properly"
+            )
+
+        # Delete current spec files.
+        try:
+            os.unlink(specs_file)
+        except OSError:
+            pass
+
+        # Write a new one and append flags for libc
+        self.write_specs_file()
+
+        if relocation_args:
+            with open(specs_file, "a") as f:
+                f.write(f"*self_spec:\n+ {' '.join(relocation_args)}\n\n")
diff --git a/packages/libvips/package.py b/packages/libvips/package.py
index ab8a88497809374429992e5176521e609fc2fee1..a9193dbd2daca7662cd41416a3e6c8bb0fb519c8 100644
--- a/packages/libvips/package.py
+++ b/packages/libvips/package.py
@@ -15,6 +15,8 @@ class Libvips(AutotoolsPackage):
     url = "https://github.com/libvips/libvips/releases/download/v8.9.0/vips-8.9.0.tar.gz"
     git = "https://github.com/libvips/libvips.git"
 
+    license("LGPL-2.1-or-later")
+    
     version("8.13.3", sha256="4eff5cdc8dbe1a05a926290a99014e20ba386f5dcca38d9774bef61413435d4c")
     version("8.10.5", sha256="a4eef2f5334ab6dbf133cd3c6d6394d5bdb3e76d5ea4d578b02e1bc3d9e1cfd8")
     version("8.9.1", sha256="45633798877839005016c9d3494e98dee065f5cb9e20f4552d3b315b8e8bce91")
diff --git a/packages/libxcb/package.py b/packages/libxcb/package.py
index 2cb1418ce4ac18d221f7c2b0c3932692ae65c483..e6bc6a0be3b6864d67473e0603254b281c776df6 100644
--- a/packages/libxcb/package.py
+++ b/packages/libxcb/package.py
@@ -15,6 +15,12 @@ class Libxcb(AutotoolsPackage):
     homepage = "https://xcb.freedesktop.org/"
     url = "https://xorg.freedesktop.org/archive/individual/lib/libxcb-1.14.tar.xz"
 
+    license("MIT")
+
+    maintainers("wdconinc")
+
+    version("1.16", sha256="4348566aa0fbf196db5e0a576321c65966189210cb51328ea2bb2be39c711d71")
+    version("1.15", sha256="cc38744f817cf6814c847e2df37fcb8997357d72fa4bcbc228ae0fe47219a059")
     version("1.14", sha256="a55ed6db98d43469801262d81dc2572ed124edc3db31059d4e9916eb9f844c34")
     version("1.13", sha256="0bb3cfd46dbd90066bf4d7de3cad73ec1024c7325a4a0cbf5f4a0d4fa91155fb")
 
@@ -24,6 +30,7 @@ class Libxcb(AutotoolsPackage):
 
     # libxcb 1.X requires xcb-proto >= 1.X
     depends_on("xcb-proto")
+    depends_on("xcb-proto@1.15:", when="@1.15")
     depends_on("xcb-proto@1.14:", when="@1.14")
     depends_on("xcb-proto@1.13:", when="@1.13")
 
@@ -51,4 +58,5 @@ class Libxcb(AutotoolsPackage):
         return config_args
 
     def patch(self):
-        filter_file("typedef struct xcb_auth_info_t {", "typedef struct {", "src/xcb.h")
\ No newline at end of file
+        filter_file("typedef struct xcb_auth_info_t {", "typedef struct {", "src/xcb.h")
+
diff --git a/packages/llvm/constexpr_longdouble.patch b/packages/llvm/constexpr_longdouble.patch
deleted file mode 100644
index 8b90001d63f870fd07ea58e0ab47025528ca7da8..0000000000000000000000000000000000000000
--- a/packages/llvm/constexpr_longdouble.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 3bf63cf3b366d3a57cf5cbad4112a6abf6c0c3b1 Mon Sep 17 00:00:00 2001
-From: Marshall Clow <mclow.lists@gmail.com>
-Date: Tue, 2 Apr 2019 14:46:36 +0000
-Subject: [PATCH] Special case some duration arithmetic for GCC and PPC because
- their long double constant folding is broken. Fixes PR#39696.
-
-llvm-svn: 357478
----
- libcxx/include/thread | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/libcxx/include/thread b/libcxx/include/thread
-index df06ff70f8e37f22f4108be8e5e79a38052a11dd..400459ae7f32c4d7cd24b2d85c49d789500e432d 100644
---- a/libcxx/include/thread
-+++ b/libcxx/include/thread
-@@ -434,7 +434,12 @@ sleep_for(const chrono::duration<_Rep, _Period>& __d)
-     using namespace chrono;
-     if (__d > duration<_Rep, _Period>::zero())
-     {
-+#if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)
-+    //  GCC's long double const folding is incomplete for IBM128 long doubles.
-+        _LIBCPP_CONSTEXPR duration<long double> _Max = duration<long double>(ULLONG_MAX/1000000000ULL) ;
-+#else
-         _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
-+#endif
-         nanoseconds __ns;
-         if (__d < _Max)
-         {
diff --git a/packages/llvm/constexpr_longdouble_9.0.patch b/packages/llvm/constexpr_longdouble_9.0.patch
deleted file mode 100644
index 9a62f27023c220bb784f757d0ed2daf8d4d5a8b2..0000000000000000000000000000000000000000
--- a/packages/llvm/constexpr_longdouble_9.0.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From d9a42ec98adcb1ebc0c3837715df4e5a50c7ccc0 Mon Sep 17 00:00:00 2001
-From: "Joel E. Denny" <jdenny.ornl@gmail.com>
-Date: Wed, 10 Jun 2020 12:40:43 -0400
-Subject: [PATCH] [libc++] Work around gcc/Power9 bug in `include/thread`
-
-This fixes PR39696, which breaks the libcxx build with gcc (I tested
-7.5.0) on Power9.  This fix was suggested at
-
-https://bugs.llvm.org/show_bug.cgi?id=39696#c38
-
-but never applied.  It just reverts 0583d9ea8d5e, which reverses
-components of the original fix in 3bf63cf3b366, which is correct.
-
-Fixes https://llvm.org/PR39696
-
-Reviewed By: ldionne
-
-Differential Revision: https://reviews.llvm.org/D81438
----
- libcxx/include/thread | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/libcxx/include/thread b/libcxx/include/thread
-index 22aa4f201295867cff57b7a944e6b7bd67b22ad3..6eff1800acdbef09eae4417eee977fa350c596ea 100644
---- a/libcxx/include/thread
-+++ b/libcxx/include/thread
-@@ -365,9 +365,9 @@ sleep_for(const chrono::duration<_Rep, _Period>& __d)
-     {
- #if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)
-     //  GCC's long double const folding is incomplete for IBM128 long doubles.
--        _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
--#else
-         _LIBCPP_CONSTEXPR duration<long double> _Max = duration<long double>(ULLONG_MAX/1000000000ULL) ;
-+#else
-+        _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
- #endif
-         nanoseconds __ns;
-         if (__d < _Max)
diff --git a/packages/llvm/detection_test.yaml b/packages/llvm/detection_test.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..e979a83626ce1379ec48711701c8776b696d1806
--- /dev/null
+++ b/packages/llvm/detection_test.yaml
@@ -0,0 +1,75 @@
+paths:
+- layout:
+  - executables:
+    - "bin/clang-3.9"
+    script: |
+      echo "clang version 3.9.1-19ubuntu1 (tags/RELEASE_391/rc2)"
+      echo "Target: x86_64-pc-linux-gnu"
+      echo "Thread model: posix"
+      echo "InstalledDir: /usr/bin"
+  - executables:
+    - "bin/clang++-3.9"
+    script: |
+      echo "clang version 3.9.1-19ubuntu1 (tags/RELEASE_391/rc2)"
+      echo "Target: x86_64-pc-linux-gnu"
+      echo "Thread model: posix"
+      echo "InstalledDir: /usr/bin"
+  platforms: ["darwin", "linux"]
+  results:
+  - spec: 'llvm@3.9.1 +clang~lld~lldb'
+    extra_attributes:
+      compilers:
+        c: ".*/bin/clang-3.9$"
+        cxx: ".*/bin/clang[+][+]-3.9$"
+
+# Multiple LLVM packages in the same prefix
+- layout:
+  - executables:
+    - "bin/clang-8"
+    - "bin/clang++-8"
+    script: |
+      echo "clang version 8.0.0-3~ubuntu18.04.2 (tags/RELEASE_800/final)"
+      echo "Target: x86_64-pc-linux-gnu"
+      echo "Thread model: posix"
+      echo "InstalledDir: /usr/bin"
+  - executables:
+    - "bin/ld.lld-8"
+    script: 'echo "LLD 8.0.0 (compatible with GNU linkers)"'
+  - executables:
+    - "bin/lldb"
+    script: 'echo "lldb version 8.0.0"'
+  - executables:
+    - "bin/clang-3.9"
+    - "bin/clang++-3.9"
+    script: |
+      echo "clang version 3.9.1-19ubuntu1 (tags/RELEASE_391/rc2)"
+      echo "Target: x86_64-pc-linux-gnu"
+      echo "Thread model: posix"
+      echo "InstalledDir: /usr/bin"
+  platforms: ["darwin", "linux"]
+  results:
+  - spec: 'llvm@8.0.0+clang+lld+lldb'
+    extra_attributes:
+      compilers:
+        c: ".*/bin/clang-8$"
+        cxx: ".*/bin/clang[+][+]-8$"
+        ld: ".*/bin/ld.lld-8$"
+
+  - spec: 'llvm@3.9.1+clang~lld~lldb'
+    extra_attributes:
+      compilers:
+        c: ".*/bin/clang-3.9$"
+        cxx: ".*/bin/clang[+][+]-3.9$"
+
+# Apple Clang should not be detected
+- layout:
+  - executables:
+    - "bin/clang"
+    - "bin/clang++"
+    script: |
+      echo "Apple clang version 11.0.0 (clang-1100.0.33.8)"
+      echo "Target: x86_64-apple-darwin19.5.0"
+      echo "Thread model: posix"
+      echo "InstalledDir: /Library/Developer/CommandLineTools/usr/bin"
+  platforms: ["darwin"]
+  results: []
diff --git a/packages/llvm/libomp-libflags-as-list.patch b/packages/llvm/libomp-libflags-as-list.patch
deleted file mode 100644
index 995f55a438f41b37b3c39d4ebb2b17d5fe50c15c..0000000000000000000000000000000000000000
--- a/packages/llvm/libomp-libflags-as-list.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/openmp/runtime/cmake/LibompHandleFlags.cmake b/openmp/runtime/cmake/LibompHandleFlags.cmake
-index 9e19e59ba17d..f92fa12d851a 100644
---- a/openmp/runtime/cmake/LibompHandleFlags.cmake
-+++ b/openmp/runtime/cmake/LibompHandleFlags.cmake
-@@ -144,7 +144,8 @@ function(libomp_get_libflags libflags)
-   endif()
-   set(libflags_local ${libflags_local} ${LIBOMP_LIBFLAGS})
-   libomp_setup_flags(libflags_local)
--  set(${libflags} ${libflags_local} PARENT_SCOPE)
-+  libomp_string_to_list("${libflags_local}" libflags_local_list)
-+  set(${libflags} ${libflags_local_list} PARENT_SCOPE)
- endfunction()
-
- # Fortran flags
diff --git a/packages/llvm/lldb_external_ncurses-10.patch b/packages/llvm/lldb_external_ncurses-10.patch
deleted file mode 100644
index 34ed0e3cd2130cb18e0f72e86e5db1aace562787..0000000000000000000000000000000000000000
--- a/packages/llvm/lldb_external_ncurses-10.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-diff --git a/lldb/include/lldb/Host/Config.h.cmake b/lldb/include/lldb/Host/Config.h.cmake
---- a/lldb/include/lldb/Host/Config.h.cmake
-+++ b/lldb/include/lldb/Host/Config.h.cmake
-@@ -38,6 +38,8 @@
- 
- #cmakedefine01 LLDB_ENABLE_CURSES
- 
-+#cmakedefine01 CURSES_HAVE_NCURSES_CURSES_H
-+
- #cmakedefine01 LLDB_ENABLE_LIBEDIT
- 
- #cmakedefine01 LLDB_ENABLE_LIBXML2
-diff --git a/lldb/source/Core/IOHandlerCursesGUI.cpp b/lldb/source/Core/IOHandlerCursesGUI.cpp
---- a/lldb/source/Core/IOHandlerCursesGUI.cpp
-+++ b/lldb/source/Core/IOHandlerCursesGUI.cpp
-@@ -10,9 +10,14 @@
- #include "lldb/Host/Config.h"
- 
- #if LLDB_ENABLE_CURSES
-+#if CURSES_HAVE_NCURSES_CURSES_H
-+#include <ncurses/curses.h>
-+#include <ncurses/panel.h>
-+#else
- #include <curses.h>
- #include <panel.h>
- #endif
-+#endif
- 
- #if defined(__APPLE__)
- #include <deque>
-
diff --git a/packages/llvm/llvm-gcc11.patch b/packages/llvm/llvm-gcc11.patch
deleted file mode 100644
index 8e081e876ee33a20c74aef54208c8cc0eb600007..0000000000000000000000000000000000000000
--- a/packages/llvm/llvm-gcc11.patch
+++ /dev/null
@@ -1,9 +0,0 @@
---- a/llvm/utils/benchmark/src/benchmark_register.h
-+++ b/llvm/utils/benchmark/src/benchmark_register.h
-@@ -2,6 +2,7 @@
- #define BENCHMARK_REGISTER_H
- 
- #include <vector>
-+#include <limits>
- 
- #include "check.h"
diff --git a/packages/llvm/llvm13-thread.patch b/packages/llvm/llvm13-thread.patch
deleted file mode 100644
index 0067a930373e361c3f7d7cf0d9da7a19ec82340a..0000000000000000000000000000000000000000
--- a/packages/llvm/llvm13-thread.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- spack-src/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake.org	2022-02-08 14:58:13.000000000 +0900
-+++ spack-src/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake	2022-02-08 13:58:53.000000000 +0900
-@@ -276,4 +276,5 @@
-   endif()
- endif()
-
--set(OPENMP_PTHREAD_LIB ${LLVM_PTHREAD_LIB})
-+find_package(Threads REQUIRED)
-+set(OPENMP_PTHREAD_LIB ${CMAKE_THREAD_LIBS_INIT})
---- spack-src/openmp/libomptarget/src/CMakeLists.txt.org	2022-02-09 08:49:35.000000000 +0900
-+++ spack-src/openmp/libomptarget/src/CMakeLists.txt	2022-02-09 08:50:18.000000000 +0900
-@@ -36,6 +36,7 @@
- endif()
- target_link_libraries(omptarget PRIVATE
-   ${CMAKE_DL_LIBS}
-+  ${OPENMP_PTHREAD_LIB}
-   "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
- 
- # Install libomptarget under the lib destination folder.
diff --git a/packages/llvm/llvm14-hwloc-ompd.patch b/packages/llvm/llvm14-hwloc-ompd.patch
deleted file mode 100644
index bdae92e09cf9de8cf13042867538b707da716fe9..0000000000000000000000000000000000000000
--- a/packages/llvm/llvm14-hwloc-ompd.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/openmp/libompd/src/CMakeLists.txt
-+++ b/openmp/libompd/src/CMakeLists.txt
-@@ -44,6 +44,10 @@
-         ${LIBOMP_SRC_DIR}
- )
-
-+if(${LIBOMP_USE_HWLOC})
-+  include_directories(${LIBOMP_HWLOC_INSTALL_DIR}/include)
-+endif()
-+
- INSTALL( TARGETS ompd
-         LIBRARY DESTINATION ${OPENMP_INSTALL_LIBDIR}
-         ARCHIVE DESTINATION ${OPENMP_INSTALL_LIBDIR}
diff --git a/packages/llvm/llvm17-18-thread.patch b/packages/llvm/llvm17-18-thread.patch
new file mode 100644
index 0000000000000000000000000000000000000000..7e337433ff8d6451c765e2a960cc0e2444870138
--- /dev/null
+++ b/packages/llvm/llvm17-18-thread.patch
@@ -0,0 +1,22 @@
+diff --git a/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake b/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
+index 1f2a50667c4f..d3ff232f6bd3 100644
+--- a/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
++++ b/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
+@@ -280,4 +280,5 @@ if (NOT LIBOMPTARGET_CUDA_TOOLKIT_ROOT_DIR_PRESET AND
+   endif()
+ endif()
+ 
+-set(OPENMP_PTHREAD_LIB ${LLVM_PTHREAD_LIB})
++find_package(Threads REQUIRED)
++set(OPENMP_PTHREAD_LIB Threads::Threads)
+diff --git a/openmp/libomptarget/src/CMakeLists.txt b/openmp/libomptarget/src/CMakeLists.txt
+index 071ec61889a2..b782c3b07e6f 100644
+--- a/openmp/libomptarget/src/CMakeLists.txt.orig	2024-03-26 14:30:52.000000000 +0900
++++ b/openmp/libomptarget/src/CMakeLists.txt	2024-03-26 14:34:02.000000000 +0900
+@@ -41,5 +41,6 @@
+ 
+ if (LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
+   target_link_libraries(omptarget PRIVATE
++    ${OPENMP_PTHREAD_LIB}
+     "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
+ endif()
diff --git a/packages/llvm/llvm17-fujitsu.patch b/packages/llvm/llvm17-fujitsu.patch
new file mode 100644
index 0000000000000000000000000000000000000000..f960830c13bbc27cc0ca06a2bf1eb05af9e264ba
--- /dev/null
+++ b/packages/llvm/llvm17-fujitsu.patch
@@ -0,0 +1,28 @@
+diff --git a/lldb/include/lldb/Utility/LLDBAssert.h_org b/lldb/include/lldb/Utility/LLDBAssert.h
+index aeef3e5..2f14ff3 100644
+--- a/lldb/include/lldb/Utility/LLDBAssert.h_org
++++ b/lldb/include/lldb/Utility/LLDBAssert.h
+@@ -14,7 +14,7 @@
+ #ifndef NDEBUG
+ #define lldbassert(x) assert(x)
+ #else
+-#if defined(__clang__)
++#if defined(__clang__) && !defined(__CLANG_FUJITSU)
+ // __FILE_NAME__ is a Clang-specific extension that functions similar to
+ // __FILE__ but only renders the last path component (the filename) instead of
+ // an invocation dependent full path to that file.
+
+diff --git runtimes/CMakeLists.txt_org runtimes/CMakeLists.txt
+--- a/runtimes/CMakeLists.txt_org
++++ b/runtimes/CMakeLists.txt
+@@ -6,2 +6,2 @@
+ include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
+   NO_POLICY_SCOPE)
+
++string(REPLACE "-Nclang" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
++string(REPLACE "-Nnofjprof" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
++string(REPLACE "-Nfjprof" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
++
+ project(Runtimes C CXX ASM)
+
+ list(INSERT CMAKE_MODULE_PATH 0
diff --git a/packages/llvm/llvm4-lld-ELF-Symbols.patch b/packages/llvm/llvm4-lld-ELF-Symbols.patch
deleted file mode 100644
index 1a86cda35828115c11acde8ff3ce5f08a4cb862f..0000000000000000000000000000000000000000
--- a/packages/llvm/llvm4-lld-ELF-Symbols.patch
+++ /dev/null
@@ -1,112 +0,0 @@
---- a/lldb/include/lldb/Utility/TaskPool.h
-+++ b/lldb/include/lldb/Utility/TaskPool.h
-@@ -33,6 +33,7 @@
- #include <queue>
- #include <thread>
- #include <vector>
-+#include <functional>
- 
- // Global TaskPool class for running tasks in parallel on a set of worker thread
- // created the first
-# Fix lld templates: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230463
---- a/lld/ELF/LTO.cpp
-+++ b/lld/ELF/LTO.cpp
-@@ -158,7 +158,7 @@
-   return Ret;
- }
- 
--template void BitcodeCompiler::template add<ELF32LE>(BitcodeFile &);
--template void BitcodeCompiler::template add<ELF32BE>(BitcodeFile &);
--template void BitcodeCompiler::template add<ELF64LE>(BitcodeFile &);
--template void BitcodeCompiler::template add<ELF64BE>(BitcodeFile &);
-+template void BitcodeCompiler::add<ELF32LE>(BitcodeFile &);
-+template void BitcodeCompiler::add<ELF32BE>(BitcodeFile &);
-+template void BitcodeCompiler::add<ELF64LE>(BitcodeFile &);
-+template void BitcodeCompiler::add<ELF64BE>(BitcodeFile &);
---- a/lld/ELF/Symbols.cpp
-+++ b/lld/ELF/Symbols.cpp
-@@ -343,45 +343,45 @@
- template bool SymbolBody::hasThunk<ELF64LE>() const;
- template bool SymbolBody::hasThunk<ELF64BE>() const;
- 
--template uint32_t SymbolBody::template getVA<ELF32LE>(uint32_t) const;
--template uint32_t SymbolBody::template getVA<ELF32BE>(uint32_t) const;
--template uint64_t SymbolBody::template getVA<ELF64LE>(uint64_t) const;
--template uint64_t SymbolBody::template getVA<ELF64BE>(uint64_t) const;
--
--template uint32_t SymbolBody::template getGotVA<ELF32LE>() const;
--template uint32_t SymbolBody::template getGotVA<ELF32BE>() const;
--template uint64_t SymbolBody::template getGotVA<ELF64LE>() const;
--template uint64_t SymbolBody::template getGotVA<ELF64BE>() const;
--
--template uint32_t SymbolBody::template getGotOffset<ELF32LE>() const;
--template uint32_t SymbolBody::template getGotOffset<ELF32BE>() const;
--template uint64_t SymbolBody::template getGotOffset<ELF64LE>() const;
--template uint64_t SymbolBody::template getGotOffset<ELF64BE>() const;
--
--template uint32_t SymbolBody::template getGotPltVA<ELF32LE>() const;
--template uint32_t SymbolBody::template getGotPltVA<ELF32BE>() const;
--template uint64_t SymbolBody::template getGotPltVA<ELF64LE>() const;
--template uint64_t SymbolBody::template getGotPltVA<ELF64BE>() const;
--
--template uint32_t SymbolBody::template getThunkVA<ELF32LE>() const;
--template uint32_t SymbolBody::template getThunkVA<ELF32BE>() const;
--template uint64_t SymbolBody::template getThunkVA<ELF64LE>() const;
--template uint64_t SymbolBody::template getThunkVA<ELF64BE>() const;
--
--template uint32_t SymbolBody::template getGotPltOffset<ELF32LE>() const;
--template uint32_t SymbolBody::template getGotPltOffset<ELF32BE>() const;
--template uint64_t SymbolBody::template getGotPltOffset<ELF64LE>() const;
--template uint64_t SymbolBody::template getGotPltOffset<ELF64BE>() const;
--
--template uint32_t SymbolBody::template getPltVA<ELF32LE>() const;
--template uint32_t SymbolBody::template getPltVA<ELF32BE>() const;
--template uint64_t SymbolBody::template getPltVA<ELF64LE>() const;
--template uint64_t SymbolBody::template getPltVA<ELF64BE>() const;
--
--template uint32_t SymbolBody::template getSize<ELF32LE>() const;
--template uint32_t SymbolBody::template getSize<ELF32BE>() const;
--template uint64_t SymbolBody::template getSize<ELF64LE>() const;
--template uint64_t SymbolBody::template getSize<ELF64BE>() const;
-+template uint32_t SymbolBody::getVA<ELF32LE>(uint32_t) const;
-+template uint32_t SymbolBody::getVA<ELF32BE>(uint32_t) const;
-+template uint64_t SymbolBody::getVA<ELF64LE>(uint64_t) const;
-+template uint64_t SymbolBody::getVA<ELF64BE>(uint64_t) const;
-+
-+template uint32_t SymbolBody::getGotVA<ELF32LE>() const;
-+template uint32_t SymbolBody::getGotVA<ELF32BE>() const;
-+template uint64_t SymbolBody::getGotVA<ELF64LE>() const;
-+template uint64_t SymbolBody::getGotVA<ELF64BE>() const;
-+
-+template uint32_t SymbolBody::getGotOffset<ELF32LE>() const;
-+template uint32_t SymbolBody::getGotOffset<ELF32BE>() const;
-+template uint64_t SymbolBody::getGotOffset<ELF64LE>() const;
-+template uint64_t SymbolBody::getGotOffset<ELF64BE>() const;
-+
-+template uint32_t SymbolBody::getGotPltVA<ELF32LE>() const;
-+template uint32_t SymbolBody::getGotPltVA<ELF32BE>() const;
-+template uint64_t SymbolBody::getGotPltVA<ELF64LE>() const;
-+template uint64_t SymbolBody::getGotPltVA<ELF64BE>() const;
-+
-+template uint32_t SymbolBody::getThunkVA<ELF32LE>() const;
-+template uint32_t SymbolBody::getThunkVA<ELF32BE>() const;
-+template uint64_t SymbolBody::getThunkVA<ELF64LE>() const;
-+template uint64_t SymbolBody::getThunkVA<ELF64BE>() const;
-+
-+template uint32_t SymbolBody::getGotPltOffset<ELF32LE>() const;
-+template uint32_t SymbolBody::getGotPltOffset<ELF32BE>() const;
-+template uint64_t SymbolBody::getGotPltOffset<ELF64LE>() const;
-+template uint64_t SymbolBody::getGotPltOffset<ELF64BE>() const;
-+
-+template uint32_t SymbolBody::getPltVA<ELF32LE>() const;
-+template uint32_t SymbolBody::getPltVA<ELF32BE>() const;
-+template uint64_t SymbolBody::getPltVA<ELF64LE>() const;
-+template uint64_t SymbolBody::getPltVA<ELF64BE>() const;
-+
-+template uint32_t SymbolBody::getSize<ELF32LE>() const;
-+template uint32_t SymbolBody::getSize<ELF32BE>() const;
-+template uint64_t SymbolBody::getSize<ELF64LE>() const;
-+template uint64_t SymbolBody::getSize<ELF64BE>() const;
- 
- template class elf::Undefined<ELF32LE>;
- template class elf::Undefined<ELF32BE>;
diff --git a/packages/llvm/llvm5-lld-ELF-Symbols.patch b/packages/llvm/llvm5-lld-ELF-Symbols.patch
deleted file mode 100644
index 727647d3b8f1c18140649caf52ec3c0506e62ed8..0000000000000000000000000000000000000000
--- a/packages/llvm/llvm5-lld-ELF-Symbols.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-# Fix lld templates: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230463
---- a/lld/ELF/Symbols.cpp
-+++ b/lld/ELF/Symbols.cpp
-@@ -383,17 +383,17 @@
-   return B.getName();
- }
- 
--template uint32_t SymbolBody::template getSize<ELF32LE>() const;
--template uint32_t SymbolBody::template getSize<ELF32BE>() const;
--template uint64_t SymbolBody::template getSize<ELF64LE>() const;
--template uint64_t SymbolBody::template getSize<ELF64BE>() const;
-+template uint32_t SymbolBody::getSize<ELF32LE>() const;
-+template uint32_t SymbolBody::getSize<ELF32BE>() const;
-+template uint64_t SymbolBody::getSize<ELF64LE>() const;
-+template uint64_t SymbolBody::getSize<ELF64BE>() const;
- 
--template bool DefinedRegular::template isMipsPIC<ELF32LE>() const;
--template bool DefinedRegular::template isMipsPIC<ELF32BE>() const;
--template bool DefinedRegular::template isMipsPIC<ELF64LE>() const;
--template bool DefinedRegular::template isMipsPIC<ELF64BE>() const;
-+template bool DefinedRegular::isMipsPIC<ELF32LE>() const;
-+template bool DefinedRegular::isMipsPIC<ELF32BE>() const;
-+template bool DefinedRegular::isMipsPIC<ELF64LE>() const;
-+template bool DefinedRegular::isMipsPIC<ELF64BE>() const;
- 
--template uint32_t SharedSymbol::template getAlignment<ELF32LE>() const;
--template uint32_t SharedSymbol::template getAlignment<ELF32BE>() const;
--template uint32_t SharedSymbol::template getAlignment<ELF64LE>() const;
--template uint32_t SharedSymbol::template getAlignment<ELF64BE>() const;
-+template uint32_t SharedSymbol::getAlignment<ELF32LE>() const;
-+template uint32_t SharedSymbol::getAlignment<ELF32BE>() const;
-+template uint32_t SharedSymbol::getAlignment<ELF64LE>() const;
-+template uint32_t SharedSymbol::getAlignment<ELF64BE>() const;
diff --git a/packages/llvm/llvm5-sanitizer-ustat.patch b/packages/llvm/llvm5-sanitizer-ustat.patch
deleted file mode 100644
index 531a3c5d6ded693076a18894dc11c1d3553f5188..0000000000000000000000000000000000000000
--- a/packages/llvm/llvm5-sanitizer-ustat.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-# <sys/ustat.h> has been removed from glibc 2.28,
-# backport fix from llvm-6.0.1:
---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-@@ -159,1 +159,0 @@
--#include <sys/ustat.h>
-@@ -252,5 +252,17 @@
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
--  unsigned struct_ustat_sz = sizeof(struct ustat);
-+  // Use pre-computed size of struct ustat to avoid <sys/ustat.h> which
-+  // has been removed from glibc 2.28.
-+#if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \
-+  || defined(__powerpc64__) || defined(__arch64__) || defined(__sparcv9) \
-+  || defined(__x86_64__)
-+#define SIZEOF_STRUCT_USTAT 32
-+#elif defined(__arm__) || defined(__i386__) || defined(__mips__) \
-+  || defined(__powerpc__) || defined(__s390__)
-+#define SIZEOF_STRUCT_USTAT 20
-+#else
-+#error Unknown size of struct ustat
-+#endif
-+  unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT;
-   unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
-   unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
diff --git a/packages/llvm/llvm_py37.patch b/packages/llvm/llvm_py37.patch
deleted file mode 100644
index 478be87994b9363a05c5b876780cd6379017e5d6..0000000000000000000000000000000000000000
--- a/packages/llvm/llvm_py37.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From ecdefed7f6ba11421fe1ecc6c13a135ab7bcda73 Mon Sep 17 00:00:00 2001
-From: Pavel Labath <labath@google.com>
-Date: Mon, 23 Jul 2018 11:37:36 +0100
-Subject: [PATCH] Fix PythonString::GetString for >=python-3.7
-
-The return value of PyUnicode_AsUTF8AndSize is now "const char *".
----
- .../Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp  | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/tools/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/tools/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
-index 6a9d57d5a..94f16b2c7 100644
---- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
-+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
-@@ -404,14 +404,16 @@ llvm::StringRef PythonString::GetString() const {
-     return llvm::StringRef();
- 
-   Py_ssize_t size;
--  char *c;
-+  const char *data;
- 
- #if PY_MAJOR_VERSION >= 3
--  c = PyUnicode_AsUTF8AndSize(m_py_obj, &size);
-+  data = PyUnicode_AsUTF8AndSize(m_py_obj, &size);
- #else
-+  char *c;
-   PyString_AsStringAndSize(m_py_obj, &c, &size);
-+  data = c;
- #endif
--  return llvm::StringRef(c, size);
-+  return llvm::StringRef(data, size);
- }
- 
- size_t PythonString::GetSize() const {
--- 
-2.18.0.233.g985f88cf7e-goog
-
diff --git a/packages/llvm/llvm_python_path.patch b/packages/llvm/llvm_python_path.patch
deleted file mode 100644
index 9f821cc3654ac5dd8e0f2412ffd1a3209d844b5a..0000000000000000000000000000000000000000
--- a/packages/llvm/llvm_python_path.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
-index dab55707338..6f4c6791141 100644
---- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
-+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
-@@ -612,6 +612,9 @@ macro(add_custom_libcxx name prefix)
-     CMAKE_OBJDUMP
-     CMAKE_STRIP
-     CMAKE_SYSROOT
-+    PYTHON_EXECUTABLE
-+    Python3_EXECUTABLE
-+    Python2_EXECUTABLE
-     CMAKE_SYSTEM_NAME)
-   foreach(variable ${PASSTHROUGH_VARIABLES})
-     get_property(is_value_set CACHE ${variable} PROPERTY VALUE SET)
diff --git a/packages/llvm/missing-includes.patch b/packages/llvm/missing-includes.patch
deleted file mode 100644
index e88b8fcfde190c3cfbf6e507e0a700a2137f0460..0000000000000000000000000000000000000000
--- a/packages/llvm/missing-includes.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-# https://github.com/spack/spack/issues/24270 (This hunk is upstream since llvm-10)
---- a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
-+++ b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
-@@ -4,6 +4,8 @@
- #include "llvm/Demangle/Compiler.h"
- #include "llvm/Demangle/StringView.h"
- #include <array>
-+#include <cstdint>
-+#include <string>
- 
- class OutputStream;
- 
-# https://github.com/spack/spack/pull/27233
---- a/llvm/utils/benchmark/src/benchmark_register.h
-+++ b/llvm/utils/benchmark/src/benchmark_register.h
-@@ -2,6 +2,7 @@
- #define BENCHMARK_REGISTER_H
- 
- #include <vector>
-+#include <limits>
- 
- #include "check.h"
- 
diff --git a/packages/llvm/no_cyclades.patch b/packages/llvm/no_cyclades.patch
deleted file mode 100644
index 10f9d0796b600dbe6bb947a3582ca72c93b41b82..0000000000000000000000000000000000000000
--- a/packages/llvm/no_cyclades.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
---- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-@@ -370,15 +370,6 @@
- 
- #if SANITIZER_GLIBC
-   // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
--  _(CYGETDEFTHRESH, WRITE, sizeof(int));
--  _(CYGETDEFTIMEOUT, WRITE, sizeof(int));
--  _(CYGETMON, WRITE, struct_cyclades_monitor_sz);
--  _(CYGETTHRESH, WRITE, sizeof(int));
--  _(CYGETTIMEOUT, WRITE, sizeof(int));
--  _(CYSETDEFTHRESH, NONE, 0);
--  _(CYSETDEFTIMEOUT, NONE, 0);
--  _(CYSETTHRESH, NONE, 0);
--  _(CYSETTIMEOUT, NONE, 0);
-   _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz);
-   _(EQL_ENSLAVE, WRITE, struct_ifreq_sz);
-   _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz);
-diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
-+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
-@@ -983,7 +983,6 @@
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
- extern unsigned struct_ax25_parms_struct_sz;
--extern unsigned struct_cyclades_monitor_sz;
- extern unsigned struct_input_keymap_entry_sz;
- extern unsigned struct_ipx_config_data_sz;
- extern unsigned struct_kbdiacrs_sz;
-@@ -1328,15 +1327,6 @@
- #endif  // SANITIZER_LINUX
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
--extern unsigned IOCTL_CYGETDEFTHRESH;
--extern unsigned IOCTL_CYGETDEFTIMEOUT;
--extern unsigned IOCTL_CYGETMON;
--extern unsigned IOCTL_CYGETTHRESH;
--extern unsigned IOCTL_CYGETTIMEOUT;
--extern unsigned IOCTL_CYSETDEFTHRESH;
--extern unsigned IOCTL_CYSETDEFTIMEOUT;
--extern unsigned IOCTL_CYSETTHRESH;
--extern unsigned IOCTL_CYSETTIMEOUT;
- extern unsigned IOCTL_EQL_EMANCIPATE;
- extern unsigned IOCTL_EQL_ENSLAVE;
- extern unsigned IOCTL_EQL_GETMASTRCFG;
-diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
-+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
-@@ -143,7 +143,6 @@
- # include <sys/procfs.h>
- #endif
- #include <sys/user.h>
--#include <linux/cyclades.h>
- #include <linux/if_eql.h>
- #include <linux/if_plip.h>
- #include <linux/lp.h>
-@@ -460,7 +459,6 @@
- 
- #if SANITIZER_GLIBC
-   unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
--  unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
- #if EV_VERSION > (0x010000)
-   unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry);
- #else
-@@ -824,15 +822,6 @@
- #endif // SANITIZER_LINUX
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
--  unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
--  unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
--  unsigned IOCTL_CYGETMON = CYGETMON;
--  unsigned IOCTL_CYGETTHRESH = CYGETTHRESH;
--  unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT;
--  unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH;
--  unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT;
--  unsigned IOCTL_CYSETTHRESH = CYSETTHRESH;
--  unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT;
-   unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE;
-   unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE;
-   unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG;
diff --git a/packages/llvm/package.py b/packages/llvm/package.py
index 3be46cd0ce0a9d3d737525aa5c75e78f1421ac1b..6efea3a3fa9192fca55b9c654967e89d7d8f300f 100644
--- a/packages/llvm/package.py
+++ b/packages/llvm/package.py
@@ -2,20 +2,20 @@
 # Spack Project Developers. See the top-level COPYRIGHT file for details.
 #
 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
 import os
 import os.path
 import re
 import sys
 
 import llnl.util.tty as tty
+from llnl.util.lang import classproperty
 
 import spack.build_environment
 import spack.util.executable
 from spack.package import *
 
 
-class Llvm(CMakePackage, CudaPackage):
+class Llvm(CMakePackage, CudaPackage, CompilerPackage):
     """The LLVM Project is a collection of modular and reusable compiler and
     toolchain technologies. Despite its name, LLVM has little to do
     with traditional virtual machines, though it does provide helpful
@@ -29,13 +29,19 @@ class Llvm(CMakePackage, CudaPackage):
     git = "https://github.com/llvm/llvm-project"
     maintainers("trws", "haampie", "skosukhin")
 
-    tags = ["e4s"]
+    tags = ["e4s", "compiler"]
 
     generator("ninja")
 
-    family = "compiler"  # Used by lmod
+    license("Apache-2.0")
 
     version("main", branch="main")
+    version("18.1.3", sha256="fc5a2fd176d73ceb17f4e522f8fe96d8dde23300b8c233476d3609f55d995a7a")
+    version("18.1.2", sha256="8d686d5ece6f12b09985cb382a3a530dc06bb6e7eb907f57c7f8bf2d868ebb0b")
+    version("18.1.1", sha256="62439f733311869dbbaf704ce2e02141d2a07092d952fc87ef52d1d636a9b1e4")
+    version("18.1.0", sha256="eb18f65a68981e94ea1a5aae4f02321b17da9e99f76bfdb983b953f4ba2d3550")
+    version("17.0.6", sha256="81494d32e6f12ea6f73d6d25424dbd2364646011bb8f7e345ca870750aa27de1")
+    version("17.0.5", sha256="432c1eda3d1c9379cd52a9bee8e0ea6f7b204bff5075895f963fd8e575aa4fb8")
     version("17.0.4", sha256="46200b79f52a02fe26d0a43fd856ab6ceff49ab2a0b7c240ac4b700a6ada700c")
     version("17.0.3", sha256="1e3d9d04fb5fbd8d0080042ad72c7e2a5c68788b014b186647a604dbbdd625d2")
     version("17.0.2", sha256="dcba3eb486973dce45b6edfe618f3f29b703ae7e6ef9df65182fb50fb6fe4235")
@@ -247,6 +253,7 @@ class Llvm(CMakePackage, CudaPackage):
         description="Enable zstd support for static analyzer / lld",
     )
 
+    provides("libllvm@17", when="@17.0.0:17")
     provides("libllvm@16", when="@16.0.0:16")
     provides("libllvm@15", when="@15.0.0:15")
     provides("libllvm@14", when="@14.0.0:14")
@@ -313,14 +320,14 @@ class Llvm(CMakePackage, CudaPackage):
         depends_on("swig@3:4.0", when="@12:")
         # end VISIONS
 
-    # Use ^swig cause it's triggered by both python & lua scripting in lldb
-    with when("^swig"):
-        depends_on("swig@2:", when="@10:")
-        depends_on("swig@3:", when="@12:")
-        depends_on("swig@4:", when="@17:")
-        # Commits f0a25fe0b746f56295d5c02116ba28d2f965c175 and
-        # 81fc5f7909a4ef5a8d4b5da2a10f77f7cb01ba63 fixed swig 4.1 support
-        depends_on("swig@:4.0", when="@:15")
+    for _when_spec in ("+lldb+python", "+lldb+lua"):
+        with when(_when_spec):
+            depends_on("swig@2:", when="@10:")
+            depends_on("swig@3:", when="@12:")
+            depends_on("swig@4:", when="@17:")
+            # Commits f0a25fe0b746f56295d5c02116ba28d2f965c175 and
+            # 81fc5f7909a4ef5a8d4b5da2a10f77f7cb01ba63 fixed swig 4.1 support
+            depends_on("swig@:4.0", when="@:15")
 
     # gold support, required for some features
     depends_on("binutils+gold+ld+plugins+headers", when="+gold")
@@ -459,6 +466,12 @@ class Llvm(CMakePackage, CudaPackage):
         when="@14:15",
     )
 
+    # missing <cstdint> include
+    patch(
+        "https://github.com/llvm/llvm-project/commit/ff1681ddb303223973653f7f5f3f3435b48a1983.patch?full_index=1",
+        sha256="c6ca6b925f150e8644ce756023797b7f94c9619c62507231f979edab1c09af78",
+        when="@6:13",
+    )
     # fix building of older versions of llvm with newer versions of glibc
     for compiler_rt_as in ["project", "runtime"]:
         with when("compiler-rt={0}".format(compiler_rt_as)):
@@ -556,6 +569,10 @@ class Llvm(CMakePackage, CudaPackage):
     # avoid build failed with Fujitsu compiler
     patch("llvm13-fujitsu.patch", when="@13 %fj")
 
+    # avoid build failed with Fujitsu compiler since llvm17
+    patch("llvm17-fujitsu.patch", when="@17: %fj")
+    patch("llvm17-18-thread.patch", when="@17:18 %fj")
+
     # patch for missing hwloc.h include for libompd
     # see https://reviews.llvm.org/D123888
     patch(
@@ -596,6 +613,8 @@ class Llvm(CMakePackage, CudaPackage):
     patch("add-include-for-libelf-llvm-12-14.patch", when="@12:14")
     patch("add-include-for-libelf-llvm-15.patch", when="@15")
 
+    patch("sanitizer-platform-limits-posix-xdr-macos.patch", when="@10:14 platform=darwin")
+
     @when("@14:17")
     def patch(self):
         # https://github.com/llvm/llvm-project/pull/69458
@@ -606,11 +625,36 @@ class Llvm(CMakePackage, CudaPackage):
             string=True,
         )
 
-    # The functions and attributes below implement external package
-    # detection for LLVM. See:
-    #
-    # https://spack.readthedocs.io/en/latest/packaging_guide.html#making-a-package-discoverable-with-spack-external-find
-    executables = ["clang", "flang", "ld.lld", "lldb"]
+    compiler_version_regex = (
+        # Normal clang compiler versions are left as-is
+        r"clang version ([^ )\n]+)-svn[~.\w\d-]*|"
+        # Don't include hyphenated patch numbers in the version
+        # (see https://github.com/spack/spack/pull/14365 for details)
+        r"clang version ([^ )\n]+?)-[~.\w\d-]*|"
+        r"clang version ([^ )\n]+)|"
+        # LLDB
+        r"lldb version ([^ )\n]+)|"
+        # LLD
+        r"LLD ([^ )\n]+) \(compatible with GNU linkers\)"
+    )
+    compiler_version_argument = "--version"
+    compiler_languages = ["c", "cxx", "fortran"]
+    c_names = ["clang"]
+    cxx_names = ["clang++"]
+    fortran_names = ["flang"]
+
+    @property
+    def supported_languages(self):
+        languages = []
+        if self.spec.satisfies("+clang"):
+            languages.extend(["c", "cxx"])
+        if self.spec.satisfies("+flang"):
+            languages.append("fortran")
+        return languages
+
+    @classproperty
+    def executables(cls):
+        return super().executables + ["ld.lld", "lldb"]
 
     @classmethod
     def filter_detected_exes(cls, prefix, exes_in_prefix):
@@ -627,26 +671,14 @@ class Llvm(CMakePackage, CudaPackage):
 
     @classmethod
     def determine_version(cls, exe):
-        version_regex = re.compile(
-            # Normal clang compiler versions are left as-is
-            r"clang version ([^ )\n]+)-svn[~.\w\d-]*|"
-            # Don't include hyphenated patch numbers in the version
-            # (see https://github.com/spack/spack/pull/14365 for details)
-            r"clang version ([^ )\n]+?)-[~.\w\d-]*|"
-            r"clang version ([^ )\n]+)|"
-            # LLDB
-            r"lldb version ([^ )\n]+)|"
-            # LLD
-            r"LLD ([^ )\n]+) \(compatible with GNU linkers\)"
-        )
         try:
             compiler = Executable(exe)
-            output = compiler("--version", output=str, error=str)
+            output = compiler(cls.compiler_version_argument, output=str, error=str)
             if "Apple" in output:
                 return None
             if "AMD" in output:
                 return None
-            match = version_regex.search(output)
+            match = re.search(cls.compiler_version_regex, output)
             if match:
                 return match.group(match.lastindex)
         except spack.util.executable.ProcessError:
@@ -658,21 +690,23 @@ class Llvm(CMakePackage, CudaPackage):
 
     @classmethod
     def determine_variants(cls, exes, version_str):
+        # Do not need to reuse more general logic from CompilerPackage
+        # because LLVM has kindly named compilers
         variants, compilers = ["+clang"], {}
         lld_found, lldb_found = False, False
         for exe in exes:
-            if "clang++" in exe:
+            name = os.path.basename(exe)
+            if "clang++" in name:
                 compilers["cxx"] = exe
-            elif "clang" in exe:
+            elif "clang" in name:
                 compilers["c"] = exe
-            elif "flang" in exe:
+            elif "flang" in name:
                 variants.append("+flang")
-                compilers["fc"] = exe
-                compilers["f77"] = exe
-            elif "ld.lld" in exe:
+                compilers["fortran"] = exe
+            elif "ld.lld" in name:
                 lld_found = True
                 compilers["ld"] = exe
-            elif "lldb" in exe:
+            elif "lldb" in name:
                 lldb_found = True
                 compilers["lldb"] = exe
 
@@ -767,10 +801,7 @@ class Llvm(CMakePackage, CudaPackage):
                     )
 
     def flag_handler(self, name, flags):
-        if name == "cxxflags":
-            flags.append(self.compiler.cxx11_flag)
-            return (None, flags, None)
-        elif name == "ldflags" and self.spec.satisfies("%intel"):
+        if name == "ldflags" and self.spec.satisfies("%intel"):
             flags.append("-shared-intel")
             return (None, flags, None)
         return (flags, None, None)
@@ -786,6 +817,14 @@ class Llvm(CMakePackage, CudaPackage):
                     os.symlink(bin, sym)
             env.prepend_path("PATH", self.stage.path)
 
+    def setup_run_environment(self, env):
+        if "+clang" in self.spec:
+            env.set("CC", join_path(self.spec.prefix.bin, "clang"))
+            env.set("CXX", join_path(self.spec.prefix.bin, "clang++"))
+        if "+flang" in self.spec:
+            env.set("FC", join_path(self.spec.prefix.bin, "flang"))
+            env.set("F77", join_path(self.spec.prefix.bin, "flang"))
+
     root_cmakelists_dir = "llvm"
 
     def cmake_args(self):
@@ -793,13 +832,11 @@ class Llvm(CMakePackage, CudaPackage):
         define = self.define
         from_variant = self.define_from_variant
 
-        python = spec["python"]
         cmake_args = [
             define("LLVM_REQUIRES_RTTI", True),
             define("LLVM_ENABLE_RTTI", True),
             define("LLVM_ENABLE_LIBXML2", False),
             define("CLANG_DEFAULT_OPENMP_RUNTIME", "libomp"),
-            define("PYTHON_EXECUTABLE", python.command.path),
             define("LIBOMP_USE_HWLOC", True),
             define("LIBOMP_HWLOC_INSTALL_DIR", spec["hwloc"].prefix),
             from_variant("LLVM_ENABLE_ZSTD", "zstd"),
@@ -823,11 +860,6 @@ class Llvm(CMakePackage, CudaPackage):
         if shlib_symbol_version is not None and shlib_symbol_version.value != "none":
             cmake_args.append(define("LLVM_SHLIB_SYMBOL_VERSION", shlib_symbol_version.value))
 
-        if python.version >= Version("3"):
-            cmake_args.append(define("Python3_EXECUTABLE", python.command.path))
-        else:
-            cmake_args.append(define("Python2_EXECUTABLE", python.command.path))
-
         projects = []
         runtimes = []
 
@@ -860,6 +892,12 @@ class Llvm(CMakePackage, CudaPackage):
 
         cmake_args.append(from_variant("LIBOMPTARGET_ENABLE_DEBUG", "libomptarget_debug"))
 
+        if spec.satisfies("@14:"):
+            # The hsa-rocr-dev package may be pulled in through hwloc, which can lead to cmake
+            # finding libhsa and enabling the AMDGPU plugin. Since we don't support this yet,
+            # disable explicitly. See commit a05a0c3c2f8eefc80d84b7a87a23a4452d4a3087.
+            cmake_args.append(define("LIBOMPTARGET_BUILD_AMDGPU_PLUGIN", False))
+
         if "+lldb" in spec:
             projects.append("lldb")
             cmake_args.extend(
@@ -944,7 +982,9 @@ class Llvm(CMakePackage, CudaPackage):
 
         cmake_args.append(from_variant("LIBOMP_TSAN_SUPPORT", "libomp_tsan"))
 
-        if self.compiler.name == "gcc":
+        # From clang 16 onwards we use a more precise --gcc-install-dir flag in post-install
+        # generated config files.
+        if self.spec.satisfies("@:15 %gcc"):
             cmake_args.append(define("GCC_INSTALL_PREFIX", self.compiler.prefix))
 
         if self.spec.satisfies("~code_signing platform=darwin"):
@@ -964,12 +1004,44 @@ class Llvm(CMakePackage, CudaPackage):
 
         # Semicolon seperated list of runtimes to enable
         if runtimes:
+            # The older versions are not careful enough with the order of the runtimes.
+            # Instead of applying
+            # https://github.com/llvm/llvm-project/commit/06400a0142af8297b5d39b8f34a7c59db6f9910c,
+            # which might be incompatible with the version that we install,
+            # we sort the runtimes here according to the same order as
+            # in the aforementioned commit:
+            if self.spec.satisfies("@:14"):
+                runtimes_order = [
+                    "libc",
+                    "libunwind",
+                    "libcxxabi",
+                    "libcxx",
+                    "compiler-rt",
+                    "openmp",
+                ]
+                runtimes.sort(
+                    key=lambda x: (
+                        runtimes_order.index(x) if x in runtimes_order else len(runtimes_order)
+                    )
+                )
+
+            # CMake args passed just to runtimes
+            runtime_cmake_args = [define("CMAKE_INSTALL_RPATH_USE_LINK_PATH", True)]
+
+            # When building runtimes, just-built clang has to know where GCC is.
+            gcc_install_dir_flag = get_gcc_install_dir_flag(spec, self.compiler)
+            if gcc_install_dir_flag:
+                runtime_cmake_args.extend(
+                    [
+                        define("CMAKE_C_FLAGS", gcc_install_dir_flag),
+                        define("CMAKE_CXX_FLAGS", gcc_install_dir_flag),
+                    ]
+                )
+
             cmake_args.extend(
                 [
                     define("LLVM_ENABLE_RUNTIMES", runtimes),
-                    define(
-                        "RUNTIMES_CMAKE_ARGS", [define("CMAKE_INSTALL_RPATH_USE_LINK_PATH", True)]
-                    ),
+                    define("RUNTIMES_CMAKE_ARGS", runtime_cmake_args),
                 ]
             )
 
@@ -1008,7 +1080,10 @@ class Llvm(CMakePackage, CudaPackage):
                 ninja()
                 ninja("install")
         if "+python" in self.spec:
-            install_tree("llvm/bindings/python", python_platlib)
+            if spec.version < Version("17.0.0"):
+                # llvm bindings were removed in v17:
+                # https://releases.llvm.org/17.0.1/docs/ReleaseNotes.html#changes-to-the-python-bindings
+                install_tree("llvm/bindings/python", python_platlib)
 
             if "+clang" in self.spec:
                 install_tree("clang/bindings/python", python_platlib)
@@ -1016,6 +1091,19 @@ class Llvm(CMakePackage, CudaPackage):
         with working_dir(self.build_directory):
             install_tree("bin", join_path(self.prefix, "libexec", "llvm"))
 
+        cfg_files = []
+        if spec.satisfies("+clang"):
+            cfg_files.extend(("clang.cfg", "clang++.cfg"))
+        if spec.satisfies("@19: +flang"):
+            # The config file is `flang.cfg` even though the executable is `flang-new`.
+            # `--gcc-install-dir` / `--gcc-toolchain` support was only added in LLVM 19.
+            cfg_files.append("flang.cfg")
+        gcc_install_dir_flag = get_gcc_install_dir_flag(spec, self.compiler)
+        if gcc_install_dir_flag:
+            for cfg in cfg_files:
+                with open(os.path.join(self.prefix.bin, cfg), "w") as f:
+                    print(gcc_install_dir_flag, file=f)
+
     def llvm_config(self, *args, **kwargs):
         lc = Executable(self.prefix.bin.join("llvm-config"))
         if not kwargs.get("output"):
@@ -1027,6 +1115,18 @@ class Llvm(CMakePackage, CudaPackage):
             return ret
 
 
+def get_gcc_install_dir_flag(spec: Spec, compiler) -> Optional[str]:
+    """Get the --gcc-install-dir=... flag, so that clang does not do a system scan for GCC."""
+    if not spec.satisfies("@16: %gcc"):
+        return None
+    gcc = Executable(compiler.cc)
+    libgcc_path = gcc("-print-file-name=libgcc.a", output=str, fail_on_error=False).strip()
+    if not os.path.isabs(libgcc_path):
+        return None
+    libgcc_dir = os.path.dirname(libgcc_path)
+    return f"--gcc-install-dir={libgcc_dir}" if os.path.exists(libgcc_dir) else None
+
+
 def get_llvm_targets_to_build(spec):
     targets = spec.variants["targets"].value
 
@@ -1073,4 +1173,3 @@ def get_llvm_targets_to_build(spec):
         llvm_targets.add("PowerPC")
 
     return list(llvm_targets)
-
diff --git a/packages/llvm/sanitizer-platform-limits-posix-xdr-macos.patch b/packages/llvm/sanitizer-platform-limits-posix-xdr-macos.patch
new file mode 100644
index 0000000000000000000000000000000000000000..d4477390f529cebdcc70ae60ac96aaea16eeb766
--- /dev/null
+++ b/packages/llvm/sanitizer-platform-limits-posix-xdr-macos.patch
@@ -0,0 +1,11 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -1250,7 +1250,7 @@ CHECK_SIZE_AND_OFFSET(group, gr_passwd);
+ CHECK_SIZE_AND_OFFSET(group, gr_gid);
+ CHECK_SIZE_AND_OFFSET(group, gr_mem);
+ 
+-#if HAVE_RPC_XDR_H
++#if HAVE_RPC_XDR_H && !SANITIZER_MAC
+ CHECK_TYPE_SIZE(XDR);
+ CHECK_SIZE_AND_OFFSET(XDR, x_op);
+ CHECK_SIZE_AND_OFFSET(XDR, x_ops);
diff --git a/packages/llvm/thread-p9.patch b/packages/llvm/thread-p9.patch
deleted file mode 100644
index 140473a8508ada02fd50e06b18f3301bd64072d4..0000000000000000000000000000000000000000
--- a/packages/llvm/thread-p9.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/libcxx/include/thread b/libcxx/include/thread
-index 02da703..d1677a1 100644
---- a/projects/libcxx/include/thread
-+++ b/projects/libcxx/include/thread
-@@ -368,9 +368,9 @@ sleep_for(const chrono::duration<_Rep, _Period>& __d)
-     {
- #if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)
-     //  GCC's long double const folding is incomplete for IBM128 long doubles.
--        _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
--#else
-         _LIBCPP_CONSTEXPR duration<long double> _Max = duration<long double>(ULLONG_MAX/1000000000ULL) ;
-+#else
-+        _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
- #endif
-         nanoseconds __ns;
-         if (__d < _Max)
diff --git a/packages/log4cxx/package.py b/packages/log4cxx/package.py
index 13bfc90b22bfd846f4c865723eacffea379af6ec..ee2301e0596de0a0c1f68df38a50d38b9651a07f 100644
--- a/packages/log4cxx/package.py
+++ b/packages/log4cxx/package.py
@@ -14,6 +14,8 @@ class Log4cxx(CMakePackage):
 
     maintainers("nicmcd")
 
+    license("Apache-2.0")
+
     # begin EBRAINS (added): bring upstream (ref. spack@0.21.2)
     version("1.2.0",  sha256="09f4748aa5675ef5c0770bedbf5e00488668933c5a935a43ac5b85be2436c48a")
     version("1.1.0",  sha256="1fc7d82697534184bc0f757348d969d24852b948f63d6b17283fd1ee29c2c28a")
diff --git a/packages/nanoflann/package.py b/packages/nanoflann/package.py
deleted file mode 100644
index 7dd9d7f3ce9f4434bdef8cd060e5bb0f18fa622e..0000000000000000000000000000000000000000
--- a/packages/nanoflann/package.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack.package import *
-
-
-class Nanoflann(CMakePackage):
-    """a C++ header-only library for Nearest Neighbor (NN) search wih KD-trees."""
-
-    homepage = "https://github.com/jlblancoc/nanoflann"
-    url = "https://github.com/jlblancoc/nanoflann/archive/v1.2.3.tar.gz"
-
-    # begin EBRAINS (added): add version
-    version("1.5.4", sha256="a7f64d0bdff42614c561e52680b16de46c0edac9719f21f935c5e1f8b0654afc")
-    # end EBRAINS
-    version("1.4.3", sha256="cbcecf22bec528a8673a113ee9b0e134f91f1f96be57e913fa1f74e98e4449fa")
-    version("1.2.3", sha256="5ef4dfb23872379fe9eb306aabd19c9df4cae852b72a923af01aea5e8d7a59c3")
-
-    def patch(self):
-        filter_file("-mtune=native", "", "CMakeLists.txt")
-
-    def cmake_args(self):
-        args = ["-DBUILD_SHARED_LIBS=ON"]
-        return args
diff --git a/packages/netlib-xblas/package.py b/packages/netlib-xblas/package.py
index cc65577f55f79342bf7bfe41ed27f6c55dac510e..cf37386f8924c908195f6d0ce8e5572ebf3cb1ac 100644
--- a/packages/netlib-xblas/package.py
+++ b/packages/netlib-xblas/package.py
@@ -23,6 +23,8 @@ class NetlibXblas(AutotoolsPackage):
     homepage = "https://www.netlib.org/xblas"
     url = "https://www.netlib.org/xblas/xblas.tar.gz"
 
+    license("BSD-3-Clause")
+
     version("1.0.248", sha256="b5fe7c71c2da1ed9bcdc5784a12c5fa9fb417577513fe8a38de5de0007f7aaa1")
 
     variant("fortran", default=True, description="Build Fortran interfaces")
diff --git a/packages/neuron/package.py b/packages/neuron/package.py
index a87d6d758eb610b9f9cc86840c38574287095eff..951c1d394604c18067cf3a2517dfbd4391ec0840 100644
--- a/packages/neuron/package.py
+++ b/packages/neuron/package.py
@@ -85,7 +85,7 @@ class Neuron(CMakePackage):
             args.append("-DCORENRN_ENABLE_MPI=OFF")
 
         if "+python" in spec:
-            args.append("-DPYTHON_EXECUTABLE:FILEPATH=" + spec["python"].command.path)
+            args.append("-DPYTHON_EXECUTABLE:FILEPATH=" + python.path)
 
         if spec.variants["build_type"].value == "Debug":
             args.append("-DCMAKE_C_FLAGS=-g -O0")
diff --git a/packages/nglview/package.py b/packages/nglview/package.py
deleted file mode 100644
index e86cd4915f8a8f8d3b7bfe175791e5f18e6e9bae..0000000000000000000000000000000000000000
--- a/packages/nglview/package.py
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack import *
-
-class Nglview(PythonPackage):
-    """An IPython/Jupyter widget to interactively view molecular structures and trajectories. 
-    Utilizes the embeddable NGL Viewer for rendering."""
-
-    # Homepage and download url
-    homepage = "https://github.com/nglviewer/nglview"
-    git = 'https://github.com/nglviewer/nglview.git'
-    url = 'https://github.com/nglviewer/nglview/archive/refs/tags/v3.0.4.tar.gz'
-
-    # Set the gitlab accounts of this package maintainers
-    maintainers = ['dbeltran']
-
-    # Versions
-    version('master', branch='master')
-    version('3.0.4', sha256='78b4413b796965a94045df0d584ec51e256c3dca5f366020439fe7e9744ce61b')
-
-    # Dependencies
-    depends_on('python@3.8:', type=('build', 'run'))
-    depends_on('py-setuptools')
-    depends_on('py-jupyter-packaging')
-    depends_on('py-versioneer')
-    depends_on('py-numpy', type=('run'))
-    depends_on('py-ipywidgets', type=('run'))
-
-    # Test
-    @run_after('install')
-    @on_package_attributes(run_tests=True)
-    def check_install (self):
-        python("-c", 'import nglview')
diff --git a/packages/open3d/package.py b/packages/open3d/package.py
index f3d2f6266e8331bd19b00fc753be1c21e985bffb..6b853c705258afe85244a0da61c3dcac8ffc5fca 100644
--- a/packages/open3d/package.py
+++ b/packages/open3d/package.py
@@ -17,11 +17,16 @@ class Open3d(CMakePackage, CudaPackage):
     url = "https://github.com/isl-org/Open3D/archive/refs/tags/v0.13.0.tar.gz"
     git = "https://github.com/isl-org/Open3D.git"
 
+    license("MIT")
+
     # begin EBRAINS (added): add version
-    version("0.18.0", tag="v0.18.0", submodules=True)
+    version(
+        "0.18.0", tag="v0.18.0", commit="0f06a149c4fb9406fd3e432a5cb0c024f38e2f0e", submodules=True
+    )
     # end EBRAINS
-    version("0.13.0", tag="v0.13.0", submodules=True)
-
+    version(
+        "0.13.0", tag="v0.13.0", commit="c3f9de224e13838a72da0e5565a7ba51038b0f11", submodules=True
+    )
     variant("python", default=False, description="Build the Python module")
 
     # http://www.open3d.org/docs/latest/compilation.html
@@ -157,12 +162,9 @@ class Open3d(CMakePackage, CudaPackage):
            args.append(self.define("USE_SYSTEM_EMBREE", True))
         # cf. https://github.com/spack/spack/issues/42839
         args.append(self.define("DEFINE_GLEW_NO_GLU", True))
-        # end EBRAINS
-
-        if "+python" in self.spec:
-            args.append(self.define("PYTHON_EXECUTABLE", self.spec["python"].command.path))
-
+        
         return args
+        # end EBRAINS
 
     def check(self):
         # begin EBRAINS (modified)
@@ -192,7 +194,7 @@ class Open3d(CMakePackage, CudaPackage):
     def test(self):
         if "+python" in self.spec:
             self.run_test(
-                self.spec["python"].command.path,
+                python.path,
                 ["-c", "import open3d"],
                 purpose="checking import of open3d",
                 work_dir="spack-test",
diff --git a/packages/openbabel/gcc12-cmake.patch b/packages/openbabel/gcc12-cmake.patch
deleted file mode 100644
index c568c8994b71b39ec95b86b125862cc4cb5941bf..0000000000000000000000000000000000000000
--- a/packages/openbabel/gcc12-cmake.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From c0570bfeb2d7e0a6a6de1f257cf28e7f3cac8739 Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Sun, 12 Jun 2022 11:23:59 +0100
-Subject: [PATCH] CMake: fix time check typo (fixes build failure w/ GCC 12)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Without this fixed check, we get a build failure with GCC 12:
-```
-/var/tmp/portage/sci-chemistry/openbabel-3.1.1_p20210225/work/openbabel-08e23f39b0cc39b4eebd937a5a2ffc1a7bac3e1b/include/openbabel/obutil.h:65:14: error: �~@~Xclock�~@~Y was not declared in this scope; did you mean �~@~Xclock_t�~@~Y?
-   65 |       start= clock();
-      |              ^~~~~
-      |              clock_t
-```
-
-Bug: https://bugs.gentoo.org/851510
----
- src/config.h.cmake | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/config.h.cmake b/src/config.h.cmake
-index 1c59c67699..26e5dde94f 100644
---- a/src/config.h.cmake
-+++ b/src/config.h.cmake
-@@ -182,8 +182,8 @@
- #define OB_MODULE_PATH "@OB_MODULE_PATH@"
-
- #ifndef TIME_WITH_SYS_TIME
--  #ifdef HAVE_SYS_TIME
--    #ifdef HAVE_TIME
-+  #ifdef HAVE_SYS_TIME_H
-+    #ifdef HAVE_TIME_H
-       #define TIME_WITH_SYS_TIME 1
-     #else
-       #define TIME_WITH_SYS_TIME 0
-
diff --git a/packages/openbabel/package.py b/packages/openbabel/package.py
deleted file mode 100644
index 176415098af865c9e8b772907ad82bab4fb2092e..0000000000000000000000000000000000000000
--- a/packages/openbabel/package.py
+++ /dev/null
@@ -1,97 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack.package import *
-
-
-class Openbabel(CMakePackage):
-    """Open Babel is a chemical toolbox designed to speak the many languages
-    of chemical data. It's an open, collaborative project allowing anyone to
-    search, convert, analyze, or store data from molecular modeling, chemistry,
-    solid-state materials, biochemistry, or related areas."""
-
-    homepage = "https://openbabel.org/wiki/Main_Page"
-    url = "https://github.com/openbabel/openbabel/archive/openbabel-3-0-0.tar.gz"
-    git = "https://github.com/openbabel/openbabel.git"
-
-    maintainers("RMeli")
-
-    version("master", branch="master")
-    version("3.1.1", tag="openbabel-3-1-1", commit="cbd4db43f8908b874864280fdc03bf92569eebc1")
-    version("3.1.0", tag="openbabel-3-1-0", commit="1e593abc1edf47352d5e8a0887654edf69a2f5f3")
-    version("3.0.0", tag="openbabel-3-0-0", commit="49f9cfb32bd0bc6ea440639d338123eb27accbe2")
-    version("2.4.1", tag="openbabel-2-4-1", commit="701f6049c483b1349118c2ff736a7f609a84dedd")
-    version("2.4.0", tag="openbabel-2-4-0", commit="087f33320e6796f39e6a1da04f4de7ec46bec4af")
-
-    variant("python", default=True, description="Build Python bindings")
-    variant("gui", default=True, description="Build with GUI")
-    variant("cairo", default=True, description="Build with Cairo (PNG output support)")
-    variant("openmp", default=False, description="Build with OpenMP")
-    variant("maeparser", default=False, description="Built with MAE parser")
-    variant("coordgen", default=False, description="Build with Coordgen")
-
-    extends("python", when="+python")
-
-    depends_on("python", type=("build", "run"), when="+python")
-    depends_on("cmake@3.1:", type="build")
-    depends_on("pkgconfig", type="build")
-    depends_on("swig@2.0:", type="build", when="+python")
-
-    depends_on("boost +filesystem +iostreams +test")
-    depends_on("cairo", when="+cairo")  # required to support PNG depiction
-    depends_on("pango", when="+cairo")  # custom cairo requires custom pango
-    depends_on("eigen@3.0:")  # required if using the language bindings
-    depends_on("libxml2")  # required to read/write CML files, XML formats
-    depends_on("zlib-api")  # required to support reading gzipped files
-    depends_on("rapidjson")  # required to support JSON
-    depends_on("libsm")
-    depends_on("uuid")
-
-    depends_on("maeparser", when="+maeparser")
-    depends_on("coordgen", when="+coordgen")
-
-    # Needed for Python 3.6 support
-    patch("python-3.6-rtld-global.patch", when="@:2.4.1+python")
-
-    # Convert tabs to spaces. Allows unit tests to pass
-    patch("testpdbformat-tabs-to-spaces.patch", when="@:2.4.1")
-
-    # begin EBRAINS (added)
-    # CMake: fix time check typo (fixes build failure w/ GCC 12)
-    patch("gcc12-cmake.patch", when="@:3.1.1")
-    # end EBRAINS
-
-    def cmake_args(self):
-        spec = self.spec
-        args = []
-
-        if "+python" in spec:
-            args.extend(
-                [
-                    "-DPYTHON_BINDINGS=ON",
-                    "-DPYTHON_EXECUTABLE={0}".format(spec["python"].command.path),
-                    "-DRUN_SWIG=ON",
-                ]
-            )
-        else:
-            args.append("-DPYTHON_BINDINGS=OFF")
-
-        args.append(self.define_from_variant("BUILD_GUI", "gui"))
-        args.append(self.define_from_variant("ENABLE_OPENMP", "openmp"))
-        args.append(self.define_from_variant("WITH_MAEPARSER", "maeparser"))
-        args.append(self.define_from_variant("WITH_COORDGEN", "coordgen"))
-
-        return args
-
-    @run_after("install")
-    @on_package_attributes(run_tests=True)
-    def check_install(self):
-        obabel = Executable(join_path(self.prefix.bin, "obabel"))
-        obabel("-:C1=CC=CC=C1Br", "-omol")
-
-        if "+python" in self.spec:
-            python("-c", "import openbabel")
-            if self.spec.version < Version("3.0.0"):
-                python("-c", "import pybel")
diff --git a/packages/openbabel/python-3.6-rtld-global.patch b/packages/openbabel/python-3.6-rtld-global.patch
deleted file mode 100644
index 68cd56a1f5c7dd66df0f76598b81a098c84d3f14..0000000000000000000000000000000000000000
--- a/packages/openbabel/python-3.6-rtld-global.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-The DLFCN module has been removed from python 3.6, as it is not
-documented. Same funtionality can be achive with the os module
-that makes available the os.RTLD_GLOBAL variable for dlopen()
-
-See https://github.com/openbabel/openbabel/pull/372 for the
-source of this patch. The original patch only affects the CMake
-file that SWIG uses to generate openbabel.py. This patch also
-includes changes to openbabel.py.
-
-diff -Nuar a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
---- a/scripts/CMakeLists.txt	2017-05-17 10:02:54.408527942 -0500
-+++ b/scripts/CMakeLists.txt	2017-05-17 10:04:09.701598715 -0500
-@@ -81,11 +81,8 @@
-             COMMAND ${SWIG_EXECUTABLE} -python -c++ -small -O -templatereduce -naturalvar -I${openbabel_SOURCE_DIR}/include -I${openbabel_BINARY_DIR}/include -o ${openbabel_SOURCE_DIR}/scripts/python/openbabel-python.cpp ${eigen_define} -outdir ${openbabel_SOURCE_DIR}/scripts/python ${openbabel_SOURCE_DIR}/scripts/openbabel-python.i
-               COMMAND ${CMAKE_COMMAND} -E echo "import sys" > ob.py
-               COMMAND ${CMAKE_COMMAND} -E echo "if sys.platform.find('linux'\) != -1:" >> ob.py
--              COMMAND ${CMAKE_COMMAND} -E echo "  try:" >> ob.py
--              COMMAND ${CMAKE_COMMAND} -E echo "    import dl" >> ob.py
--              COMMAND ${CMAKE_COMMAND} -E echo "  except ImportError:" >> ob.py
--              COMMAND ${CMAKE_COMMAND} -E echo "    import DLFCN as dl" >> ob.py
--              COMMAND ${CMAKE_COMMAND} -E echo "  sys.setdlopenflags(sys.getdlopenflags() | dl.RTLD_GLOBAL)" >> ob.py
-+              COMMAND ${CMAKE_COMMAND} -E echo "  import os" >> ob.py
-+              COMMAND ${CMAKE_COMMAND} -E echo "  sys.setdlopenflags(sys.getdlopenflags() | os.RTLD_GLOBAL)" >> ob.py
-               COMMAND cat ${openbabel_SOURCE_DIR}/scripts/python/openbabel.py >> ob.py
-               COMMAND ${CMAKE_COMMAND} -E copy ob.py ${openbabel_SOURCE_DIR}/scripts/python/openbabel.py
-               COMMAND ${CMAKE_COMMAND} -E remove ob.py
-diff -Nuar a/scripts/python/openbabel.py b/scripts/python/openbabel.py
---- a/scripts/python/openbabel.py	2017-05-17 10:02:54.398527534 -0500
-+++ b/scripts/python/openbabel.py	2017-05-17 10:04:26.705292138 -0500
-@@ -1,10 +1,7 @@
- import sys
- if sys.platform.find('linux') != -1:
--  try:
--    import dl
--  except ImportError:
--    import DLFCN as dl
--  sys.setdlopenflags(sys.getdlopenflags() | dl.RTLD_GLOBAL)
-+  import os
-+  sys.setdlopenflags(sys.getdlopenflags() | os.RTLD_GLOBAL)
- # This file was automatically generated by SWIG (http://www.swig.org).
- # Version 3.0.10
- #
diff --git a/packages/openbabel/testpdbformat-tabs-to-spaces.patch b/packages/openbabel/testpdbformat-tabs-to-spaces.patch
deleted file mode 100644
index 0a71a72e014ad1b5cd895599c97cfa6e66eef582..0000000000000000000000000000000000000000
--- a/packages/openbabel/testpdbformat-tabs-to-spaces.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 08cd38485d4cf1df8802da540f3018921dbc735e Mon Sep 17 00:00:00 2001
-From: "Adam J. Stewart" <ajstewart426@gmail.com>
-Date: Wed, 17 May 2017 10:56:23 -0500
-Subject: [PATCH] Convert tabs to spaces in testpdbformat.py
-
-See https://github.com/openbabel/openbabel/pull/1568
-
----
- test/testpdbformat.py | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/test/testpdbformat.py b/test/testpdbformat.py
-index 40bd316..ceb8496 100644
---- a/test/testpdbformat.py
-+++ b/test/testpdbformat.py
-@@ -24,12 +24,12 @@ class TestPDBFormat(BaseTest):
- 
-     def testInsertionCodes(self):
-         """
--	Testing a PDB entry with insertion codes to distinguish residues
--	upon conversion to FASTA.
-+        Testing a PDB entry with insertion codes to distinguish residues
-+        upon conversion to FASTA.
-         """
-         self.canFindExecutable("babel")
- 
--	self.entryPDBwithInsertioncodes="""ATOM    406  N   VAL L  29      58.041  17.797  48.254  1.00  0.00           N  
-+        self.entryPDBwithInsertioncodes="""ATOM    406  N   VAL L  29      58.041  17.797  48.254  1.00  0.00           N  
- ATOM    407  CA  VAL L  29      57.124  18.088  47.170  1.00  0.00           C  
- ATOM    408  C   VAL L  29      55.739  17.571  47.538  1.00  0.00           C  
- ATOM    409  O   VAL L  29      55.535  16.362  47.550  1.00  0.00           O  
-@@ -100,9 +100,9 @@ ATOM    473  HE1 TYR L  32      48.512  15.775  42.066  1.00  0.00           H
- ATOM    474  HE2 TYR L  32      48.145  19.172  44.648  1.00  0.00           H  
- ATOM    475  HH  TYR L  32      46.462  17.658  44.280  1.00  0.00           H  
- """
--	output, error = run_exec(self.entryPDBwithInsertioncodes,
--				     "babel -ipdb -ofasta")
--	self.assertEqual(output.rstrip().rsplit("\n",1)[1], "VSSSY")
-+        output, error = run_exec(self.entryPDBwithInsertioncodes,
-+                                     "babel -ipdb -ofasta")
-+        self.assertEqual(output.rstrip().rsplit("\n",1)[1], "VSSSY")
- 
- if __name__ == "__main__":
-     testsuite = []
--- 
-2.9.4
-
diff --git a/packages/py-astropy/package.py b/packages/py-astropy/package.py
index a58d9ebe434e49def4d70c3b52db48cdce77091f..96d6360539b4fda20e77d7145de30b4dfaa9852a 100644
--- a/packages/py-astropy/package.py
+++ b/packages/py-astropy/package.py
@@ -17,6 +17,8 @@ class PyAstropy(PythonPackage):
     pypi = "astropy/astropy-4.0.1.post1.tar.gz"
     git = "https://github.com/astropy/astropy.git"
 
+    license("BSD-3-Clause")
+
     # begin EBRAINS (added): add version
     version("5.2.2", sha256="e6a9e34716bda5945788353c63f0644721ee7e5447d16b1cdcb58c48a96b0d9c")
     # end EBRAINS
diff --git a/packages/py-autopep8/package.py b/packages/py-autopep8/package.py
index e09fd53fc80ad1deb43e5753715efaadba83a7b1..5e37dec3da4e06fee5ba06de05645441d9689f86 100644
--- a/packages/py-autopep8/package.py
+++ b/packages/py-autopep8/package.py
@@ -13,6 +13,8 @@ class PyAutopep8(PythonPackage):
     homepage = "https://github.com/hhatto/autopep8"
     pypi = "autopep8/autopep8-1.2.4.tar.gz"
 
+    license("MIT")
+
     # begin EBRAINS (added): add version
     version("2.0.4", sha256="2913064abd97b3419d1cc83ea71f042cb821f87e45b9c88cad5ad3c4ea87fe0c")
     # end EBRAINS
diff --git a/packages/py-bokeh/package.py b/packages/py-bokeh/package.py
index 5c92e1664b700818cd2b2d21723f599aac16e80b..818fb4de355c1c9b9974e52dc3255d697aa8cd96 100644
--- a/packages/py-bokeh/package.py
+++ b/packages/py-bokeh/package.py
@@ -9,9 +9,12 @@ from spack.package import *
 class PyBokeh(PythonPackage):
     """Statistical and novel interactive HTML plots for Python"""
 
-    homepage = "https://github.com/bokeh/bokeh"
+    homepage = "https://bokeh.org/"
     pypi = "bokeh/bokeh-0.12.2.tar.gz"
 
+    license("BSD-3-Clause")
+
+    version("3.3.1", sha256="2a7b3702d7e9f03ef4cd801b02b7380196c70cff2773859bcb84fa565218955c")
     version("2.4.3", sha256="ef33801161af379665ab7a34684f2209861e3aefd5c803a21fbbb99d94874b03")
     version("2.4.1", sha256="d0410717d743a0ac251e62480e2ea860a7341bdcd1dbe01499a904f233c90512")
     version("2.4.0", sha256="6fa00ed8baab5cca33f4175792c309fa2536eaae7e90abee884501ba8c90fddb")
@@ -19,16 +22,21 @@ class PyBokeh(PythonPackage):
     version("1.3.4", sha256="e2d97bed5b199a10686486001fed5c854e4c04ebe28859923f27c52b93904754")
     version("0.12.2", sha256="0a840f6267b6d342e1bd720deee30b693989538c49644142521d247c0f2e6939")
 
-    depends_on("py-setuptools", type="build", when="@1.3.4:")
-
     # begin EBRAINS (added)
     depends_on("npm", type=("build", "run"))
     # end EBRAINS
 
+    depends_on("py-setuptools", type="build", when="@1.3.4:")
+    depends_on("py-setuptools@64:", type="build", when="@3:")
+    depends_on("py-setuptools-git-versioning", type="build", when="@3:")
+    depends_on("py-colorama", type="build", when="@3:")
+
     depends_on("python@2.6:", type=("build", "run"), when="@0.12.2")
     depends_on("python@2.7:", type=("build", "run"), when="@1.3.4:")
     depends_on("python@3.6:", type=("build", "run"), when="@2.3.3:")
     depends_on("python@3.7:", type=("build", "run"), when="@2.4.0:")
+    depends_on("python@3.8:", type=("build", "run"), when="@3.0.0:")
+    depends_on("python@3.9:", type=("build", "run"), when="@3.2.0:")
 
     depends_on("py-requests@1.2.3:", type=("build", "run"), when="@0.12.2")
     depends_on("py-six@1.5.2:", type=("build", "run"), when="@:1.3.4")
@@ -37,11 +45,16 @@ class PyBokeh(PythonPackage):
     depends_on("py-jinja2@2.7:", type=("build", "run"))
     depends_on("py-jinja2@2.9:", type=("build", "run"), when="@2.3.3:")
 
+    depends_on("py-contourpy@1:", type=("build", "run"), when="@3:")
+
     depends_on("py-numpy@1.7.1:", type=("build", "run"))
     depends_on("py-numpy@1.11.3:", type=("build", "run"), when="@2.3.3:")
+    depends_on("py-numpy@1.16:", type=("build", "run"), when="@3.1:")
 
     depends_on("py-packaging@16.8:", type=("build", "run"), when="@1.3.4:")
 
+    depends_on("py-pandas@1.2:", type=("build", "run"), when="@3:")
+
     depends_on("pil@4.0:", type=("build", "run"), when="@1.3.4:")
     depends_on("pil@7.1.0:", type=("build", "run"), when="@2.3.3:")
 
@@ -50,5 +63,7 @@ class PyBokeh(PythonPackage):
     depends_on("py-tornado@4.3:", type=("build", "run"))
     depends_on("py-tornado@5.1:", type=("build", "run"), when="@2.3.3:")
 
-    depends_on("py-typing-extensions@3.7.4:", type=("build", "run"), when="@2.3.3:")
-    depends_on("py-typing-extensions@3.10.0:", type=("build", "run"), when="@2.4.0:")
\ No newline at end of file
+    depends_on("py-typing-extensions@3.7.4:", type=("build", "run"), when="@2.3.3:3.0.0")
+    depends_on("py-typing-extensions@3.10.0:", type=("build", "run"), when="@2.4.0:3.0.0")
+
+    depends_on("py-xyzservices@2021.09.1:", type=("build", "run"), when="@3:")
diff --git a/packages/py-chex/package.py b/packages/py-chex/package.py
deleted file mode 100644
index 86c2f71a59cb584e63136046250c610aa2b467e3..0000000000000000000000000000000000000000
--- a/packages/py-chex/package.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack.package import *
-
-
-class PyChex(PythonPackage):
-    """Chex is a library of utilities for helping to write reliable JAX code."""
-
-    homepage = "https://github.com/deepmind/chex"
-    pypi = "chex/chex-0.1.0.tar.gz"
-
-    # begin EBRAINS (added): bring upstream
-    version("0.1.7", sha256="74ed49799ac4d229881456d468136f1b19a9f9839e3de72b058824e2a4f4dedd")
-    # end EBRAINS
-    version("0.1.5", sha256="686858320f8f220c82a6c7eeb54dcdcaa4f3d7f66690dacd13a24baa1ee8299e")
-    version("0.1.0", sha256="9e032058f5fed2fc1d5e9bf8e12ece5910cf6a478c12d402b6d30984695f2161")
-
-    depends_on("python@3.7:", type=("build", "run"))
-    depends_on("py-setuptools", type="build")
-    depends_on("py-absl-py@0.9.0:", type=("build", "run"))
-    # begin EBRAINS (added): bring upstream
-    depends_on("py-typing-extensions@4.2.0:", when="@0.1.6: ^python@:3.10", type=("build", "run"))
-    # end EBRAINS
-    depends_on("py-dm-tree@0.1.5:", type=("build", "run"))
-    depends_on("py-jax@0.1.55:", type=("build", "run"))
-    # begin EBRAINS (added): bring upstream
-    depends_on("py-jax@0.4.6:", when="@0.1.7:", type=("build", "run"))
-    # end EBRAINS
-    depends_on("py-jaxlib@0.1.37:", type=("build", "run"))
-    depends_on("py-numpy@1.18.0:", type=("build", "run"))
-    depends_on("py-toolz@0.9.0:", type=("build", "run"))
diff --git a/packages/py-ipycanvas/package.py b/packages/py-ipycanvas/package.py
index f9cd586a324cf1bbcbe531a1ad7babfb57a27c47..0883611fad05a28d9dd5364afb65ecece7eb3e68 100644
--- a/packages/py-ipycanvas/package.py
+++ b/packages/py-ipycanvas/package.py
@@ -12,6 +12,8 @@ class PyIpycanvas(PythonPackage):
     homepage = "https://github.com/martinRenou/ipycanvas"
     pypi = "ipycanvas/ipycanvas-0.9.0.tar.gz"
 
+    license("BSD-3-Clause")
+
     # begin EBRAINS (added): add version
     version("0.12.0", sha256="3984339cef0c15674e347dd65ffb0cd1edc62e37869cbb5efea46f3259e976f3")
     # end EBRAINS
diff --git a/packages/py-ipympl/package.py b/packages/py-ipympl/package.py
index 2bd82b56217643624b98b2f28b034b01176f48dc..fc331eb8b970fd74580b04fada081b823b5fb4a0 100644
--- a/packages/py-ipympl/package.py
+++ b/packages/py-ipympl/package.py
@@ -1,4 +1,4 @@
-# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
+# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
 # Spack Project Developers. See the top-level COPYRIGHT file for details.
 #
 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
@@ -13,6 +13,8 @@ class PyIpympl(PythonPackage):
     pypi = "ipympl/ipympl-0.8.8.tar.gz"
     maintainers("haralmha")
 
+    license("BSD-3-Clause")
+
     version("0.8.8", sha256="5bf5d780b07fafe7924922ac6b2f3abd22721f341e5e196b3b82737dfbd0e1c9")
 
     depends_on("py-setuptools@40.8:", type="build")
diff --git a/packages/py-jax/package.py b/packages/py-jax/package.py
deleted file mode 100644
index 5d57d7ec983200b1c78adccb811608e4993b802a..0000000000000000000000000000000000000000
--- a/packages/py-jax/package.py
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack.package import *
-
-
-class PyJax(PythonPackage):
-    """JAX is Autograd and XLA, brought together for high-performance
-    machine learning research. With its updated version of Autograd,
-    JAX can automatically differentiate native Python and NumPy
-    functions. It can differentiate through loops, branches,
-    recursion, and closures, and it can take derivatives of
-    derivatives of derivatives. It supports reverse-mode
-    differentiation (a.k.a. backpropagation) via grad as well as
-    forward-mode differentiation, and the two can be composed
-    arbitrarily to any order."""
-
-    homepage = "https://github.com/google/jax"
-    pypi = "jax/jax-0.2.25.tar.gz"
-
-    # begin EBRAINS (added): bring upstream
-    version("0.4.13", sha256="03bfe6749dfe647f16f15f6616638adae6c4a7ca7167c75c21961ecfd3a3baaa")
-    # end EBRAINS
-    version("0.4.3", sha256="d43f08f940aa30eb339965cfb3d6bee2296537b0dc2f0c65ccae3009279529ae")
-    version("0.3.23", sha256="bff436e15552a82c0ebdef32737043b799e1e10124423c57a6ae6118c3a7b6cd")
-    version("0.2.25", sha256="822e8d1e06257eaa0fdc4c0a0686c4556e9f33647fa2a766755f984786ae7446")
-
-    # begin EBRAINS (modified): bring upstream
-    depends_on("python@3.7:", type=("build", "run"))
-    depends_on("python@3.8:", when="@0.4:", type=("build", "run"))
-    depends_on("python@3.9:", when="@0.4.14:", type=("build", "run"))
-    depends_on("py-setuptools", type="build")
-    depends_on("py-numpy@1.22:", when="@0.4.14:", type=("build", "run"))
-    depends_on("py-numpy@1.21:", when="@0.4.9:", type=("build", "run"))
-    depends_on("py-numpy@1.20:", when="@0.3:", type=("build", "run"))
-    depends_on("py-numpy@1.18:", type=("build", "run"))
-    depends_on("py-opt-einsum", type=("build", "run"))
-    depends_on("py-scipy@1.2.1:", type=("build", "run"))
-    depends_on("py-scipy@1.5:", when="@0.3:", type=("build", "run"))
-    depends_on("py-scipy@1.7:", when="@0.4.7:", type=("build", "run"))
-    depends_on("py-ml-dtypes@0.2.0:", when="@0.4.14:", type=("build", "run"))
-    depends_on("py-ml-dtypes@0.1.0:", when="@0.4.9:", type=("build", "run"))
-    depends_on("py-ml-dtypes@0.0.3:", when="@0.4.7:", type=("build", "run"))
-    depends_on("py-importlib-metadata@4.6:", when="@0.4.11: ^python@:3.9", type="run")
-    # end EBRAINS
-
-    # See _minimum_jaxlib_version in jax/version.py
-    # begin EBRAINS (modified): bring upstream
-    jax_to_jaxlib = {
-        "0.4.14": "0.4.14",
-        "0.4.13": "0.4.13",
-        "0.4.3": "0.4.2",
-        "0.3.23": "0.3.15",
-        "0.2.25": "0.1.69",
-    }
-    # end EBRAINS
-
-    for jax, jaxlib in jax_to_jaxlib.items():
-        # begin EBRAINS (modified): bring upstream
-        depends_on(f"py-jaxlib@{jaxlib}", when=f"@{jax}", type=("build", "run"))
-        # end EBRAINS
-
-    # Historical dependencies
-    depends_on("py-absl-py", when="@:0.3", type=("build", "run"))
-    depends_on("py-typing-extensions", when="@:0.3", type=("build", "run"))
-    # begin EBRAINS (deleted):
-    # depends_on("py-etils+epath", when="@0.3", type=("build", "run"))
-    # end EBRAINS
diff --git a/packages/py-jaxlib/package.py b/packages/py-jaxlib/package.py
index 20b2683ca313882e157298991835e8401ea498ec..6d2258c5fa55dafd7c64ae866187ba61232fa487 100644
--- a/packages/py-jaxlib/package.py
+++ b/packages/py-jaxlib/package.py
@@ -17,48 +17,77 @@ class PyJaxlib(PythonPackage, CudaPackage):
     tmp_path = ""
     buildtmp = ""
 
-    # begin EBRAINS (added): bring upstream
-    version("0.4.13", sha256="45766238b57b992851763c64bc943858aebafe4cad7b3df6cde844690bc34293")
-    # end EBRAINS
+    license("Apache-2.0")
+    maintainers("adamjstewart")
+
+    version("0.4.26", sha256="ddc14da1eaa34f23430d40ad9b9585088575cac439a2fa1c6833a247e1b221fd")
+    version("0.4.25", sha256="fc1197c401924942eb14185a61688d0c476e3e81ff71f9dc95e620b57c06eec8")
+    version("0.4.24", sha256="c4e6963c2c36f634a9a1765e476a1ed4e6c4a7954465ebf72e29f344c28ddc28")
+    version("0.4.23", sha256="e4c06d62ba54becffd91abc862627b8b11b79c5a77366af8843b819665b6d568")
+    version("0.4.21", sha256="8d57f66d00b9c0b824b1eff84adda5b765a412b3f316ef7c773632d1edbf9477")
+    version("0.4.20", sha256="058410d2bc12f7562c7b01e0c8cd587cb68059c12f78bc945055e5ddc445f5fd")
+    version("0.4.19", sha256="51242b217a1f82474e42d24f09ed5dedff951eeb4579c6e49e706d1adfd6949d")
+    version("0.4.16", sha256="85c8bc050abe0a2cf62e8cfc7edb4904dd3807924b5714ec6277f291c576b5ca")
+    version("0.4.14", sha256="9f309476a8f6337717b059b8d10b5859b4134c30cf8f1220bb70379b5e2744a4")
+    version("0.4.11", sha256="bdfc45f33970beba5caf28d061668a4863f05994deea26791db50ea605fc2e36")
+    version("0.4.7", sha256="0578d5dd5035b5225cadb6a62ca5f93dd76b70292268502fc01a0fd9ca7001d0")
+    version("0.4.6", sha256="2c9bf8962815bc54ef524e33dc8eda9d165d379fe87e0df210f316adead27787")
+    version("0.4.4", sha256="881f402c7983b56b185e182d5315dd64c9f5320be96213d0415996ece1826806")
     version("0.4.3", sha256="2104735dc22be2b105e5517bd5bc6ae97f40e8e9e54928cac1585c6112a3d910")
-    version("0.3.22", sha256="680a6f5265ba26d5515617a95ae47244005366f879a5c321782fde60f34e6d0d")
-    version("0.1.74", sha256="bbc78c7a4927012dcb1b7cd135c7521f782d7dad516a2401b56d3190f81afe35")
+    version(
+        "0.3.22",
+        sha256="680a6f5265ba26d5515617a95ae47244005366f879a5c321782fde60f34e6d0d",
+        deprecated=True,
+    )
+    version(
+        "0.1.74",
+        sha256="bbc78c7a4927012dcb1b7cd135c7521f782d7dad516a2401b56d3190f81afe35",
+        deprecated=True,
+    )
 
     # begin EBRAINS (deleted): Variant with default=False is provided by CudaPackage
     # variant("cuda", default=True, description="Build with CUDA")
     # end EBRAINS
 
+    # build/build.py
+    depends_on("py-build", when="@0.4.14:", type="build")
+
+    # Based on PyPI wheels
+    depends_on("python@3.9:3.12", when="@0.4.17:", type=("build", "run"))
+    depends_on("python@3.9:3.11", when="@0.4.14:0.4.16", type=("build", "run"))
+    depends_on("python@3.8:3.11", when="@0.4.6:0.4.13", type=("build", "run"))
+
     # jaxlib/setup.py
-    # begin EBRAINS (modified): bring upstream
-    depends_on("python@3.9:", when="@0.4.14:", type=("build", "run"))
-    depends_on("python@3.8:", when="@0.4:", type=("build", "run"))
-    depends_on("python@3.7:", type=("build", "run"))
     depends_on("py-setuptools", type="build")
+    depends_on("py-scipy@1.9:", when="@0.4.19:", type=("build", "run"))
+    depends_on("py-scipy@1.7:", when="@0.4.7:", type=("build", "run"))
+    depends_on("py-scipy@1.5:", type=("build", "run"))
     depends_on("py-numpy@1.22:", when="@0.4.14:", type=("build", "run"))
-    depends_on("py-numpy@1.21:", when="@0.4.9:", type=("build", "run"))
+    depends_on("py-numpy@1.21:", when="@0.4.7:", type=("build", "run"))
     depends_on("py-numpy@1.20:", when="@0.3:", type=("build", "run"))
     depends_on("py-numpy@1.18:", type=("build", "run"))
-    depends_on("py-scipy@1.5:", type=("build", "run"))
-    depends_on("py-scipy@1.7:", when="@0.4.7:", type=("build", "run"))
-    depends_on("py-ml-dtypes@0.2.0:", when="@0.4.14:", type=("build", "run"))
-    depends_on("py-ml-dtypes@0.1.0:", when="@0.4.9:", type=("build", "run"))
+    depends_on("py-ml-dtypes@0.2:", when="@0.4.14:", type=("build", "run"))
+    depends_on("py-ml-dtypes@0.1:", when="@0.4.9:", type=("build", "run"))
     depends_on("py-ml-dtypes@0.0.3:", when="@0.4.7:", type=("build", "run"))
-    # end EBRAINS
 
     # .bazelversion
-    depends_on("bazel@5.1.1:5.9", when="@0.3:", type="build")
-    # https://github.com/google/jax/issues/8440
-    depends_on("bazel@4.1:4", when="@0.1", type="build")
+    depends_on("bazel@6.1.2", when="@0.4.11:", type="build")
+    depends_on("bazel@5.1.1", when="@0.3.7:0.4.10", type="build")
+    depends_on("bazel@5.1.0", when="@0.3.5", type="build")
+    depends_on("bazel@5.0.0", when="@0.3.0:0.3.2", type="build")
+    depends_on("bazel@4.2.1", when="@0.1.75:0.1.76", type="build")
+    depends_on("bazel@4.1.0", when="@0.1.70:0.1.74", type="build")
 
-    # README.md
-    # begin EBRAINS (added): bring upstream
-    depends_on("cuda@11.8:", when="@0.4.8:+cuda")
-    # end EBRAINS
-    depends_on("cuda@11.4:", when="@0.4:+cuda")
+    # jaxlib/setup.py
+    depends_on("cuda@12.1.105:", when="@0.4.26:+cuda")
+    depends_on("cuda@11.8:", when="@0.4.11:+cuda")
+    depends_on("cuda@11.4:", when="@0.4.0:0.4.7+cuda")
     depends_on("cuda@11.1:", when="@0.3+cuda")
     # https://github.com/google/jax/issues/12614
     depends_on("cuda@11.1:11.7.0", when="@0.1+cuda")
-    depends_on("cudnn@8.2:", when="@0.4:+cuda")
+
+    depends_on("cudnn@8.8:", when="@0.4.11:+cuda")
+    depends_on("cudnn@8.2:", when="@0.4:0.4.7+cuda")
     depends_on("cudnn@8.0.5:", when="+cuda")
 
     # Historical dependencies
@@ -72,6 +101,9 @@ class PyJaxlib(PythonPackage, CudaPackage):
         "https://developer.nvidia.com/cuda-gpus",
     )
 
+    # https://github.com/google/jax/issues/19992
+    conflicts("@0.4.4:", when="target=ppc64le:")
+
     def patch(self):
         self.tmp_path = tempfile.mkdtemp(prefix="spack")
         self.buildtmp = tempfile.mkdtemp(prefix="spack")
@@ -95,10 +127,13 @@ build --local_cpu_resources={make_jobs}
             "build/build.py",
             string=True,
         )
+        build_wheel = join_path("build", "build_wheel.py")
+        if self.spec.satisfies("@0.4.14:"):
+            build_wheel = join_path("jaxlib", "tools", "build_wheel.py")
         filter_file(
             "args = parser.parse_args()",
             "args, junk = parser.parse_known_args()",
-            "build/build_wheel.py",
+            build_wheel,
             string=True,
         )
 
diff --git a/packages/py-numba/package.py b/packages/py-numba/package.py
index 6c0ee7b2394202d39a95506f2a7bd1707a659d64..5ed240395fdafd993d48d8760baddb4a17f93e4d 100644
--- a/packages/py-numba/package.py
+++ b/packages/py-numba/package.py
@@ -13,6 +13,11 @@ class PyNumba(PythonPackage):
     pypi = "numba/numba-0.35.0.tar.gz"
     git = "https://github.com/numba/numba.git"
 
+    skip_modules = ["numba.core.rvsdg_frontend"]
+
+    license("BSD-2-Clause")
+
+    version("0.58.1", sha256="487ded0633efccd9ca3a46364b40006dbdaca0f95e99b8b83e778d1195ebcbaa")
     version("0.57.0", sha256="2af6d81067a5bdc13960c6d2519dbabbf4d5d597cf75d640c5aeaefd48c6420a")
     version("0.56.4", sha256="32d9fef412c81483d7efe0ceb6cf4d3310fde8b624a9cecca00f790573ac96ee")
     version("0.56.0", sha256="87a647dd4b8fce389869ff71f117732de9a519fe07663d9a02d75724eb8e244d")
@@ -22,34 +27,36 @@ class PyNumba(PythonPackage):
     version("0.51.1", sha256="1e765b1a41535684bf3b0465c1d0a24dcbbff6af325270c8f4dad924c0940160")
     version("0.50.1", sha256="89e81b51b880f9b18c82b7095beaccc6856fcf84ba29c4f0ced42e4e5748a3a7")
     version("0.48.0", sha256="9d21bc77e67006b5723052840c88cc59248e079a907cc68f1a1a264e1eaba017")
-    version("0.40.1", sha256="52d046c13bcf0de79dbfb936874b7228f141b9b8e3447cc35855e9ad3e12aa33")
 
-    depends_on("python@3.8:3.11", when="@0.57", type=("build", "run"))
+    variant("tbb", default=False, description="Build with Intel Threading Building Blocks")
+
+    depends_on("python@3.8:3.11", when="@0.57:", type=("build", "run"))
     depends_on("python@3.7:3.10", when="@0.55:0.56", type=("build", "run"))
     depends_on("python@3.7:3.9", when="@0.54", type=("build", "run"))
     depends_on("python@3.6:3.9", when="@0.53", type=("build", "run"))
     depends_on("python@3.6:3.8", when="@0.52", type=("build", "run"))
     depends_on("python@3.6:3.8", when="@0.48:0.51", type=("build", "run"))
-    depends_on("python@3.3:3.7", when="@0.40.1:0.47", type=("build", "run"))
-    depends_on("py-numpy@1.21:1.24", when="@0.57:", type=("build", "run"))
+    depends_on("py-numpy@1.22:1.26", when="@0.58.1:", type=("build", "run"))
+    depends_on("py-numpy@1.21:1.25", when="@0.58.0", type=("build", "run"))
+    depends_on("py-numpy@1.21:1.24", when="@0.57", type=("build", "run"))
     depends_on("py-numpy@1.18:1.23", when="@0.56.1:0.56.4", type=("build", "run"))
     depends_on("py-numpy@1.18:1.22", when="@0.55.2:0.56.0", type=("build", "run"))
     depends_on("py-numpy@1.18:1.21", when="@0.55.0:0.55.1", type=("build", "run"))
     depends_on("py-numpy@1.17:1.20", when="@0.54", type=("build", "run"))
     depends_on("py-numpy@1.15:1.20", when="@0.48:0.53", type=("build", "run"))
-    depends_on("py-numpy@1.10:1.20", when="@:0.47", type=("build", "run"))
     depends_on("py-setuptools", type=("build", "run"))
+    depends_on("py-llvmlite@0.41", when="@0.58", type=("build", "run"))
     depends_on("py-llvmlite@0.40", when="@0.57", type=("build", "run"))
     depends_on("py-llvmlite@0.39", when="@0.56", type=("build", "run"))
     depends_on("py-llvmlite@0.38", when="@0.55", type=("build", "run"))
     depends_on("py-llvmlite@0.37", when="@0.54.0", type=("build", "run"))
     depends_on("py-llvmlite@0.34", when="@0.51.1", type=("build", "run"))
     depends_on("py-llvmlite@0.33", when="@0.50.1", type=("build", "run"))
-    depends_on("py-llvmlite@0.31", when="@0.47,0.48", type=("build", "run"))
-    depends_on("py-llvmlite@0.25", when="@0.40", type=("build", "run"))
-    depends_on("py-llvmlite@0.20:0.25", when="@0.35.1", type=("build", "run"))
+    depends_on("py-llvmlite@0.31", when="@0.48", type=("build", "run"))
     depends_on("py-importlib-metadata", when="@0.56:^python@:3.8", type=("build", "run"))
 
+    depends_on("tbb", when="+tbb")
+    conflicts("~tbb", when="@:0.50")  # No way to disable TBB
     # Version 6.0.0 of llvm had a hidden symbol which breaks numba at runtime.
     # See https://reviews.llvm.org/D44140
     conflicts("^llvm@6.0.0")
@@ -57,3 +64,7 @@ class PyNumba(PythonPackage):
     # begin EBRAINS (added): numba>=0.57 requires at least version 14.0.0 of LLVM
     conflicts("llvm@:13", when="@0.57.0:")
     # end EBRAINS
+
+    def setup_build_environment(self, env):
+        if self.spec.satisfies("~tbb"):
+            env.set("NUMBA_DISABLE_TBB", "yes")
diff --git a/packages/py-optax/package.py b/packages/py-optax/package.py
deleted file mode 100644
index c5cf8840ec3e0fb1add31267cbba8879b1521d89..0000000000000000000000000000000000000000
--- a/packages/py-optax/package.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack import *
-
-
-class PyOptax(PythonPackage):
-    """A gradient processing and optimization library in JAX."""
-
-    homepage = "https://github.com/deepmind/optax"
-    pypi = "optax/optax-0.1.4.tar.gz"
-
-    version("0.1.4", sha256="fb7a0550d57a6636164a3de25986a8a19be8ff6431fcdf1225b4e05175810f22")
-
-    depends_on("python@3.8:", type=("build", "run"))
-    depends_on("py-setuptools", type="build")
-
-    depends_on("py-absl-py@0.7.1:", type=("build", "run"))
-    depends_on("py-chex@0.1.5:", type=("build", "run"))
-    depends_on("py-jax@0.1.55:", type=("build", "run"))
-    depends_on("py-jaxlib@0.1.37:", type=("build", "run"))
-    depends_on("py-numpy@1.18:", type=("build", "run"))
diff --git a/packages/py-pycuda/package.py b/packages/py-pycuda/package.py
index 98691d68595bc90fd4605519222a87d5c5003b8c..8790d8f54ea08819e11af8b61f5199114f2e1db3 100644
--- a/packages/py-pycuda/package.py
+++ b/packages/py-pycuda/package.py
@@ -15,6 +15,8 @@ class PyPycuda(PythonPackage):
     homepage = "https://mathema.tician.de/software/pycuda/"
     pypi = "pycuda/pycuda-2019.1.2.tar.gz"
 
+    license("MIT")
+
     # begin EBRAINS (added): add version
     version("2023.1", sha256="175ff675f0cf10e38e9adc03ed5df3ed8d8abf7da5134c8dccec752e8a0a3e91")
     # end EBRAINS
diff --git a/packages/py-pyviz-comms/package.py b/packages/py-pyviz-comms/package.py
index 0e6d6c84a0248e8839a10dc10fc117896ea87d84..03ed4163555f3eccf24971652e0f91f369651444 100644
--- a/packages/py-pyviz-comms/package.py
+++ b/packages/py-pyviz-comms/package.py
@@ -12,6 +12,8 @@ class PyPyvizComms(PythonPackage):
     homepage = "https://holoviz.org/"
     pypi = "pyviz_comms/pyviz_comms-2.2.1.tar.gz"
 
+    license("BSD-3-Clause")
+
     # begin EBRAINS (added): add version
     version("2.3.2", sha256="542a10fed8242d3a9d468ed0a14d6a2537e589c3f8a7986c79c374591254d6b4")
     # end EBRAINS
diff --git a/packages/py-ray/package.py b/packages/py-ray/package.py
index 453f371f51200cf69824f2ac31e92830fa23f5ad..86061254270a28cf9c28f2cbec1e28ef4ae2dde0 100644
--- a/packages/py-ray/package.py
+++ b/packages/py-ray/package.py
@@ -12,6 +12,8 @@ class PyRay(PythonPackage):
     homepage = "https://github.com/ray-project/ray"
     url = "https://github.com/ray-project/ray/archive/ray-0.8.7.tar.gz"
 
+    license("Apache-2.0")
+
     # begin EBRAINS (added): ECM new node-js -> new react whatever -> new py-ray
     version("2.4.0", sha256="b0110a84630b2f6d10cd13e8ac955875c3658373eb6cabcc77cf316de3c28066")
     # end EBRAINS
diff --git a/packages/py-sympy/package.py b/packages/py-sympy/package.py
index b7f5b90e9929484373843699a82c426c80cf196f..b39d7f19e70f399cb1433c2ddd3d91d0540da332 100644
--- a/packages/py-sympy/package.py
+++ b/packages/py-sympy/package.py
@@ -11,6 +11,9 @@ class PySympy(PythonPackage):
 
     pypi = "sympy/sympy-0.7.6.tar.gz"
 
+    license("BSD-3-Clause")
+
+    version("1.12", sha256="ebf595c8dac3e0fdc4152c51878b498396ec7f30e7a914d6071e674d49420fb8")
     version("1.11.1", sha256="e32380dce63cb7c0108ed525570092fd45168bdae2faa17e528221ef72e88658")
     # begin EBRAINS (added): add versions
     version("1.10.1", sha256="5939eeffdf9e152172601463626c022a2c27e75cf6278de8d401d50c9d58787b")
diff --git a/packages/py-tree-math/package.py b/packages/py-tree-math/package.py
deleted file mode 100644
index 69ba02f5118edb9671814d306a1664b5b662c9a2..0000000000000000000000000000000000000000
--- a/packages/py-tree-math/package.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack import *
-
-
-class PyTreeMath(PythonPackage):
-    """
-    tree-math makes it easy to implement numerical algorithms that work on
-    JAX pytrees, such as iterative methods for optimization and equation
-    solving. It does so by providing a wrapper class tree_math.Vector that
-    defines array operations such as infix arithmetic and dot-products on
-    pytrees as if they were vectors.
-    """
-
-    homepage = "https://github.com/google/tree-math"
-    pypi = "tree-math/tree-math-0.1.0.tar.gz"
-    git = "https://github.com/google/tree-math.git"
-
-    version('0.1.0.post', commit='0af9679125c13cc38dab5159bc8413ed79465344')
-    version('0.1.0', sha256='77eb8d6ba4d6cfdd2d986a6bc3fc2d1b16212f0172863a3ca509720babf75929')
-
-    depends_on('py-setuptools', type='build')
-    depends_on('py-jax', type=('build', 'run'))
diff --git a/packages/sbml/package.py b/packages/sbml/package.py
index e1bfdcefb161463660f4b55f479b3dd29fb088a4..61295af59bbcf30563b524bf8ad8fc2383e061eb 100644
--- a/packages/sbml/package.py
+++ b/packages/sbml/package.py
@@ -1,5 +1,3 @@
-# this package was adapted from Spack upstream v0.20.0, to fix some issues with finding existing libs/headers
-
 # Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
 # Spack Project Developers. See the top-level COPYRIGHT file for details.
 #
@@ -14,6 +12,8 @@ class Sbml(CMakePackage):
     homepage = "https://sbml.org"
     maintainers("rblake-llnl")
 
+    license("LGPL-2.1-or-later")
+
     # begin EBRAINS (added): add version
     version("5.19.0", sha256="a7f0e18be78ff0e064e4cdb1cd86634d08bc33be5250db4a1878bd81eeb8b547")
     # end EBRAINS
diff --git a/packages/simpletraj/package.py b/packages/simpletraj/package.py
deleted file mode 100644
index be6fc871be4a6bec77e76a457b54a6f4f722a9c8..0000000000000000000000000000000000000000
--- a/packages/simpletraj/package.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack import *
-
-class Simpletraj(PythonPackage):
-    """Lightweight coordinate-only trajectory reader based on code from GROMACS, MDAnalysis and VMD."""
-
-    # Homepage and download url
-    homepage = "https://github.com/arose/simpletraj"
-    git = 'https://github.com/arose/simpletraj.git'
-    url = 'https://github.com/arose/simpletraj/archive/refs/tags/v0.3.tar.gz'
-
-    # Set the gitlab accounts of this package maintainers
-    maintainers = ['dbeltran']
-
-    # Versions
-    version('master', branch='master')
-    version('0.3', sha256='9ee9b5f3e387f8f8eb74b11f5c5d60bab6f601d190b40e38a7b31afddc3574d0')
-
-    # Dependencies
-    depends_on('python@3.8:', type=('build', 'run'))
-    depends_on('py-setuptools')
-    depends_on('py-numpy')
-
-    # Test
-    @run_after('install')
-    @on_package_attributes(run_tests=True)
-    def check_install (self):
-        python("-c", 'import simpletraj')
diff --git a/packages/sleef/package.py b/packages/sleef/package.py
deleted file mode 100644
index 796219df27f2e164c2bd3479dbc864ef453b3117..0000000000000000000000000000000000000000
--- a/packages/sleef/package.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack.package import *
-
-
-class Sleef(CMakePackage):
-    """SIMD Library for Evaluating Elementary Functions, vectorized libm and DFT."""
-
-    homepage = "https://sleef.org"
-    url = "https://github.com/shibatch/sleef/archive/3.2.tar.gz"
-    git = "https://github.com/shibatch/sleef.git"
-
-    version("master", branch="master")
-    version("3.5.1_2020-12-22", commit="e0a003ee838b75d11763aa9c3ef17bf71a725bff")  # py-torch@1.8:
-    version(
-        "3.5.1",
-        sha256="415ee9b1bcc5816989d3d4d92afd0cd3f9ee89cbd5a33eb008e69751e40438ab",
-        preferred=True,
-    )
-    version(
-        "3.4.0_2019-07-30", commit="7f523de651585fe25cade462efccca647dcc8d02"
-    )  # py-torch@1.3:1.7
-    version(
-        "3.4.0_2019-05-13",
-        commit="9b249c53a80343cc1a394ca961d7d5696ea76409",  # py-torch@1.2
-        git="https://github.com/zdevito/sleef.git",
-    )
-    version(
-        "3.3.1_2018-12-09",
-        commit="191f655caa25526ae226cf88dd2529265176014a",  # py-torch@1.1
-        git="https://github.com/zdevito/sleef.git",
-    )
-    version(
-        "3.2_2018-05-09", commit="6ff7a135a1e31979d1e1844a2e7171dfbd34f54f"
-    )  # py-torch@0.4.1:1.0
-    version("3.2", sha256="3130c5966e204e6d6a3ace81e543d12b5b21f60897f1c185bfa587c1bd77bee2")
-
-    # https://github.com/shibatch/sleef/issues/474
-    conflicts("%apple-clang@15:")
-
-    generator("ninja")
-    depends_on("cmake@3.4.3:", type="build")
-
-    # # https://github.com/shibatch/sleef/issues/475
-    # depends_on("fftw-api")
-    # depends_on("mpfr")
-    # depends_on("openssl")
-
-    # # https://github.com/shibatch/sleef/issues/458
-    # conflicts("^mpfr@4.2:")
-
-    # begin EBRAINS (modified): removed "disable shared lib build" to fix py-torch
-    #                           this was fixed upstream in 8c061e51.
-    def cmake_args(self):
-        # https://salsa.debian.org/science-team/sleef/-/blob/master/debian/rules
-        return [
-            self.define("BUILD_DFT", False),
-            self.define("BUILD_TESTS", False),
-        ]
-    # end EBRAINS
diff --git a/packages/wf-biobb/package.py b/packages/wf-biobb/package.py
index dbcd5b177d4c64f337c8cb133c658db909f423a5..28ff7c410ab8693c1cf4b77ef821e3ce0090be6f 100644
--- a/packages/wf-biobb/package.py
+++ b/packages/wf-biobb/package.py
@@ -16,5 +16,5 @@ class WfBiobb(BundlePackage):
     version("0.1")
 
     depends_on("py-plotly")
-    depends_on("nglview")
-    depends_on("simpletraj")
+    depends_on("py-nglview")
+    depends_on("py-simpletraj")
diff --git a/packages/xcb-proto/package.py b/packages/xcb-proto/package.py
index ea7c6a7ac07e5961cc27a19ef5e56ee357c5ebdd..9cd5dc608d0072c110ffc12eef10b37b4491f95f 100644
--- a/packages/xcb-proto/package.py
+++ b/packages/xcb-proto/package.py
@@ -13,6 +13,11 @@ class XcbProto(AutotoolsPackage):
     homepage = "https://xcb.freedesktop.org/"
     url = "https://xorg.freedesktop.org/archive/individual/proto/xcb-proto-1.14.1.tar.xz"
 
+    license("MIT")
+
+    maintainers("wdconinc")
+
+    version("1.16.0", sha256="a75a1848ad2a89a82d841a51be56ce988ff3c63a8d6bf4383ae3219d8d915119")
     version("1.15.2", sha256="7072beb1f680a2fe3f9e535b797c146d22528990c72f63ddb49d2f350a3653ed")
     version("1.14.1", sha256="f04add9a972ac334ea11d9d7eb4fc7f8883835da3e4859c9afa971efdf57fcc3")
     version("1.14", sha256="186a3ceb26f9b4a015f5a44dcc814c93033a5fc39684f36f1ecc79834416a605")
@@ -32,4 +37,4 @@ class XcbProto(AutotoolsPackage):
         else:
             url = "http://xcb.freedesktop.org/dist/xcb-proto-{0}.tar.gz"
 
-        return url.format(version)
\ No newline at end of file
+        return url.format(version)
diff --git a/packages/xcb-proto/xcb-proto-1.12-schema-1.patch b/packages/xcb-proto/xcb-proto-1.12-schema-1.patch
index 932889368bf6ffcd7adb9ea4b124c7aef29dfbc2..2a0b69255c4e6d8b91280c36cfb594b73586c514 100644
--- a/packages/xcb-proto/xcb-proto-1.12-schema-1.patch
+++ b/packages/xcb-proto/xcb-proto-1.12-schema-1.patch
@@ -49,3 +49,4 @@ Description: Fixes make check
    </xsd:group>
  
 
+