public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/arbor] f45: feat: update to 0.12.2
@ 2026-08-19  9:16 Ankur Sinha
  0 siblings, 0 replies; only message in thread
From: Ankur Sinha @ 2026-08-19  9:16 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/arbor
            Branch : f45
            Commit : bc6c0bc72d33e577707fd780fdbb6392f0677566
            Author : Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com>
            Date   : 2026-08-18T16:05:32+01:00
            Stats  : +1386/-182 in 13 file(s)
            URL    : https://src.fedoraproject.org/rpms/arbor/c/bc6c0bc72d33e577707fd780fdbb6392f0677566?branch=f45

            Log:
            feat: update to 0.12.2

- Fixes rhbz#2485689
- Fixes rhbz#2503775
- Fixes rhbz#2433869
- Fixes rhbz#2383223
- Fixes rhbz#2303868

Assisted-by: opencode (DeepSeek V4 Flash)

---
diff --git a/.gitignore b/.gitignore
index 91a7093..c4a47cf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,6 @@
 /arbor-0.6.tar.gz
 /arbor-0.7.tar.gz
 /arbor-0.9.0.tar.gz
+/arbor-0.12.2.tar.gz
+/tinyopt-7e6d707.tar.gz
+/unordered_dense-4.5.0.tar.gz

diff --git a/0001-Fix-a-few-typos-that-cause-failure-to-compile-with-G.patch b/0001-Fix-a-few-typos-that-cause-failure-to-compile-with-G.patch
deleted file mode 100644
index d337a29..0000000
--- a/0001-Fix-a-few-typos-that-cause-failure-to-compile-with-G.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 8880ff435f69b515a57e60e8b7434dad9e47847e Mon Sep 17 00:00:00 2001
-From: "Benjamin A. Beasley" <code@musicinmybrain.net>
-Date: Thu, 16 Jan 2025 09:49:20 -0500
-Subject: [PATCH] Fix a few typos that cause failure to compile with GCC 15
-
-These were eventually included in
-76120d16c00ae67128c3c69421ab712f985f3445, along with many other changes.
----
- arbor/include/arbor/util/expected.hpp | 2 +-
- python/strprintf.hpp                  | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/arbor/include/arbor/util/expected.hpp b/arbor/include/arbor/util/expected.hpp
-index 9d860f65..1af88eb4 100644
---- a/arbor/include/arbor/util/expected.hpp
-+++ b/arbor/include/arbor/util/expected.hpp
-@@ -486,7 +486,7 @@ struct expected<void, E> {
-     // Swap ops.
- 
-     void swap(expected& other) {
--        data_.swap(other.data);
-+        data_.swap(other.data_);
-     }
- 
-     // Accessors.
-diff --git a/python/strprintf.hpp b/python/strprintf.hpp
-index 63801677..2ccf12c1 100644
---- a/python/strprintf.hpp
-+++ b/python/strprintf.hpp
-@@ -168,7 +168,7 @@ namespace impl {
-             for (auto& x: s.seq_) {
-                 if (!first) o << s.sep_;
-                 first = false;
--                o << s.f(x);
-+                o << s.f_(x);
-             }
-             return o;
-         }
--- 
-2.47.1
-

diff --git a/0001-Use-vendored-tinyopt-and-unordered_dense.patch b/0001-Use-vendored-tinyopt-and-unordered_dense.patch
new file mode 100644
index 0000000..04cd81b
--- /dev/null
+++ b/0001-Use-vendored-tinyopt-and-unordered_dense.patch
@@ -0,0 +1,47 @@
+From aac8393d9aa9d255d19242c1792d8be9433f4247 Mon Sep 17 00:00:00 2001
+From: "Ankur Sinha (Ankur Sinha Gmail)" <sanjay.ankur@gmail.com>
+Date: Tue, 18 Aug 2026 11:42:02 +0100
+Subject: [PATCH] Use vendored tinyopt and unordered_dense instead of CPM
+ downloads
+
+tinyopt and unordered_dense are header-only libraries that are not
+packaged in Fedora. CPM would download them from GitHub at configure
+time, which fails in the offline buildroot. Use the copies vendored
+under ext/ instead.
+---
+ CMakeLists.txt | 17 ++---------------
+ 1 file changed, 2 insertions(+), 15 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f0d229ca..5da823e7 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -399,23 +399,10 @@ if(units_ADDED)
+ endif()
+ list(APPEND arbor_export_dependencies units)
+ 
+-CPMFindPackage(NAME unordered_dense
+-               GITHUB_REPOSITORY martinus/unordered_dense
+-               VERSION 4.5.0
+-               SYSTEM YES
+-               EXCLUDE_FROM_ALL YES)
+-
+-CPMFindPackage(NAME tinyopt
+-               GITHUB_REPOSITORY halfflat/tinyopt
+-               GIT_TAG 7e6d707d49c6cb4be27ebd253856be65293288df
+-               DOWNLOAD_ONLY YES)
++set(unordered_dense_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/unordered_dense)
+ 
+ add_library(ext-tinyopt INTERFACE)
+-if(tinyopt_ADDED)
+-  target_include_directories(ext-tinyopt INTERFACE $<BUILD_INTERFACE:${tinyopt_SOURCE_DIR}/include>)
+-else()
+-    message(FATAL_ERROR "Could not obtain tinyopt.")
+-endif()
++target_include_directories(ext-tinyopt INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/ext/tinyopt/include>)
+ 
+ # hide all internal vars
+ mark_as_advanced(FORCE benchmark_DIR BENCHMARK_BUILD_32_BITS BENCHMARK_DOWNLOAD_DEPENDENCIES BENCHMARK_ENABLE_ASSEMBLY_TESTS BENCHMARK_ENABLE_DOXYGEN BENCHMARK_ENABLE_EXCEPTIONS BENCHMARK_ENABLE_GTEST_TESTS BENCHMARK_ENABLE_INSTALL BENCHMARK_ENABLE_LIBPFM BENCHMARK_ENABLE_LTO BENCHMARK_ENABLE_WERROR BENCHMARK_FORCE_WERROR BENCHMARK_INSTALL_DOCS BENCHMARK_USE_BUNDLED_GTEST BENCHMARK_USE_LIBCXX)
+-- 
+2.55.0
+

diff --git a/0002-Use-system-Random123.patch b/0002-Use-system-Random123.patch
new file mode 100644
index 0000000..8eb8318
--- /dev/null
+++ b/0002-Use-system-Random123.patch
@@ -0,0 +1,39 @@
+From 69f8970cb9748a9f4f79128a2c4bef54ca29d1fc Mon Sep 17 00:00:00 2001
+From: "Ankur Sinha (Ankur Sinha Gmail)" <sanjay.ankur@gmail.com>
+Date: Tue, 18 Aug 2026 12:47:01 +0100
+Subject: [PATCH] Use system Random123 instead of CPM download
+
+find_package(random123) in CPM fails because the shipped FindRandom123.cmake
+module is only found for the capitalised name, so CPM tries to download the
+library from GitHub at configure time, which fails in the offline buildroot.
+Use find_package(Random123) directly instead.
+---
+ CMakeLists.txt | 11 ++---------
+ 1 file changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5da823e7..dee888be 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -317,16 +317,9 @@ if(nlohmann_json_ADDED)
+ endif()
+ 
+ 
++find_package(Random123 REQUIRED)
+ add_library(ext-random123 INTERFACE)
+-CPMFindPackage(NAME random123
+-               DOWNLOAD_ONLY YES
+-               GITHUB_REPOSITORY DEShawResearch/random123
+-               VERSION 1.14.0)
+-if(random123_ADDED)
+-    target_include_directories(ext-random123 INTERFACE $<BUILD_INTERFACE:${random123_SOURCE_DIR}/include>)
+-else()
+-    target_include_directories(ext-random123 INTERFACE ${RANDOM123_INCLUDE_DIR})
+-endif()
++target_include_directories(ext-random123 INTERFACE ${RANDOM123_INCLUDE_DIR})
+ install(TARGETS ext-random123 EXPORT arbor-targets)
+ 
+ if (ARB_WITH_PYTHON)
+-- 
+2.55.0
+

diff --git a/0003-Use-system-GTest.patch b/0003-Use-system-GTest.patch
new file mode 100644
index 0000000..cbbc4fd
--- /dev/null
+++ b/0003-Use-system-GTest.patch
@@ -0,0 +1,44 @@
+From d97a1bd98775129f0982fe40905f6502e450bfd5 Mon Sep 17 00:00:00 2001
+From: "Ankur Sinha (Ankur Sinha Gmail)" <sanjay.ankur@gmail.com>
+Date: Tue, 18 Aug 2026 12:47:09 +0100
+Subject: [PATCH] Use system GTest instead of CPM download
+
+The gtest-devel package only provides a GTestConfig.cmake, so
+find_package(googletest) in CPM fails and it tries to download googletest from
+GitHub at configure time, which fails in the offline buildroot. Use
+find_package(GTest) directly and link against the GTest::gtest imported
+targets instead.
+---
+ CMakeLists.txt | 11 ++---------
+ 1 file changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index dee888be..cef4f4a2 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -357,20 +357,13 @@ if (BUILD_TESTING)
+                   GITHUB_REPOSITORY google/benchmark
+                   VERSION 1.8.3
+                   OPTIONS "BENCHMARK_ENABLE_TESTING OFF" "CMAKE_BUILD_TYPE release" "BUILD_SHARED_LIBS OFF")
+-    CPMFindPackage(NAME googletest
+-                  GITHUB_REPOSITORY google/googletest
+-                  VERSION 1.17.0
+-                  OPTIONS "INSTALL_GTEST OFF" "BUILD_GMOCK OFF")
++    find_package(GTest REQUIRED)
+     if(benchmark_ADDED)
+         target_link_libraries(ext-bench INTERFACE benchmark)
+     else()
+         target_link_libraries(ext-bench INTERFACE benchmark::benchmark)
+     endif()
+-    if(googletest_ADDED)
+-        target_link_libraries(ext-gtest INTERFACE )
+-    else()
+-        target_link_libraries(ext-gtest INTERFACE gtest gtest_main)
+-    endif()
++    target_link_libraries(ext-gtest INTERFACE GTest::gtest GTest::gtest_main)
+ endif()
+ 
+ CPMFindPackage(NAME units
+-- 
+2.55.0
+

diff --git a/0004-Add-missing-standard-includes-to-profiler.patch b/0004-Add-missing-standard-includes-to-profiler.patch
new file mode 100644
index 0000000..d38b583
--- /dev/null
+++ b/0004-Add-missing-standard-includes-to-profiler.patch
@@ -0,0 +1,30 @@
+From f5d962987096637591bda0f78d6cb562396e217e Mon Sep 17 00:00:00 2001
+From: "Ankur Sinha (Ankur Sinha Gmail)" <sanjay.ankur@gmail.com>
+Date: Tue, 18 Aug 2026 13:02:47 +0100
+Subject: [PATCH] Add missing standard includes to profiler.hpp
+
+The header uses std::size_t, std::uint32_t and std::string but did not
+include <cstddef>, <cstdint> and <string>. This fails to compile with GCC 16
+when the types are not pulled in transitively, e.g. for the OpenMPI build of
+arbor/communication/mpi.cpp.
+---
+ arbor/include/arbor/profile/profiler.hpp | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/arbor/include/arbor/profile/profiler.hpp b/arbor/include/arbor/profile/profiler.hpp
+index 15e0a176..4e4f9097 100644
+--- a/arbor/include/arbor/profile/profiler.hpp
++++ b/arbor/include/arbor/profile/profiler.hpp
+@@ -1,6 +1,9 @@
+ #pragma once
+ 
++#include <cstddef>
++#include <cstdint>
+ #include <ostream>
++#include <string>
+ #include <vector>
+ 
+ #include <arbor/export.hpp>
+-- 
+2.55.0
+

diff --git a/CPM_0.39.0.cmake b/CPM_0.39.0.cmake
new file mode 100644
index 0000000..a01fc25
--- /dev/null
+++ b/CPM_0.39.0.cmake
@@ -0,0 +1,1159 @@
+# CPM.cmake - CMake's missing package manager
+# ===========================================
+# See https://github.com/cpm-cmake/CPM.cmake for usage and update instructions.
+#
+# MIT License
+# -----------
+#[[
+  Copyright (c) 2019-2023 Lars Melchior and contributors
+
+  Permission is hereby granted, free of charge, to any person obtaining a copy
+  of this software and associated documentation files (the "Software"), to deal
+  in the Software without restriction, including without limitation the rights
+  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+  copies of the Software, and to permit persons to whom the Software is
+  furnished to do so, subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be included in all
+  copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+  SOFTWARE.
+]]
+
+cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
+
+# Initialize logging prefix
+if(NOT CPM_INDENT)
+  set(CPM_INDENT
+      "CPM:"
+      CACHE INTERNAL ""
+  )
+endif()
+
+if(NOT COMMAND cpm_message)
+  function(cpm_message)
+    message(${ARGV})
+  endfunction()
+endif()
+
+set(CURRENT_CPM_VERSION 1.0.0-development-version)
+
+get_filename_component(CPM_CURRENT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
+if(CPM_DIRECTORY)
+  if(NOT CPM_DIRECTORY STREQUAL CPM_CURRENT_DIRECTORY)
+    if(CPM_VERSION VERSION_LESS CURRENT_CPM_VERSION)
+      message(
+        AUTHOR_WARNING
+          "${CPM_INDENT} \
+A dependency is using a more recent CPM version (${CURRENT_CPM_VERSION}) than the current project (${CPM_VERSION}). \
+It is recommended to upgrade CPM to the most recent version. \
+See https://github.com/cpm-cmake/CPM.cmake for more information."
+      )
+    endif()
+    if(${CMAKE_VERSION} VERSION_LESS "3.17.0")
+      include(FetchContent)
+    endif()
+    return()
+  endif()
+
+  get_property(
+    CPM_INITIALIZED GLOBAL ""
+    PROPERTY CPM_INITIALIZED
+    SET
+  )
+  if(CPM_INITIALIZED)
+    return()
+  endif()
+endif()
+
+if(CURRENT_CPM_VERSION MATCHES "development-version")
+  message(
+    WARNING "${CPM_INDENT} Your project is using an unstable development version of CPM.cmake. \
+Please update to a recent release if possible. \
+See https://github.com/cpm-cmake/CPM.cmake for details."
+  )
+endif()
+
+set_property(GLOBAL PROPERTY CPM_INITIALIZED true)
+
+macro(cpm_set_policies)
+  # the policy allows us to change options without caching
+  cmake_policy(SET CMP0077 NEW)
+  set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
+
+  # the policy allows us to change set(CACHE) without caching
+  if(POLICY CMP0126)
+    cmake_policy(SET CMP0126 NEW)
+    set(CMAKE_POLICY_DEFAULT_CMP0126 NEW)
+  endif()
+
+  # The policy uses the download time for timestamp, instead of the timestamp in the archive. This
+  # allows for proper rebuilds when a projects url changes
+  if(POLICY CMP0135)
+    cmake_policy(SET CMP0135 NEW)
+    set(CMAKE_POLICY_DEFAULT_CMP0135 NEW)
+  endif()
+
+  # treat relative git repository paths as being relative to the parent project's remote
+  if(POLICY CMP0150)
+    cmake_policy(SET CMP0150 NEW)
+    set(CMAKE_POLICY_DEFAULT_CMP0150 NEW)
+  endif()
+endmacro()
+cpm_set_policies()
+
+option(CPM_USE_LOCAL_PACKAGES "Always try to use `find_package` to get dependencies"
+       $ENV{CPM_USE_LOCAL_PACKAGES}
+)
+option(CPM_LOCAL_PACKAGES_ONLY "Only use `find_package` to get dependencies"
+       $ENV{CPM_LOCAL_PACKAGES_ONLY}
+)
+option(CPM_DOWNLOAD_ALL "Always download dependencies from source" $ENV{CPM_DOWNLOAD_ALL})
+option(CPM_DONT_UPDATE_MODULE_PATH "Don't update the module path to allow using find_package"
+       $ENV{CPM_DONT_UPDATE_MODULE_PATH}
+)
+option(CPM_DONT_CREATE_PACKAGE_LOCK "Don't create a package lock file in the binary path"
+       $ENV{CPM_DONT_CREATE_PACKAGE_LOCK}
+)
+option(CPM_INCLUDE_ALL_IN_PACKAGE_LOCK
+       "Add all packages added through CPM.cmake to the package lock"
+       $ENV{CPM_INCLUDE_ALL_IN_PACKAGE_LOCK}
+)
+option(CPM_USE_NAMED_CACHE_DIRECTORIES
+       "Use additional directory of package name in cache on the most nested level."
+       $ENV{CPM_USE_NAMED_CACHE_DIRECTORIES}
+)
+
+set(CPM_VERSION
+    ${CURRENT_CPM_VERSION}
+    CACHE INTERNAL ""
+)
+set(CPM_DIRECTORY
+    ${CPM_CURRENT_DIRECTORY}
+    CACHE INTERNAL ""
+)
+set(CPM_FILE
+    ${CMAKE_CURRENT_LIST_FILE}
+    CACHE INTERNAL ""
+)
+set(CPM_PACKAGES
+    ""
+    CACHE INTERNAL ""
+)
+set(CPM_DRY_RUN
+    OFF
+    CACHE INTERNAL "Don't download or configure dependencies (for testing)"
+)
+
+if(DEFINED ENV{CPM_SOURCE_CACHE})
+  set(CPM_SOURCE_CACHE_DEFAULT $ENV{CPM_SOURCE_CACHE})
+else()
+  set(CPM_SOURCE_CACHE_DEFAULT OFF)
+endif()
+
+set(CPM_SOURCE_CACHE
+    ${CPM_SOURCE_CACHE_DEFAULT}
+    CACHE PATH "Directory to download CPM dependencies"
+)
+
+if(NOT CPM_DONT_UPDATE_MODULE_PATH)
+  set(CPM_MODULE_PATH
+      "${CMAKE_BINARY_DIR}/CPM_modules"
+      CACHE INTERNAL ""
+  )
+  # remove old modules
+  file(REMOVE_RECURSE ${CPM_MODULE_PATH})
+  file(MAKE_DIRECTORY ${CPM_MODULE_PATH})
+  # locally added CPM modules should override global packages
+  set(CMAKE_MODULE_PATH "${CPM_MODULE_PATH};${CMAKE_MODULE_PATH}")
+endif()
+
+if(NOT CPM_DONT_CREATE_PACKAGE_LOCK)
+  set(CPM_PACKAGE_LOCK_FILE
+      "${CMAKE_BINARY_DIR}/cpm-package-lock.cmake"
+      CACHE INTERNAL ""
+  )
+  file(WRITE ${CPM_PACKAGE_LOCK_FILE}
+       "# CPM Package Lock\n# This file should be committed to version control\n\n"
+  )
+endif()
+
+include(FetchContent)
+
+# Try to infer package name from git repository uri (path or url)
+function(cpm_package_name_from_git_uri URI RESULT)
+  if("${URI}" MATCHES "([^/:]+)/?.git/?$")
+    set(${RESULT}
+        ${CMAKE_MATCH_1}
+        PARENT_SCOPE
+    )
+  else()
+    unset(${RESULT} PARENT_SCOPE)
+  endif()
+endfunction()
+
+# Try to infer package name and version from a url
+function(cpm_package_name_and_ver_from_url url outName outVer)
+  if(url MATCHES "[/\\?]([a-zA-Z0-9_\\.-]+)\\.(tar|tar\\.gz|tar\\.bz2|zip|ZIP)(\\?|/|$)")
+    # We matched an archive
+    set(filename "${CMAKE_MATCH_1}")
+
+    if(filename MATCHES "([a-zA-Z0-9_\\.-]+)[_-]v?(([0-9]+\\.)*[0-9]+[a-zA-Z0-9]*)")
+      # We matched <name>-<version> (ie foo-1.2.3)
+      set(${outName}
+          "${CMAKE_MATCH_1}"
+          PARENT_SCOPE
+      )
+      set(${outVer}
+          "${CMAKE_MATCH_2}"
+          PARENT_SCOPE
+      )
+    elseif(filename MATCHES "(([0-9]+\\.)+[0-9]+[a-zA-Z0-9]*)")
+      # We couldn't find a name, but we found a version
+      #
+      # In many cases (which we don't handle here) the url would look something like
+      # `irrelevant/ACTUAL_PACKAGE_NAME/irrelevant/1.2.3.zip`. In such a case we can't possibly
+      # distinguish the package name from the irrelevant bits. Moreover if we try to match the
+      # package name from the filename, we'd get bogus at best.
+      unset(${outName} PARENT_SCOPE)
+      set(${outVer}
+          "${CMAKE_MATCH_1}"
+          PARENT_SCOPE
+      )
+    else()
+      # Boldly assume that the file name is the package name.
+      #
+      # Yes, something like `irrelevant/ACTUAL_NAME/irrelevant/download.zip` will ruin our day, but
+      # such cases should be quite rare. No popular service does this... we think.
+      set(${outName}
+          "${filename}"
+          PARENT_SCOPE
+      )
+      unset(${outVer} PARENT_SCOPE)
+    endif()
+  else()
+    # No ideas yet what to do with non-archives
+    unset(${outName} PARENT_SCOPE)
+    unset(${outVer} PARENT_SCOPE)
+  endif()
+endfunction()
+
+function(cpm_find_package NAME VERSION)
+  string(REPLACE " " ";" EXTRA_ARGS "${ARGN}")
+  find_package(${NAME} ${VERSION} ${EXTRA_ARGS} QUIET)
+  if(${CPM_ARGS_NAME}_FOUND)
+    if(DEFINED ${CPM_ARGS_NAME}_VERSION)
+      set(VERSION ${${CPM_ARGS_NAME}_VERSION})
+    endif()
+    cpm_message(STATUS "${CPM_INDENT} Using local package ${CPM_ARGS_NAME}@${VERSION}")
+    CPMRegisterPackage(${CPM_ARGS_NAME} "${VERSION}")
+    set(CPM_PACKAGE_FOUND
+        YES
+        PARENT_SCOPE
+    )
+  else()
+    set(CPM_PACKAGE_FOUND
+        NO
+        PARENT_SCOPE
+    )
+  endif()
+endfunction()
+
+# Create a custom FindXXX.cmake module for a CPM package This prevents `find_package(NAME)` from
+# finding the system library
+function(cpm_create_module_file Name)
+  if(NOT CPM_DONT_UPDATE_MODULE_PATH)
+    # erase any previous modules
+    file(WRITE ${CPM_MODULE_PATH}/Find${Name}.cmake
+         "include(\"${CPM_FILE}\")\n${ARGN}\nset(${Name}_FOUND TRUE)"
+    )
+  endif()
+endfunction()
+
+# Find a package locally or fallback to CPMAddPackage
+function(CPMFindPackage)
+  set(oneValueArgs NAME VERSION GIT_TAG FIND_PACKAGE_ARGUMENTS)
+
+  cmake_parse_arguments(CPM_ARGS "" "${oneValueArgs}" "" ${ARGN})
+
+  if(NOT DEFINED CPM_ARGS_VERSION)
+    if(DEFINED CPM_ARGS_GIT_TAG)
+      cpm_get_version_from_git_tag("${CPM_ARGS_GIT_TAG}" CPM_ARGS_VERSION)
+    endif()
+  endif()
+
+  set(downloadPackage ${CPM_DOWNLOAD_ALL})
+  if(DEFINED CPM_DOWNLOAD_${CPM_ARGS_NAME})
+    set(downloadPackage ${CPM_DOWNLOAD_${CPM_ARGS_NAME}})
+  elseif(DEFINED ENV{CPM_DOWNLOAD_${CPM_ARGS_NAME}})
+    set(downloadPackage $ENV{CPM_DOWNLOAD_${CPM_ARGS_NAME}})
+  endif()
+  if(downloadPackage)
+    CPMAddPackage(${ARGN})
+    cpm_export_variables(${CPM_ARGS_NAME})
+    return()
+  endif()
+
+  cpm_find_package(${CPM_ARGS_NAME} "${CPM_ARGS_VERSION}" ${CPM_ARGS_FIND_PACKAGE_ARGUMENTS})
+
+  if(NOT CPM_PACKAGE_FOUND)
+    CPMAddPackage(${ARGN})
+    cpm_export_variables(${CPM_ARGS_NAME})
+  endif()
+
+endfunction()
+
+# checks if a package has been added before
+function(cpm_check_if_package_already_added CPM_ARGS_NAME CPM_ARGS_VERSION)
+  if("${CPM_ARGS_NAME}" IN_LIST CPM_PACKAGES)
+    CPMGetPackageVersion(${CPM_ARGS_NAME} CPM_PACKAGE_VERSION)
+    if("${CPM_PACKAGE_VERSION}" VERSION_LESS "${CPM_ARGS_VERSION}")
+      message(
+        WARNING
+          "${CPM_INDENT} Requires a newer version of ${CPM_ARGS_NAME} (${CPM_ARGS_VERSION}) than currently included (${CPM_PACKAGE_VERSION})."
+      )
+    endif()
+    cpm_get_fetch_properties(${CPM_ARGS_NAME})
+    set(${CPM_ARGS_NAME}_ADDED NO)
+    set(CPM_PACKAGE_ALREADY_ADDED
+        YES
+        PARENT_SCOPE
+    )
+    cpm_export_variables(${CPM_ARGS_NAME})
+  else()
+    set(CPM_PACKAGE_ALREADY_ADDED
+        NO
+        PARENT_SCOPE
+    )
+  endif()
+endfunction()
+
+# Parse the argument of CPMAddPackage in case a single one was provided and convert it to a list of
+# arguments which can then be parsed idiomatically. For example gh:foo/bar@1.2.3 will be converted
+# to: GITHUB_REPOSITORY;foo/bar;VERSION;1.2.3
+function(cpm_parse_add_package_single_arg arg outArgs)
+  # Look for a scheme
+  if("${arg}" MATCHES "^([a-zA-Z]+):(.+)$")
+    string(TOLOWER "${CMAKE_MATCH_1}" scheme)
+    set(uri "${CMAKE_MATCH_2}")
+
+    # Check for CPM-specific schemes
+    if(scheme STREQUAL "gh")
+      set(out "GITHUB_REPOSITORY;${uri}")
+      set(packageType "git")
+    elseif(scheme STREQUAL "gl")
+      set(out "GITLAB_REPOSITORY;${uri}")
+      set(packageType "git")
+    elseif(scheme STREQUAL "bb")
+      set(out "BITBUCKET_REPOSITORY;${uri}")
+      set(packageType "git")
+      # A CPM-specific scheme was not found. Looks like this is a generic URL so try to determine
+      # type
+    elseif(arg MATCHES ".git/?(@|#|$)")
+      set(out "GIT_REPOSITORY;${arg}")
+      set(packageType "git")
+    else()
+      # Fall back to a URL
+      set(out "URL;${arg}")
+      set(packageType "archive")
+
+      # We could also check for SVN since FetchContent supports it, but SVN is so rare these days.
+      # We just won't bother with the additional complexity it will induce in this function. SVN is
+      # done by multi-arg
+    endif()
+  else()
+    if(arg MATCHES ".git/?(@|#|$)")
+      set(out "GIT_REPOSITORY;${arg}")
+      set(packageType "git")
+    else()
+      # Give up
+      message(FATAL_ERROR "${CPM_INDENT} Can't determine package type of '${arg}'")
+    endif()
+  endif()
+
+  # For all packages we interpret @... as version. Only replace the last occurrence. Thus URIs
+  # containing '@' can be used
+  string(REGEX REPLACE "@([^@]+)$" ";VERSION;\\1" out "${out}")
+
+  # Parse the rest according to package type
+  if(packageType STREQUAL "git")
+    # For git repos we interpret #... as a tag or branch or commit hash
+    string(REGEX REPLACE "#([^#]+)$" ";GIT_TAG;\\1" out "${out}")
+  elseif(packageType STREQUAL "archive")
+    # For archives we interpret #... as a URL hash.
+    string(REGEX REPLACE "#([^#]+)$" ";URL_HASH;\\1" out "${out}")
+    # We don't try to parse the version if it's not provided explicitly. cpm_get_version_from_url
+    # should do this at a later point
+  else()
+    # We should never get here. This is an assertion and hitting it means there's a bug in the code
+    # above. A packageType was set, but not handled by this if-else.
+    message(FATAL_ERROR "${CPM_INDENT} Unsupported package type '${packageType}' of '${arg}'")
+  endif()
+
+  set(${outArgs}
+      ${out}
+      PARENT_SCOPE
+  )
+endfunction()
+
+# Check that the working directory for a git repo is clean
+function(cpm_check_git_working_dir_is_clean repoPath gitTag isClean)
+
+  find_package(Git REQUIRED)
+
+  if(NOT GIT_EXECUTABLE)
+    # No git executable, assume directory is clean
+    set(${isClean}
+        TRUE
+        PARENT_SCOPE
+    )
+    return()
+  endif()
+
+  # check for uncommitted changes
+  execute_process(
+    COMMAND ${GIT_EXECUTABLE} status --porcelain
+    RESULT_VARIABLE resultGitStatus
+    OUTPUT_VARIABLE repoStatus
+    OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET
+    WORKING_DIRECTORY ${repoPath}
+  )
+  if(resultGitStatus)
+    # not supposed to happen, assume clean anyway
+    message(WARNING "${CPM_INDENT} Calling git status on folder ${repoPath} failed")
+    set(${isClean}
+        TRUE
+        PARENT_SCOPE
+    )
+    return()
+  endif()
+
+  if(NOT "${repoStatus}" STREQUAL "")
+    set(${isClean}
+        FALSE
+        PARENT_SCOPE
+    )
+    return()
+  endif()
+
+  # check for committed changes
+  execute_process(
+    COMMAND ${GIT_EXECUTABLE} diff -s --exit-code ${gitTag}
+    RESULT_VARIABLE resultGitDiff
+    OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_QUIET
+    WORKING_DIRECTORY ${repoPath}
+  )
+
+  if(${resultGitDiff} EQUAL 0)
+    set(${isClean}
+        TRUE
+        PARENT_SCOPE
+    )
+  else()
+    set(${isClean}
+        FALSE
+        PARENT_SCOPE
+    )
+  endif()
+
+endfunction()
+
+# method to overwrite internal FetchContent properties, to allow using CPM.cmake to overload
+# FetchContent calls. As these are internal cmake properties, this method should be used carefully
+# and may need modification in future CMake versions. Source:
+# https://github.com/Kitware/CMake/blob/dc3d0b5a0a7d26d43d6cfeb511e224533b5d188f/Modules/FetchContent.cmake#L1152
+function(cpm_override_fetchcontent contentName)
+  cmake_parse_arguments(PARSE_ARGV 1 arg "" "SOURCE_DIR;BINARY_DIR" "")
+  if(NOT "${arg_UNPARSED_ARGUMENTS}" STREQUAL "")
+    message(FATAL_ERROR "${CPM_INDENT} Unsupported arguments: ${arg_UNPARSED_ARGUMENTS}")
+  endif()
+
+  string(TOLOWER ${contentName} contentNameLower)
+  set(prefix "_FetchContent_${contentNameLower}")
+
+  set(propertyName "${prefix}_sourceDir")
+  define_property(
+    GLOBAL
+    PROPERTY ${propertyName}
+    BRIEF_DOCS "Internal implementation detail of FetchContent_Populate()"
+    FULL_DOCS "Details used by FetchContent_Populate() for ${contentName}"
+  )
+  set_property(GLOBAL PROPERTY ${propertyName} "${arg_SOURCE_DIR}")
+
+  set(propertyName "${prefix}_binaryDir")
+  define_property(
+    GLOBAL
+    PROPERTY ${propertyName}
+    BRIEF_DOCS "Internal implementation detail of FetchContent_Populate()"
+    FULL_DOCS "Details used by FetchContent_Populate() for ${contentName}"
+  )
+  set_property(GLOBAL PROPERTY ${propertyName} "${arg_BINARY_DIR}")
+
+  set(propertyName "${prefix}_populated")
+  define_property(
+    GLOBAL
+    PROPERTY ${propertyName}
+    BRIEF_DOCS "Internal implementation detail of FetchContent_Populate()"
+    FULL_DOCS "Details used by FetchContent_Populate() for ${contentName}"
+  )
+  set_property(GLOBAL PROPERTY ${propertyName} TRUE)
+endfunction()
+
+# Download and add a package from source
+function(CPMAddPackage)
+  cpm_set_policies()
+
+  list(LENGTH ARGN argnLength)
+  if(argnLength EQUAL 1)
+    cpm_parse_add_package_single_arg("${ARGN}" ARGN)
+
+    # The shorthand syntax implies EXCLUDE_FROM_ALL and SYSTEM
+    set(ARGN "${ARGN};EXCLUDE_FROM_ALL;YES;SYSTEM;YES;")
+  endif()
+
+  set(oneValueArgs
+      NAME
+      FORCE
+      VERSION
+      GIT_TAG
+      DOWNLOAD_ONLY
+      GITHUB_REPOSITORY
+      GITLAB_REPOSITORY
+      BITBUCKET_REPOSITORY
+      GIT_REPOSITORY
+      SOURCE_DIR
+      FIND_PACKAGE_ARGUMENTS
+      NO_CACHE
+      SYSTEM
+      GIT_SHALLOW
+      EXCLUDE_FROM_ALL
+      SOURCE_SUBDIR
+      CUSTOM_CACHE_KEY
+  )
+
+  set(multiValueArgs URL OPTIONS DOWNLOAD_COMMAND)
+
+  cmake_parse_arguments(CPM_ARGS "" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}")
+
+  # Set default values for arguments
+
+  if(NOT DEFINED CPM_ARGS_VERSION)
+    if(DEFINED CPM_ARGS_GIT_TAG)
+      cpm_get_version_from_git_tag("${CPM_ARGS_GIT_TAG}" CPM_ARGS_VERSION)
+    endif()
+  endif()
+
+  if(CPM_ARGS_DOWNLOAD_ONLY)
+    set(DOWNLOAD_ONLY ${CPM_ARGS_DOWNLOAD_ONLY})
+  else()
+    set(DOWNLOAD_ONLY NO)
+  endif()
+
+  if(DEFINED CPM_ARGS_GITHUB_REPOSITORY)
+    set(CPM_ARGS_GIT_REPOSITORY "https://github.com/${CPM_ARGS_GITHUB_REPOSITORY}.git")
+  elseif(DEFINED CPM_ARGS_GITLAB_REPOSITORY)
+    set(CPM_ARGS_GIT_REPOSITORY "https://gitlab.com/${CPM_ARGS_GITLAB_REPOSITORY}.git")
+  elseif(DEFINED CPM_ARGS_BITBUCKET_REPOSITORY)
+    set(CPM_ARGS_GIT_REPOSITORY "https://bitbucket.org/${CPM_ARGS_BITBUCKET_REPOSITORY}.git")
+  endif()
+
+  if(DEFINED CPM_ARGS_GIT_REPOSITORY)
+    list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS GIT_REPOSITORY ${CPM_ARGS_GIT_REPOSITORY})
+    if(NOT DEFINED CPM_ARGS_GIT_TAG)
+      set(CPM_ARGS_GIT_TAG v${CPM_ARGS_VERSION})
+    endif()
+
+    # If a name wasn't provided, try to infer it from the git repo
+    if(NOT DEFINED CPM_ARGS_NAME)
+      cpm_package_name_from_git_uri(${CPM_ARGS_GIT_REPOSITORY} CPM_ARGS_NAME)
+    endif()
+  endif()
+
+  set(CPM_SKIP_FETCH FALSE)
+
+  if(DEFINED CPM_ARGS_GIT_TAG)
+    list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS GIT_TAG ${CPM_ARGS_GIT_TAG})
+    # If GIT_SHALLOW is explicitly specified, honor the value.
+    if(DEFINED CPM_ARGS_GIT_SHALLOW)
+      list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS GIT_SHALLOW ${CPM_ARGS_GIT_SHALLOW})
+    endif()
+  endif()
+
+  if(DEFINED CPM_ARGS_URL)
+    # If a name or version aren't provided, try to infer them from the URL
+    list(GET CPM_ARGS_URL 0 firstUrl)
+    cpm_package_name_and_ver_from_url(${firstUrl} nameFromUrl verFromUrl)
+    # If we fail to obtain name and version from the first URL, we could try other URLs if any.
+    # However multiple URLs are expected to be quite rare, so for now we won't bother.
+
+    # If the caller provided their own name and version, they trump the inferred ones.
+    if(NOT DEFINED CPM_ARGS_NAME)
+      set(CPM_ARGS_NAME ${nameFromUrl})
+    endif()
+    if(NOT DEFINED CPM_ARGS_VERSION)
+      set(CPM_ARGS_VERSION ${verFromUrl})
+    endif()
+
+    list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS URL "${CPM_ARGS_URL}")
+  endif()
+
+  # Check for required arguments
+
+  if(NOT DEFINED CPM_ARGS_NAME)
+    message(
+      FATAL_ERROR
+        "${CPM_INDENT} 'NAME' was not provided and couldn't be automatically inferred for package added with arguments: '${ARGN}'"
+    )
+  endif()
+
+  # Check if package has been added before
+  cpm_check_if_package_already_added(${CPM_ARGS_NAME} "${CPM_ARGS_VERSION}")
+  if(CPM_PACKAGE_ALREADY_ADDED)
+    cpm_export_variables(${CPM_ARGS_NAME})
+    return()
+  endif()
+
+  # Check for manual overrides
+  if(NOT CPM_ARGS_FORCE AND NOT "${CPM_${CPM_ARGS_NAME}_SOURCE}" STREQUAL "")
+    set(PACKAGE_SOURCE ${CPM_${CPM_ARGS_NAME}_SOURCE})
+    set(CPM_${CPM_ARGS_NAME}_SOURCE "")
+    CPMAddPackage(
+      NAME "${CPM_ARGS_NAME}"
+      SOURCE_DIR "${PACKAGE_SOURCE}"
+      EXCLUDE_FROM_ALL "${CPM_ARGS_EXCLUDE_FROM_ALL}"
+      SYSTEM "${CPM_ARGS_SYSTEM}"
+      OPTIONS "${CPM_ARGS_OPTIONS}"
+      SOURCE_SUBDIR "${CPM_ARGS_SOURCE_SUBDIR}"
+      DOWNLOAD_ONLY "${DOWNLOAD_ONLY}"
+      FORCE True
+    )
+    cpm_export_variables(${CPM_ARGS_NAME})
+    return()
+  endif()
+
+  # Check for available declaration
+  if(NOT CPM_ARGS_FORCE AND NOT "${CPM_DECLARATION_${CPM_ARGS_NAME}}" STREQUAL "")
+    set(declaration ${CPM_DECLARATION_${CPM_ARGS_NAME}})
+    set(CPM_DECLARATION_${CPM_ARGS_NAME} "")
+    CPMAddPackage(${declaration})
+    cpm_export_variables(${CPM_ARGS_NAME})
+    # checking again to ensure version and option compatibility
+    cpm_check_if_package_already_added(${CPM_ARGS_NAME} "${CPM_ARGS_VERSION}")
+    return()
+  endif()
+
+  if(NOT CPM_ARGS_FORCE)
+    if(CPM_USE_LOCAL_PACKAGES OR CPM_LOCAL_PACKAGES_ONLY)
+      cpm_find_package(${CPM_ARGS_NAME} "${CPM_ARGS_VERSION}" ${CPM_ARGS_FIND_PACKAGE_ARGUMENTS})
+
+      if(CPM_PACKAGE_FOUND)
+        cpm_export_variables(${CPM_ARGS_NAME})
+        return()
+      endif()
+
+      if(CPM_LOCAL_PACKAGES_ONLY)
+        message(
+          SEND_ERROR
+            "${CPM_INDENT} ${CPM_ARGS_NAME} not found via find_package(${CPM_ARGS_NAME} ${CPM_ARGS_VERSION})"
+        )
+      endif()
+    endif()
+  endif()
+
+  CPMRegisterPackage("${CPM_ARGS_NAME}" "${CPM_ARGS_VERSION}")
+
+  if(DEFINED CPM_ARGS_GIT_TAG)
+    set(PACKAGE_INFO "${CPM_ARGS_GIT_TAG}")
+  elseif(DEFINED CPM_ARGS_SOURCE_DIR)
+    set(PACKAGE_INFO "${CPM_ARGS_SOURCE_DIR}")
+  else()
+    set(PACKAGE_INFO "${CPM_ARGS_VERSION}")
+  endif()
+
+  if(DEFINED FETCHCONTENT_BASE_DIR)
+    # respect user's FETCHCONTENT_BASE_DIR if set
+    set(CPM_FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR})
+  else()
+    set(CPM_FETCHCONTENT_BASE_DIR ${CMAKE_BINARY_DIR}/_deps)
+  endif()
+
+  if(DEFINED CPM_ARGS_DOWNLOAD_COMMAND)
+    list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS DOWNLOAD_COMMAND ${CPM_ARGS_DOWNLOAD_COMMAND})
+  elseif(DEFINED CPM_ARGS_SOURCE_DIR)
+    list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS SOURCE_DIR ${CPM_ARGS_SOURCE_DIR})
+    if(NOT IS_ABSOLUTE ${CPM_ARGS_SOURCE_DIR})
+      # Expand `CPM_ARGS_SOURCE_DIR` relative path. This is important because EXISTS doesn't work
+      # for relative paths.
+      get_filename_component(
+        source_directory ${CPM_ARGS_SOURCE_DIR} REALPATH BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}
+      )
+    else()
+      set(source_directory ${CPM_ARGS_SOURCE_DIR})
+    endif()
+    if(NOT EXISTS ${source_directory})
+      string(TOLOWER ${CPM_ARGS_NAME} lower_case_name)
+      # remove timestamps so CMake will re-download the dependency
+      file(REMOVE_RECURSE "${CPM_FETCHCONTENT_BASE_DIR}/${lower_case_name}-subbuild")
+    endif()
+  elseif(CPM_SOURCE_CACHE AND NOT CPM_ARGS_NO_CACHE)
+    string(TOLOWER ${CPM_ARGS_NAME} lower_case_name)
+    set(origin_parameters ${CPM_ARGS_UNPARSED_ARGUMENTS})
+    list(SORT origin_parameters)
+    if(CPM_ARGS_CUSTOM_CACHE_KEY)
+      # Application set a custom unique directory name
+      set(download_directory ${CPM_SOURCE_CACHE}/${lower_case_name}/${CPM_ARGS_CUSTOM_CACHE_KEY})
+    elseif(CPM_USE_NAMED_CACHE_DIRECTORIES)
+      string(SHA1 origin_hash "${origin_parameters};NEW_CACHE_STRUCTURE_TAG")
+      set(download_directory ${CPM_SOURCE_CACHE}/${lower_case_name}/${origin_hash}/${CPM_ARGS_NAME})
+    else()
+      string(SHA1 origin_hash "${origin_parameters}")
+      set(download_directory ${CPM_SOURCE_CACHE}/${lower_case_name}/${origin_hash})
+    endif()
+    # Expand `download_directory` relative path. This is important because EXISTS doesn't work for
+    # relative paths.
+    get_filename_component(download_directory ${download_directory} ABSOLUTE)
+    list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS SOURCE_DIR ${download_directory})
+
+    if(CPM_SOURCE_CACHE)
+      file(LOCK ${download_directory}/../cmake.lock)
+    endif()
+
+    if(EXISTS ${download_directory})
+      if(CPM_SOURCE_CACHE)
+        file(LOCK ${download_directory}/../cmake.lock RELEASE)
+      endif()
+
+      cpm_store_fetch_properties(
+        ${CPM_ARGS_NAME} "${download_directory}"
+        "${CPM_FETCHCONTENT_BASE_DIR}/${lower_case_name}-build"
+      )
+      cpm_get_fetch_properties("${CPM_ARGS_NAME}")
+
+      if(DEFINED CPM_ARGS_GIT_TAG AND NOT (PATCH_COMMAND IN_LIST CPM_ARGS_UNPARSED_ARGUMENTS))
+        # warn if cache has been changed since checkout
+        cpm_check_git_working_dir_is_clean(${download_directory} ${CPM_ARGS_GIT_TAG} IS_CLEAN)
+        if(NOT ${IS_CLEAN})
+          message(
+            WARNING "${CPM_INDENT} Cache for ${CPM_ARGS_NAME} (${download_directory}) is dirty"
+          )
+        endif()
+      endif()
+
+      cpm_add_subdirectory(
+        "${CPM_ARGS_NAME}"
+        "${DOWNLOAD_ONLY}"
+        "${${CPM_ARGS_NAME}_SOURCE_DIR}/${CPM_ARGS_SOURCE_SUBDIR}"
+        "${${CPM_ARGS_NAME}_BINARY_DIR}"
+        "${CPM_ARGS_EXCLUDE_FROM_ALL}"
+        "${CPM_ARGS_SYSTEM}"
+        "${CPM_ARGS_OPTIONS}"
+      )
+      set(PACKAGE_INFO "${PACKAGE_INFO} at ${download_directory}")
+
+      # As the source dir is already cached/populated, we override the call to FetchContent.
+      set(CPM_SKIP_FETCH TRUE)
+      cpm_override_fetchcontent(
+        "${lower_case_name}" SOURCE_DIR "${${CPM_ARGS_NAME}_SOURCE_DIR}/${CPM_ARGS_SOURCE_SUBDIR}"
+        BINARY_DIR "${${CPM_ARGS_NAME}_BINARY_DIR}"
+      )
+
+    else()
+      # Enable shallow clone when GIT_TAG is not a commit hash. Our guess may not be accurate, but
+      # it should guarantee no commit hash get mis-detected.
+      if(NOT DEFINED CPM_ARGS_GIT_SHALLOW)
+        cpm_is_git_tag_commit_hash("${CPM_ARGS_GIT_TAG}" IS_HASH)
+        if(NOT ${IS_HASH})
+          list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS GIT_SHALLOW TRUE)
+        endif()
+      endif()
+
+      # remove timestamps so CMake will re-download the dependency
+      file(REMOVE_RECURSE ${CPM_FETCHCONTENT_BASE_DIR}/${lower_case_name}-subbuild)
+      set(PACKAGE_INFO "${PACKAGE_INFO} to ${download_directory}")
+    endif()
+  endif()
+
+  cpm_create_module_file(${CPM_ARGS_NAME} "CPMAddPackage(\"${ARGN}\")")
+
+  if(CPM_PACKAGE_LOCK_ENABLED)
+    if((CPM_ARGS_VERSION AND NOT CPM_ARGS_SOURCE_DIR) OR CPM_INCLUDE_ALL_IN_PACKAGE_LOCK)
+      cpm_add_to_package_lock(${CPM_ARGS_NAME} "${ARGN}")
+    elseif(CPM_ARGS_SOURCE_DIR)
+      cpm_add_comment_to_package_lock(${CPM_ARGS_NAME} "local directory")
+    else()
+      cpm_add_comment_to_package_lock(${CPM_ARGS_NAME} "${ARGN}")
+    endif()
+  endif()
+
+  cpm_message(
+    STATUS "${CPM_INDENT} Adding package ${CPM_ARGS_NAME}@${CPM_ARGS_VERSION} (${PACKAGE_INFO})"
+  )
+
+  if(NOT CPM_SKIP_FETCH)
+    cpm_declare_fetch(
+      "${CPM_ARGS_NAME}" "${CPM_ARGS_VERSION}" "${PACKAGE_INFO}" "${CPM_ARGS_UNPARSED_ARGUMENTS}"
+    )
+    cpm_fetch_package("${CPM_ARGS_NAME}" populated)
+    if(CPM_SOURCE_CACHE AND download_directory)
+      file(LOCK ${download_directory}/../cmake.lock RELEASE)
+    endif()
+    if(${populated})
+      cpm_add_subdirectory(
+        "${CPM_ARGS_NAME}"
+        "${DOWNLOAD_ONLY}"
+        "${${CPM_ARGS_NAME}_SOURCE_DIR}/${CPM_ARGS_SOURCE_SUBDIR}"
+        "${${CPM_ARGS_NAME}_BINARY_DIR}"
+        "${CPM_ARGS_EXCLUDE_FROM_ALL}"
+        "${CPM_ARGS_SYSTEM}"
+        "${CPM_ARGS_OPTIONS}"
+      )
+    endif()
+    cpm_get_fetch_properties("${CPM_ARGS_NAME}")
+  endif()
+
+  set(${CPM_ARGS_NAME}_ADDED YES)
+  cpm_export_variables("${CPM_ARGS_NAME}")
+endfunction()
+
+# Fetch a previously declared package
+macro(CPMGetPackage Name)
+  if(DEFINED "CPM_DECLARATION_${Name}")
+    CPMAddPackage(NAME ${Name})
+  else()
+    message(SEND_ERROR "${CPM_INDENT} Cannot retrieve package ${Name}: no declaration available")
+  endif()
+endmacro()
+
+# export variables available to the caller to the parent scope expects ${CPM_ARGS_NAME} to be set
+macro(cpm_export_variables name)
+  set(${name}_SOURCE_DIR
+      "${${name}_SOURCE_DIR}"
+      PARENT_SCOPE
+  )
+  set(${name}_BINARY_DIR
+      "${${name}_BINARY_DIR}"
+      PARENT_SCOPE
+  )
+  set(${name}_ADDED
+      "${${name}_ADDED}"
+      PARENT_SCOPE
+  )
+  set(CPM_LAST_PACKAGE_NAME
+      "${name}"
+      PARENT_SCOPE
+  )
+endmacro()
+
+# declares a package, so that any call to CPMAddPackage for the package name will use these
+# arguments instead. Previous declarations will not be overridden.
+macro(CPMDeclarePackage Name)
+  if(NOT DEFINED "CPM_DECLARATION_${Name}")
+    set("CPM_DECLARATION_${Name}" "${ARGN}")
+  endif()
+endmacro()
+
+function(cpm_add_to_package_lock Name)
+  if(NOT CPM_DONT_CREATE_PACKAGE_LOCK)
+    cpm_prettify_package_arguments(PRETTY_ARGN false ${ARGN})
+    file(APPEND ${CPM_PACKAGE_LOCK_FILE} "# ${Name}\nCPMDeclarePackage(${Name}\n${PRETTY_ARGN})\n")
+  endif()
+endfunction()
+
+function(cpm_add_comment_to_package_lock Name)
+  if(NOT CPM_DONT_CREATE_PACKAGE_LOCK)
+    cpm_prettify_package_arguments(PRETTY_ARGN true ${ARGN})
+    file(APPEND ${CPM_PACKAGE_LOCK_FILE}
+         "# ${Name} (unversioned)\n# CPMDeclarePackage(${Name}\n${PRETTY_ARGN}#)\n"
+    )
+  endif()
+endfunction()
+
+# includes the package lock file if it exists and creates a target `cpm-update-package-lock` to
+# update it
+macro(CPMUsePackageLock file)
+  if(NOT CPM_DONT_CREATE_PACKAGE_LOCK)
+    get_filename_component(CPM_ABSOLUTE_PACKAGE_LOCK_PATH ${file} ABSOLUTE)
+    if(EXISTS ${CPM_ABSOLUTE_PACKAGE_LOCK_PATH})
+      include(${CPM_ABSOLUTE_PACKAGE_LOCK_PATH})
+    endif()
+    if(NOT TARGET cpm-update-package-lock)
+      add_custom_target(
+        cpm-update-package-lock COMMAND ${CMAKE_COMMAND} -E copy ${CPM_PACKAGE_LOCK_FILE}
+                                        ${CPM_ABSOLUTE_PACKAGE_LOCK_PATH}
+      )
+    endif()
+    set(CPM_PACKAGE_LOCK_ENABLED true)
+  endif()
+endmacro()
+
+# registers a package that has been added to CPM
+function(CPMRegisterPackage PACKAGE VERSION)
+  list(APPEND CPM_PACKAGES ${PACKAGE})
+  set(CPM_PACKAGES
+      ${CPM_PACKAGES}
+      CACHE INTERNAL ""
+  )
+  set("CPM_PACKAGE_${PACKAGE}_VERSION"
+      ${VERSION}
+      CACHE INTERNAL ""
+  )
+endfunction()
+
+# retrieve the current version of the package to ${OUTPUT}
+function(CPMGetPackageVersion PACKAGE OUTPUT)
+  set(${OUTPUT}
+      "${CPM_PACKAGE_${PACKAGE}_VERSION}"
+      PARENT_SCOPE
+  )
+endfunction()
+
+# declares a package in FetchContent_Declare
+function(cpm_declare_fetch PACKAGE VERSION INFO)
+  if(${CPM_DRY_RUN})
+    cpm_message(STATUS "${CPM_INDENT} Package not declared (dry run)")
+    return()
+  endif()
+
+  FetchContent_Declare(${PACKAGE} ${ARGN})
+endfunction()
+
+# returns properties for a package previously defined by cpm_declare_fetch
+function(cpm_get_fetch_properties PACKAGE)
+  if(${CPM_DRY_RUN})
+    return()
+  endif()
+
+  set(${PACKAGE}_SOURCE_DIR
+      "${CPM_PACKAGE_${PACKAGE}_SOURCE_DIR}"
+      PARENT_SCOPE
+  )
+  set(${PACKAGE}_BINARY_DIR
+      "${CPM_PACKAGE_${PACKAGE}_BINARY_DIR}"
+      PARENT_SCOPE
+  )
+endfunction()
+
+function(cpm_store_fetch_properties PACKAGE source_dir binary_dir)
+  if(${CPM_DRY_RUN})
+    return()
+  endif()
+
+  set(CPM_PACKAGE_${PACKAGE}_SOURCE_DIR
+      "${source_dir}"
+      CACHE INTERNAL ""
+  )
+  set(CPM_PACKAGE_${PACKAGE}_BINARY_DIR
+      "${binary_dir}"
+      CACHE INTERNAL ""
+  )
+endfunction()
+
+# adds a package as a subdirectory if viable, according to provided options
+function(
+  cpm_add_subdirectory
+  PACKAGE
+  DOWNLOAD_ONLY
+  SOURCE_DIR
+  BINARY_DIR
+  EXCLUDE
+  SYSTEM
+  OPTIONS
+)
+
+  if(NOT DOWNLOAD_ONLY AND EXISTS ${SOURCE_DIR}/CMakeLists.txt)
+    set(addSubdirectoryExtraArgs "")
+    if(EXCLUDE)
+      list(APPEND addSubdirectoryExtraArgs EXCLUDE_FROM_ALL)
+    endif()
+    if("${SYSTEM}" AND "${CMAKE_VERSION}" VERSION_GREATER_EQUAL "3.25")
+      # https://cmake.org/cmake/help/latest/prop_dir/SYSTEM.html#prop_dir:SYSTEM
+      list(APPEND addSubdirectoryExtraArgs SYSTEM)
+    endif()
+    if(OPTIONS)
+      foreach(OPTION ${OPTIONS})
+        cpm_parse_option("${OPTION}")
+        set(${OPTION_KEY} "${OPTION_VALUE}")
+      endforeach()
+    endif()
+    set(CPM_OLD_INDENT "${CPM_INDENT}")
+    set(CPM_INDENT "${CPM_INDENT} ${PACKAGE}:")
+    add_subdirectory(${SOURCE_DIR} ${BINARY_DIR} ${addSubdirectoryExtraArgs})
+    set(CPM_INDENT "${CPM_OLD_INDENT}")
+  endif()
+endfunction()
+
+# downloads a previously declared package via FetchContent and exports the variables
+# `${PACKAGE}_SOURCE_DIR` and `${PACKAGE}_BINARY_DIR` to the parent scope
+function(cpm_fetch_package PACKAGE populated)
+  set(${populated}
+      FALSE
+      PARENT_SCOPE
+  )
+  if(${CPM_DRY_RUN})
+    cpm_message(STATUS "${CPM_INDENT} Package ${PACKAGE} not fetched (dry run)")
+    return()
+  endif()
+
+  FetchContent_GetProperties(${PACKAGE})
+
+  string(TOLOWER "${PACKAGE}" lower_case_name)
+
+  if(NOT ${lower_case_name}_POPULATED)
+    FetchContent_Populate(${PACKAGE})
+    set(${populated}
+        TRUE
+        PARENT_SCOPE
+    )
+  endif()
+
+  cpm_store_fetch_properties(
+    ${CPM_ARGS_NAME} ${${lower_case_name}_SOURCE_DIR} ${${lower_case_name}_BINARY_DIR}
+  )
+
+  set(${PACKAGE}_SOURCE_DIR
+      ${${lower_case_name}_SOURCE_DIR}
+      PARENT_SCOPE
+  )
+  set(${PACKAGE}_BINARY_DIR
+      ${${lower_case_name}_BINARY_DIR}
+      PARENT_SCOPE
+  )
+endfunction()
+
+# splits a package option
+function(cpm_parse_option OPTION)
+  string(REGEX MATCH "^[^ ]+" OPTION_KEY "${OPTION}")
+  string(LENGTH "${OPTION}" OPTION_LENGTH)
+  string(LENGTH "${OPTION_KEY}" OPTION_KEY_LENGTH)
+  if(OPTION_KEY_LENGTH STREQUAL OPTION_LENGTH)
+    # no value for key provided, assume user wants to set option to "ON"
+    set(OPTION_VALUE "ON")
+  else()
+    math(EXPR OPTION_KEY_LENGTH "${OPTION_KEY_LENGTH}+1")
+    string(SUBSTRING "${OPTION}" "${OPTION_KEY_LENGTH}" "-1" OPTION_VALUE)
+  endif()
+  set(OPTION_KEY
+      "${OPTION_KEY}"
+      PARENT_SCOPE
+  )
+  set(OPTION_VALUE
+      "${OPTION_VALUE}"
+      PARENT_SCOPE
+  )
+endfunction()
+
+# guesses the package version from a git tag
+function(cpm_get_version_from_git_tag GIT_TAG RESULT)
+  string(LENGTH ${GIT_TAG} length)
+  if(length EQUAL 40)
+    # GIT_TAG is probably a git hash
+    set(${RESULT}
+        0
+        PARENT_SCOPE
+    )
+  else()
+    string(REGEX MATCH "v?([0123456789.]*).*" _ ${GIT_TAG})
+    set(${RESULT}
+        ${CMAKE_MATCH_1}
+        PARENT_SCOPE
+    )
+  endif()
+endfunction()
+
+# guesses if the git tag is a commit hash or an actual tag or a branch name.
+function(cpm_is_git_tag_commit_hash GIT_TAG RESULT)
+  string(LENGTH "${GIT_TAG}" length)
+  # full hash has 40 characters, and short hash has at least 7 characters.
+  if(length LESS 7 OR length GREATER 40)
+    set(${RESULT}
+        0
+        PARENT_SCOPE
+    )
+  else()
+    if(${GIT_TAG} MATCHES "^[a-fA-F0-9]+$")
+      set(${RESULT}
+          1
+          PARENT_SCOPE
+      )
+    else()
+      set(${RESULT}
+          0
+          PARENT_SCOPE
+      )
+    endif()
+  endif()
+endfunction()
+
+function(cpm_prettify_package_arguments OUT_VAR IS_IN_COMMENT)
+  set(oneValueArgs
+      NAME
+      FORCE
+      VERSION
+      GIT_TAG
+      DOWNLOAD_ONLY
+      GITHUB_REPOSITORY
+      GITLAB_REPOSITORY
+      BITBUCKET_REPOSITORY
+      GIT_REPOSITORY
+      SOURCE_DIR
+      FIND_PACKAGE_ARGUMENTS
+      NO_CACHE
+      SYSTEM
+      GIT_SHALLOW
+      EXCLUDE_FROM_ALL
+      SOURCE_SUBDIR
+  )
+  set(multiValueArgs URL OPTIONS DOWNLOAD_COMMAND)
+  cmake_parse_arguments(CPM_ARGS "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+  foreach(oneArgName ${oneValueArgs})
+    if(DEFINED CPM_ARGS_${oneArgName})
+      if(${IS_IN_COMMENT})
+        string(APPEND PRETTY_OUT_VAR "#")
+      endif()
+      if(${oneArgName} STREQUAL "SOURCE_DIR")
+        string(REPLACE ${CMAKE_SOURCE_DIR} "\${CMAKE_SOURCE_DIR}" CPM_ARGS_${oneArgName}
+                       ${CPM_ARGS_${oneArgName}}
+        )
+      endif()
+      string(APPEND PRETTY_OUT_VAR "  ${oneArgName} ${CPM_ARGS_${oneArgName}}\n")
+    endif()
+  endforeach()
+  foreach(multiArgName ${multiValueArgs})
+    if(DEFINED CPM_ARGS_${multiArgName})
+      if(${IS_IN_COMMENT})
+        string(APPEND PRETTY_OUT_VAR "#")
+      endif()
+      string(APPEND PRETTY_OUT_VAR "  ${multiArgName}\n")
+      foreach(singleOption ${CPM_ARGS_${multiArgName}})
+        if(${IS_IN_COMMENT})
+          string(APPEND PRETTY_OUT_VAR "#")
+        endif()
+        string(APPEND PRETTY_OUT_VAR "    \"${singleOption}\"\n")
+      endforeach()
+    endif()
+  endforeach()
+
+  if(NOT "${CPM_ARGS_UNPARSED_ARGUMENTS}" STREQUAL "")
+    if(${IS_IN_COMMENT})
+      string(APPEND PRETTY_OUT_VAR "#")
+    endif()
+    string(APPEND PRETTY_OUT_VAR " ")
+    foreach(CPM_ARGS_UNPARSED_ARGUMENT ${CPM_ARGS_UNPARSED_ARGUMENTS})
+      string(APPEND PRETTY_OUT_VAR " ${CPM_ARGS_UNPARSED_ARGUMENT}")
+    endforeach()
+    string(APPEND PRETTY_OUT_VAR "\n")
+  endif()
+
+  set(${OUT_VAR}
+      ${PRETTY_OUT_VAR}
+      PARENT_SCOPE
+  )
+
+endfunction()

diff --git a/arbor-0.9.0-pybind11-3.0.patch b/arbor-0.9.0-pybind11-3.0.patch
deleted file mode 100644
index 6fc58db..0000000
--- a/arbor-0.9.0-pybind11-3.0.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff -Naur arbor-0.9.0-original/python/pyarb.hpp arbor-0.9.0/python/pyarb.hpp
---- arbor-0.9.0-original/python/pyarb.hpp	2023-08-10 10:47:38.000000000 +0100
-+++ arbor-0.9.0/python/pyarb.hpp	2025-11-03 08:24:00.093256311 +0000
-@@ -13,18 +13,6 @@
- 
- #include <pybind11/pybind11.h>
- 
--// Version check
--#define mk_tok(x) #x
--#define mk_ver(M, m, p) mk_tok(M) "." mk_tok(m) "." mk_tok(p)
--#define PB11_ERR(M, m, p) "Required version of pybind11 is 2.8.1 <= version < 3.0.0 Found " mk_ver(M, m, p)
--static_assert((PYBIND11_VERSION_HEX >= 0x02080100)
--              &&
--              (PYBIND11_VERSION_HEX  < 0x03000000),
--              PB11_ERR(PYBIND11_VERSION_MAJOR, PYBIND11_VERSION_MINOR, PYBIND11_VERSION_PATCH));
--#undef PB11_ERR
--#undef mk_ver
--#undef mk_tok
--
- namespace pyarb {
- 
- // Sample recorder object interface.

diff --git a/arbor.spec b/arbor.spec
index 8e76de4..acd961c 100644
--- a/arbor.spec
+++ b/arbor.spec
@@ -28,7 +28,7 @@ Documentation is available at https://arbor.readthedocs.io/en/latest/
 %global forgeurl            https://github.com/arbor-sim/arbor
 
 Name:           arbor
-Version:        0.9.0
+Version:        0.12.2
 Release:        %autorelease
 Summary:        Multi-compartment neural network simulation library
 
@@ -36,22 +36,38 @@ Summary:        Multi-compartment neural network simulation library
 
 URL:            %forgeurl
 Source0:        %forgesource
-# script to run examples
-Source1:        https://raw.githubusercontent.com/arbor-sim/arbor/master/scripts/run_python_examples.sh
-Source2:        https://raw.githubusercontent.com/arbor-sim/arbor/master/scripts/run_cpp_examples.sh
-License:        BSD-3-Clause
+
+# The CPM.cmake shipped in the upstream tarball is only a bootstrap that
+# downloads the full CPM.cmake from GitHub at configure time, which fails in
+# the offline buildroot. Vendor the full CPM.cmake v0.39.0 instead.
+# https://raw.githubusercontent.com/cpm-cmake/CPM.cmake/refs/tags/v0.39.0/cmake/CPM.cmake
+Source3:        CPM_0.39.0.cmake
+# tinyopt and unordered_dense are header-only dependencies used by arbor that
+# are not packaged in Fedora. CPM would download them from GitHub at configure
+# time, so vendor the pinned versions instead.
+# https://github.com/halfflat/tinyopt
+%global tinyopt_commit 7e6d707d49c6cb4be27ebd253856be65293288df
+%global tinyopt_shortcommit %(c=%{tinyopt_commit}; echo ${c:0:7})
+# https://github.com/martinus/unordered_dense
+%global unordered_dense_tag 4.5.0
+Source4:        https://github.com/halfflat/tinyopt/archive/%{tinyopt_commit}/tinyopt-%{tinyopt_shortcommit}.tar.gz
+Source5:        https://github.com/martinus/unordered_dense/archive/v%{unordered_dense_tag}/unordered_dense-%{unordered_dense_tag}.tar.gz
+
+# License breakdown:
+#   LICENSE                        - BSD-3-Clause (arbor code)
+#   ext/tinyopt (bundled)          - BSD-3-Clause
+#   ext/unordered_dense (bundled)  - MIT
+#   arbor/util/skasort.hpp         - BSL-1.0
+License:        BSD-3-Clause AND MIT AND BSL-1.0
 
 Patch:          0001-Quote-various-cmake-var-values.patch
-# Tests are failing to compile due to some missing includes
-Patch:          fix-missing-includes.patch
-# Fix a few typos that cause failure to compile with GCC 15
-#
-# These were eventually included in
-# 76120d16c00ae67128c3c69421ab712f985f3445, along with many other changes.
-Patch:          0001-Fix-a-few-typos-that-cause-failure-to-compile-with-G.patch
-# Remove the hard-coded pybind11 version check so that we can build with
-# pybind11 3.0; this is part of https://github.com/arbor-sim/arbor/pull/2481.
-Patch:          arbor-0.9.0-pybind11-3.0.patch
+# Use the vendored tinyopt/unordered_dense instead of letting CPM download them
+Patch:          0001-Use-vendored-tinyopt-and-unordered_dense.patch
+# Use system Random123/GTest instead of letting CPM download them
+Patch:          0002-Use-system-Random123.patch
+Patch:          0003-Use-system-GTest.patch
+# Add missing standard includes for GCC 16
+Patch:          0004-Add-missing-standard-includes-to-profiler.patch
 
 # Random123 does not support:
 #   mips64r2 mips32r2 s390
@@ -71,8 +87,8 @@ BuildRequires:  pybind11-devel
 BuildRequires:  python3-devel
 BuildRequires:  python3-setuptools
 BuildRequires:  Random123-devel
-BuildRequires:  tclap-devel
 BuildRequires:  pugixml-devel
+BuildRequires:  units-llnl-devel
 
 # For validation, but we don't have these BRs
 # BuildRequires:  julia julia-sundials julia-unitful julia-JSON
@@ -89,6 +105,12 @@ Requires:       %{py3_dist numpy}
 # Provide Python meta data for packages requiring arbor
 %py_provides python3-arbor
 
+# Bundled header-only libraries (not packaged in Fedora):
+# tinyopt, https://github.com/halfflat/tinyopt
+Provides:       bundled(tinyopt) = 1.0
+# unordered_dense, https://github.com/martinus/unordered_dense
+Provides:       bundled(unordered_dense) = 4.5.0
+
 %description %{_description}
 
 %package devel
@@ -157,7 +179,7 @@ Provides:   arbor-openmpi-static = %{version}-%{release}
 %endif
 
 %prep
-%forgeautosetup -p1
+%forgeautosetup -p1 -S git
 
 # correct catalogue location
 sed -i 's|dummy-catalogue.so|lib/dummy-catalogue.so|' python/test/unit/test_catalogues.py
@@ -169,18 +191,23 @@ sed -i '/test_padded.cpp/ d' test/unit/CMakeLists.txt
 # is used
 sed -i '/add_subdirectory(python)/i \
 include(FindPythonModule)' CMakeLists.txt
-# Do not build external libraries
-sed -i -e 's/ ext-random123//' CMakeLists.txt
+
+# Replace the CPM.cmake bootstrap (which downloads CPM from GitHub at configure
+# time) with the vendored copy, so that the build works in the offline buildroot
+cp %{SOURCE3} cmake/CPM.cmake
 
 # Disable doc build: we built it ourselves
 sed -i '/add_subdirectory(doc)/ d' CMakeLists.txt
 
-# Remove ext folders, unbundle libraries
-rm -vrf ext/google-benchmark ext/json ext/random123
+# Vendor tinyopt and unordered_dense (header-only dependencies not packaged in
+# Fedora), using the paths expected by
+# 0001-Use-vendored-tinyopt-and-unordered_dense.patch
+mkdir -p ext/tinyopt
+tar -xzf %{SOURCE4} -C ext/tinyopt --strip-components=1 'tinyopt-*/include' 'tinyopt-*/LICENSE'
 mv ext/tinyopt/LICENSE ext/tinyopt/LICENSE-tinyopt
-
-# tclap and json are both header only
-find . -type f -name "CMakeLists.txt" -exec sed -i -e 's/ext-tclap//' -e 's/ext-json//' {} 2>/dev/null ';'
+mkdir -p ext/unordered_dense
+tar -xzf %{SOURCE5} -C ext/unordered_dense --strip-components=1 'unordered_dense-*/include' 'unordered_dense-*/LICENSE'
+mv ext/unordered_dense/LICENSE ext/unordered_dense/LICENSE-unordered_dense
 
 # Correct Python shebangs in all files
 find . -type f -name "*" -exec sed -i 's|^#![  ]*/usr/bin/env.*python.*$|#!/usr/bin/python3|' {} 2>/dev/null ';'
@@ -188,12 +215,14 @@ find . -type f -name "*" -exec sed -i 's|^#![  ]*/usr/bin/env.*python.*$|#!/usr/
 # Fix shebang (special case)
 sed -i 's|^#![  ]*/usr/env/bin.*python.*$|#!/usr/bin/python3|' example/lfp/neuron_lfp_example.py
 
-# test scripts
-cp %{SOURCE1} scripts/
-cp %{SOURCE2} scripts/
+# Use the example scripts shipped in the tarball
 chmod +x scripts/*.sh
-sed -i 's/ python / python3 /' scripts/run_python_examples.sh
 sed -i 's|build/|./|' scripts/run_cpp_examples.sh
+# The python example runner would pip install example requirements, which is
+# not possible in the offline buildroot. LFPykit (used by probe_lfpykit.py) is
+# not packaged in Fedora either.
+sed -i '/python3 -m pip install -r python\/example\/example_requirements.txt/d' scripts/run_python_examples.sh
+sed -i '/runpyex probe_lfpykit.py/d' scripts/run_python_examples.sh
 
 # builddir for serial
 mkdir build-serial
@@ -226,8 +255,6 @@ pushd build$MPI_COMPILE_TYPE  &&
         -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\
         -DCMAKE_SKIP_RPATH:BOOL=ON \\\
         -DCMAKE_BUILD_TYPE:STRING="release" \\\
-        -DARB_USE_BUNDLED_LIBS:BOOL=OFF \\\
-        -DARB_USE_BUNDLED_PYBIND11:BOOL=OFF \\\
         -DARB_VECTORIZE:BOOL=OFF \\\
         -DARB_WITH_MPI:BOOL=$MPI_YES \\\
         -DARB_WITH_GPU:BOOL=OFF \\\
@@ -236,6 +263,7 @@ pushd build$MPI_COMPILE_TYPE  &&
         -DCMAKE_INSTALL_LIBDIR=%{_lib} \\\
         -DARB_WITH_PYTHON:BOOL=ON \\\
         -DARB_PYTHON_LIB_PATH:STRING=$MPI_PYTHON3_SITEARCH \\\
+        -DARB_BUILD_PYTHON_STUBS:BOOL=OFF \\\
 %if "%{_lib}" == "lib64"
         -DLIB_SUFFIX=64 .. &&
 %else
@@ -416,7 +444,7 @@ popd
 
 
 %files
-%license LICENSE ext/tinyopt/LICENSE-tinyopt
+%license LICENSE ext/tinyopt/LICENSE-tinyopt ext/unordered_dense/LICENSE-unordered_dense
 %doc README.md
 %{_bindir}/modcc
 %{_bindir}/arbor-build-catalogue
@@ -442,7 +470,7 @@ popd
 %if %{with mpich}
 %files mpich
 %doc README.md
-%license LICENSE ext/tinyopt/LICENSE-tinyopt
+%license LICENSE ext/tinyopt/LICENSE-tinyopt ext/unordered_dense/LICENSE-unordered_dense
 %{_libdir}/mpich/bin/modcc_mpich
 %{_libdir}/mpich/bin/arbor-build-catalogue_mpich
 %{_libdir}/mpich/bin/lmorpho_mpich
@@ -462,7 +490,7 @@ popd
 %if %{with openmpi}
 %files openmpi
 %doc README.md
-%license LICENSE ext/tinyopt/LICENSE-tinyopt
+%license LICENSE ext/tinyopt/LICENSE-tinyopt ext/unordered_dense/LICENSE-unordered_dense
 %{_libdir}/openmpi/bin/modcc_openmpi
 %{_libdir}/openmpi/bin/arbor-build-catalogue_openmpi
 %{_libdir}/openmpi/bin/lmorpho_openmpi

diff --git a/fix-missing-includes.patch b/fix-missing-includes.patch
deleted file mode 100644
index edfda30..0000000
--- a/fix-missing-includes.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From fa15938c196bf317e0292d41ec7d341978e9ed08 Mon Sep 17 00:00:00 2001
-From: Sandro <devel@penguinpee.nl>
-Date: Mon, 29 Apr 2024 14:35:01 +0200
-Subject: [PATCH] Fix missing includes
-
-Tests are failing to compile without those.
-
-diff --git a/test/unit/common.hpp b/test/unit/common.hpp
-index db75e4d1..e02b9df2 100644
---- a/test/unit/common.hpp
-+++ b/test/unit/common.hpp
-@@ -11,6 +11,7 @@
- #include <unordered_map>
- #include <utility>
- #include <vector>
-+#include <algorithm>
- 
- #include <gtest/gtest.h>
- 
-diff --git a/test/unit/test_event_queue.cpp b/test/unit/test_event_queue.cpp
-index daa0ccb9..17c10378 100644
---- a/test/unit/test_event_queue.cpp
-+++ b/test/unit/test_event_queue.cpp
-@@ -6,6 +6,7 @@
- #include <arbor/spike_event.hpp>
- 
- #include "event_queue.hpp"
-+#include "common.hpp"
- 
- using namespace arb;
- 
-diff --git a/test/unit/test_ordered_forest.cpp b/test/unit/test_ordered_forest.cpp
-index c58c76a4..12f7bd31 100644
---- a/test/unit/test_ordered_forest.cpp
-+++ b/test/unit/test_ordered_forest.cpp
-@@ -5,6 +5,7 @@
- 
- #include <gtest/gtest.h>
- #include "util/ordered_forest.hpp"
-+#include "common.hpp"
- 
- using arb::util::ordered_forest;
- 

diff --git a/run_cpp_examples.sh b/run_cpp_examples.sh
deleted file mode 100644
index d463b29..0000000
--- a/run_cpp_examples.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env bash
-# Runs all C++ examples
-
-set -Eeuo pipefail
-
-if [[ "$#" -gt 1 ]]; then
-    echo "usage: run_cpp_examples.sh <prefix, e.g., mpirun -n 4 -oversubscribe>"
-	exit 1
-fi
-
-PREFIX=${1:-}
-
-$PREFIX build/bin/bench
-$PREFIX build/bin/brunel
-$PREFIX build/bin/dryrun
-$PREFIX build/bin/gap_junctions
-$PREFIX build/bin/generators
-$PREFIX build/bin/lfp
-$PREFIX build/bin/probe-demo v
-$PREFIX build/bin/ring
-$PREFIX build/bin/single-cell

diff --git a/run_python_examples.sh b/run_python_examples.sh
deleted file mode 100644
index 5eca21d..0000000
--- a/run_python_examples.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env bash
-# Runs all Python examples
-
-set -Eeuo pipefail
-
-if [[ "$#" -gt 1 ]]; then
-    echo "usage: run_python_examples.sh <prefix>"
-	exit 1
-fi
-
-PREFIX=${1:-}
-
-$PREFIX python python/example/network_ring.py
-$PREFIX python python/example/single_cell_model.py
-$PREFIX python python/example/single_cell_recipe.py
-$PREFIX python python/example/single_cell_stdp.py
-$PREFIX python python/example/brunel.py -n 400 -m 100 -e 20 -p 0.1 -w 1.2 -d 1 -g 0.5 -l 5 -t 100 -s 1 -G 50 -S 123
-$PREFIX python python/example/single_cell_swc.py python/example/single_cell_detailed.swc
-$PREFIX python python/example/single_cell_detailed.py python/example/single_cell_detailed.swc
-$PREFIX python python/example/single_cell_detailed_recipe.py python/example/single_cell_detailed.swc
-$PREFIX python python/example/single_cell_cable.py

diff --git a/sources b/sources
index 2f80fee..2d06f94 100644
--- a/sources
+++ b/sources
@@ -1 +1,3 @@
-SHA512 (arbor-0.9.0.tar.gz) = fa0280cae870c150c8f891949da9d6276f672bb7191b7b982cda4695dd38e3bffdd0dfa5f3acc2cf940909f64eb9da04cd11aeb7a4baa262fdbcd99be618aa15
+SHA512 (arbor-0.12.2.tar.gz) = c23de49a36af5f720b98b557413e46b7458cce52bef0541386164728f4aca909029fbe47bd43cf07da7d08388e9159d8dd9bee3ecde6f750577fe02cebc0517d
+SHA512 (tinyopt-7e6d707.tar.gz) = 7b8f63446ac6572c2de2091c70345597d327bf666bb11a1ecd4995ecff62122878fd2b99984d7a53fb419baf0ef452dc9608a701e1c56b88e0332870a1adb2e8
+SHA512 (unordered_dense-4.5.0.tar.gz) = f9c819e28e1c1a387acfee09277d6af5e366597a0d39acf1c687acf0608a941ba966af8aaebdb8fba0126c7360269c4a51754ef4cab17c35c01a30215f953368

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-19  9:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-19  9:16 [rpms/arbor] f45: feat: update to 0.12.2 Ankur Sinha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox