Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visp: update postinstall to support API #208554

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions Formula/v/visp.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Visp < Formula

Check warning on line 1 in Formula/v/visp.rb

View workflow job for this annotation

GitHub Actions / macOS 15-arm64

No bottle built for visp!

visp has unbottled dependencies, so a bottle will not be built.
desc "Visual Servoing Platform library"
homepage "https://visp.inria.fr/"
url "https://visp-doc.inria.fr/download/releases/visp-3.6.0.tar.gz"
Expand Down Expand Up @@ -155,14 +155,25 @@
# Replace SDK paths in bottle when pouring on different OS version than bottle OS.
# This avoids error like https://github.com/orgs/Homebrew/discussions/5853
# TODO: Consider handling this in brew, e.g. as part of keg cleaner or bottle relocation
if OS.mac? && Tab.for_formula(self).poured_from_bottle && MacOS.version != bottle&.tag&.to_macos_version
if OS.mac? && (tab = Tab.for_formula(self)).poured_from_bottle
bottle_os = bottle&.tag&.to_macos_version
if bottle_os.nil? && (os_version = tab.built_on.fetch("os_version", "")[/\d+(?:\.\d+)*$/])
bottle_os = MacOSVersion.new(os_version).strip_patch
end
return if bottle_os.nil? || MacOS.version == bottle_os

sdk_path_files = [
lib/"cmake/visp/VISPConfig.cmake",
lib/"cmake/visp/VISPModules.cmake",
lib/"pkgconfig/visp.pc",
]
bottle_sdk_path = MacOS.sdk_for_formula(self, bottle&.tag&.to_macos_version).path
inreplace sdk_path_files, bottle_sdk_path, MacOS.sdk_for_formula(self).path, audit_result: false
old = MacOS.sdk_for_formula(self, bottle_os).path
new = MacOS.sdk_for_formula(self).path
sdk_path_files.each do |sdk_path_file|
# NOTE: Should be `odebug` to match os/mac/keg.rb but brew postinstall doesn't support it
ohai "Changing SDK path in #{sdk_path_file}", " from #{old}\n to #{new}"
inreplace sdk_path_file, old, new, audit_result: false
end
end
end

Expand Down
Loading