From 6b85feaad9d96c4b9aba5c8ec4c33715308e1e3b Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Thu, 11 Jun 2026 15:25:12 -0400 Subject: [PATCH 1/8] registration-toolkit 1.8.0 (new formula) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit C++ utilities for image-to-image and image-to-mesh registration. v1.8.0 is the first proper GitHub release after the GitLab → GitHub migration; the v1.7.0 tarball was unstable due to mirror re-pushes. Co-Authored-By: Claude Opus 4.7 --- Formula/registration-toolkit.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Formula/registration-toolkit.rb diff --git a/Formula/registration-toolkit.rb b/Formula/registration-toolkit.rb new file mode 100644 index 0000000..ada405c --- /dev/null +++ b/Formula/registration-toolkit.rb @@ -0,0 +1,29 @@ +class RegistrationToolkit < Formula + desc "C++ utilities for image-to-image and image-to-mesh registration" + homepage "https://github.com/educelab/registration-toolkit" + url "https://github.com/educelab/registration-toolkit/archive/refs/tags/v1.8.0.tar.gz" + sha256 "e45e139d26b0f286e40af688f949337db8de4d44af6da3b6536a82ccf270994c" + license "GPL-3.0-or-later" + head "https://github.com/educelab/registration-toolkit.git", branch: "develop" + + depends_on "cmake" => :build + depends_on "boost" + depends_on "eigen" + depends_on "itk" + depends_on "opencv" + depends_on "spdlog" + depends_on "vtk" + + def install + system "cmake", "-S", ".", "-B", "build", + "-DRT_BUILD_DOCS=OFF", + "-DRT_BUILD_TESTS=OFF", + *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + assert_match "Usage", shell_output("#{bin}/rt_register --help 2>&1", 1) + end +end From 8ea726de051553e57fa4333326e3796681e3731e Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Thu, 11 Jun 2026 18:10:54 -0400 Subject: [PATCH 2/8] registration-toolkit: allow build-time network for FetchContent Upstream's CMake pulls smgl, bvh, libcore, and OpenABF via FetchContent. Each is pinned to an immutable commit/tag, so bottle reproducibility is preserved. Co-Authored-By: Claude Opus 4.7 --- Formula/registration-toolkit.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Formula/registration-toolkit.rb b/Formula/registration-toolkit.rb index ada405c..a2e380c 100644 --- a/Formula/registration-toolkit.rb +++ b/Formula/registration-toolkit.rb @@ -6,6 +6,10 @@ class RegistrationToolkit < Formula license "GPL-3.0-or-later" head "https://github.com/educelab/registration-toolkit.git", branch: "develop" + # Upstream uses CMake FetchContent for smgl, bvh, libcore, and OpenABF, + # each pinned to an immutable commit/tag. + allow_network_access! :build + depends_on "cmake" => :build depends_on "boost" depends_on "eigen" From f98f7f7838ac062dd12bc7c4eb218c09d89f6019 Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Thu, 11 Jun 2026 18:29:52 -0400 Subject: [PATCH 3/8] registration-toolkit: order allow_network_access! after depends_on brew audit (FormulaAudit/ComponentsOrder) requires depends_on blocks before allow_network_access!. Co-Authored-By: Claude Opus 4.7 --- Formula/registration-toolkit.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Formula/registration-toolkit.rb b/Formula/registration-toolkit.rb index a2e380c..feecc15 100644 --- a/Formula/registration-toolkit.rb +++ b/Formula/registration-toolkit.rb @@ -6,10 +6,6 @@ class RegistrationToolkit < Formula license "GPL-3.0-or-later" head "https://github.com/educelab/registration-toolkit.git", branch: "develop" - # Upstream uses CMake FetchContent for smgl, bvh, libcore, and OpenABF, - # each pinned to an immutable commit/tag. - allow_network_access! :build - depends_on "cmake" => :build depends_on "boost" depends_on "eigen" @@ -18,6 +14,10 @@ class RegistrationToolkit < Formula depends_on "spdlog" depends_on "vtk" + # Upstream uses CMake FetchContent for smgl, bvh, libcore, and OpenABF, + # each pinned to an immutable commit/tag. + allow_network_access! :build + def install system "cmake", "-S", ".", "-B", "build", "-DRT_BUILD_DOCS=OFF", From 76c9eb03fb68b346506ebe8f880c7bc457e85e4d Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Thu, 11 Jun 2026 18:41:14 -0400 Subject: [PATCH 4/8] registration-toolkit: vendor FetchContent deps as resources Homebrew traps live FetchContent calls (trap_fetchcontent_provider.cmake) regardless of allow_network_access!. Replace that approach with the prescribed Homebrew pattern: declare smgl, bvh, libcore, and OpenABF as resources at the same commits the upstream CMake pins, stage them under _deps/, and direct the build at the pre-staged sources via FETCHCONTENT_SOURCE_DIR_ with FETCHCONTENT_FULLY_DISCONNECTED. Co-Authored-By: Claude Opus 4.7 --- Formula/registration-toolkit.rb | 37 ++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/Formula/registration-toolkit.rb b/Formula/registration-toolkit.rb index feecc15..82aaef9 100644 --- a/Formula/registration-toolkit.rb +++ b/Formula/registration-toolkit.rb @@ -14,14 +14,45 @@ class RegistrationToolkit < Formula depends_on "spdlog" depends_on "vtk" - # Upstream uses CMake FetchContent for smgl, bvh, libcore, and OpenABF, - # each pinned to an immutable commit/tag. - allow_network_access! :build + # Upstream's CMake uses FetchContent for these transitive deps, each pinned + # to the commit/tag listed in cmake/Build*.cmake. Homebrew traps live + # FetchContent calls, so we vendor them as resources and point the build at + # the pre-staged sources via FETCHCONTENT_SOURCE_DIR_. + + resource "smgl" do + url "https://gitlab.com/educelab/smgl/-/archive/d74d76d121a18afab9b12dd9dc3d643f4e620ff1/smgl-d74d76d121a18afab9b12dd9dc3d643f4e620ff1.tar.gz" + sha256 "527294f596b85f022d0e8e730924972b40cbca37412e3a9f702c920e55c27293" + end + + resource "bvh" do + url "https://github.com/madmann91/bvh/archive/66e445b92f68801a6dd8ef943fe3038976ecb4ff.tar.gz" + sha256 "32f83c790d73ac0300059972f6e37e95506deb997479b956ecf1b4029e4e63c8" + end + + resource "libcore" do + url "https://github.com/educelab/libcore/archive/43666d4918a484e7e950fff7607865f78ff4b621.tar.gz" + sha256 "c952c52396093c16790d5aa8ab0a07b895beff0b9339addecbb9b371f8b29304" + end + + resource "OpenABF" do + url "https://github.com/educelab/OpenABF/archive/3c1b52a02a15007d3dcb7746b08a4f3db0e7a0b6.tar.gz" + sha256 "3ee9d00b279707d742991554b33e0029ca8c00b2a756a3df5de93825a526f4aa" + end def install + resource("smgl").stage(buildpath/"_deps/smgl") + resource("bvh").stage(buildpath/"_deps/bvh") + resource("libcore").stage(buildpath/"_deps/libcore") + resource("OpenABF").stage(buildpath/"_deps/OpenABF") + system "cmake", "-S", ".", "-B", "build", "-DRT_BUILD_DOCS=OFF", "-DRT_BUILD_TESTS=OFF", + "-DFETCHCONTENT_FULLY_DISCONNECTED=ON", + "-DFETCHCONTENT_SOURCE_DIR_SMGL=#{buildpath}/_deps/smgl", + "-DFETCHCONTENT_SOURCE_DIR_BVH=#{buildpath}/_deps/bvh", + "-DFETCHCONTENT_SOURCE_DIR_LIBCORE=#{buildpath}/_deps/libcore", + "-DFETCHCONTENT_SOURCE_DIR_OPENABF=#{buildpath}/_deps/OpenABF", *std_cmake_args system "cmake", "--build", "build" system "cmake", "--install", "build" From bcfeb5272339b2a78cc4dc5a2f90d816e25bb259 Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Thu, 11 Jun 2026 18:53:45 -0400 Subject: [PATCH 5/8] registration-toolkit: pin FetchContent resources via git revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitHub/GitLab autogenerated archive tarballs are not byte-stable enough for sha256 pinning — every fetch can vary in gzip metadata. Switch each resource to a git URL with an explicit `revision:` so the content-addressed commit SHA is the immutable identifier, eliminating the tarball-checksum drift. Co-Authored-By: Claude Opus 4.7 --- Formula/registration-toolkit.rb | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Formula/registration-toolkit.rb b/Formula/registration-toolkit.rb index 82aaef9..eab262e 100644 --- a/Formula/registration-toolkit.rb +++ b/Formula/registration-toolkit.rb @@ -15,28 +15,31 @@ class RegistrationToolkit < Formula depends_on "vtk" # Upstream's CMake uses FetchContent for these transitive deps, each pinned - # to the commit/tag listed in cmake/Build*.cmake. Homebrew traps live + # to the commit listed in cmake/Build*.cmake. Homebrew traps live # FetchContent calls, so we vendor them as resources and point the build at # the pre-staged sources via FETCHCONTENT_SOURCE_DIR_. + # + # Use git URLs with explicit revisions: GitHub/GitLab autogenerated tag + # tarballs are not byte-stable enough for sha256 pinning. Commit SHAs are. resource "smgl" do - url "https://gitlab.com/educelab/smgl/-/archive/d74d76d121a18afab9b12dd9dc3d643f4e620ff1/smgl-d74d76d121a18afab9b12dd9dc3d643f4e620ff1.tar.gz" - sha256 "527294f596b85f022d0e8e730924972b40cbca37412e3a9f702c920e55c27293" + url "https://gitlab.com/educelab/smgl.git", + revision: "d74d76d121a18afab9b12dd9dc3d643f4e620ff1" end resource "bvh" do - url "https://github.com/madmann91/bvh/archive/66e445b92f68801a6dd8ef943fe3038976ecb4ff.tar.gz" - sha256 "32f83c790d73ac0300059972f6e37e95506deb997479b956ecf1b4029e4e63c8" + url "https://github.com/madmann91/bvh.git", + revision: "66e445b92f68801a6dd8ef943fe3038976ecb4ff" end resource "libcore" do - url "https://github.com/educelab/libcore/archive/43666d4918a484e7e950fff7607865f78ff4b621.tar.gz" - sha256 "c952c52396093c16790d5aa8ab0a07b895beff0b9339addecbb9b371f8b29304" + url "https://github.com/educelab/libcore.git", + revision: "43666d4918a484e7e950fff7607865f78ff4b621" end resource "OpenABF" do - url "https://github.com/educelab/OpenABF/archive/3c1b52a02a15007d3dcb7746b08a4f3db0e7a0b6.tar.gz" - sha256 "3ee9d00b279707d742991554b33e0029ca8c00b2a756a3df5de93825a526f4aa" + url "https://github.com/educelab/OpenABF.git", + revision: "3c1b52a02a15007d3dcb7746b08a4f3db0e7a0b6" end def install From d275a9c2603ea0d88d7134ec9e7113c19ec7128d Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Thu, 11 Jun 2026 19:07:13 -0400 Subject: [PATCH 6/8] registration-toolkit: add libtiff dep, fix test assertion - The binary links libtiff (per upstream README); declaring it satisfies `brew linkage --test`. - `rt_register --help` exits 0 and the output uses `--log-level` (not "Usage"); update the test to match what the tool actually prints. Co-Authored-By: Claude Opus 4.7 --- Formula/registration-toolkit.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Formula/registration-toolkit.rb b/Formula/registration-toolkit.rb index eab262e..bf190be 100644 --- a/Formula/registration-toolkit.rb +++ b/Formula/registration-toolkit.rb @@ -10,6 +10,7 @@ class RegistrationToolkit < Formula depends_on "boost" depends_on "eigen" depends_on "itk" + depends_on "libtiff" depends_on "opencv" depends_on "spdlog" depends_on "vtk" @@ -62,6 +63,6 @@ def install end test do - assert_match "Usage", shell_output("#{bin}/rt_register --help 2>&1", 1) + assert_match "--log-level", shell_output("#{bin}/rt_register --help") end end From b3418abfec13a69046b679df76c8c31d20b02391 Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Thu, 11 Jun 2026 19:22:15 -0400 Subject: [PATCH 7/8] registration-toolkit: declare fmt as a direct dep The binary links libfmt (transitively via spdlog, but linkage --test requires direct declaration of anything actually linked). Co-Authored-By: Claude Opus 4.7 --- Formula/registration-toolkit.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/Formula/registration-toolkit.rb b/Formula/registration-toolkit.rb index bf190be..8020228 100644 --- a/Formula/registration-toolkit.rb +++ b/Formula/registration-toolkit.rb @@ -9,6 +9,7 @@ class RegistrationToolkit < Formula depends_on "cmake" => :build depends_on "boost" depends_on "eigen" + depends_on "fmt" depends_on "itk" depends_on "libtiff" depends_on "opencv" From 2297a581201a94eb4df3fffbdfcd9d5fb74520fc Mon Sep 17 00:00:00 2001 From: Seth Parker Date: Thu, 11 Jun 2026 19:36:50 -0400 Subject: [PATCH 8/8] registration-toolkit: capture stderr in `test do` block rt_register prints its --help output to stderr. shell_output without 2>&1 was capturing an empty stdout, so the assert_match against the empty string failed. Co-Authored-By: Claude Opus 4.7 --- Formula/registration-toolkit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/registration-toolkit.rb b/Formula/registration-toolkit.rb index 8020228..3c62321 100644 --- a/Formula/registration-toolkit.rb +++ b/Formula/registration-toolkit.rb @@ -64,6 +64,6 @@ def install end test do - assert_match "--log-level", shell_output("#{bin}/rt_register --help") + assert_match "--log-level", shell_output("#{bin}/rt_register --help 2>&1") end end