Skip to content

Commit

Permalink
fix MacOSX setup and CI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mcorino committed Jan 28, 2024
1 parent 161c1f1 commit e8c217c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ jobs:
if: matrix.wxr_type != 'gem'
run: |
if [ "${{ matrix.wxw_type }}" == "embed" ]; then
bundle exec rake configure WITH_WXWIN=1
bundle exec rake configure WITH_WXWIN=1 WXRUBY_AUTOINSTALL=1
elif [ "${{ matrix.wxw_type }}" == "develop" ]; then
bundle exec rake configure WXWIN=$WXWIN_INSTALL WXXML=$WXWIDGETS_ROOT/docs/doxygen/out/xml WXRUBY_VERBOSE=1
else
Expand Down
15 changes: 8 additions & 7 deletions rakelib/lib/config/pkgman/macosx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ def do_install(pkgs)
end
# now check if we need any other packages (which need Homebrew or MacPorts)
if rc && !pkgs.empty?
# Has Ruby been installed through Homebrew?
if !is_root? && system('command -v brew>/dev/null') && expand('brew list -1 2>/dev/null').strip.split("\n").include?('ruby')
pkgs.each { |pkg| rc &&= sh("brew install #{pkg}") }
elsif system('command -v port>/dev/null') &&
(ruby_info = expand('port -q installed installed').strip.split("\n").find { |ln| ln.strip =~ /\Aruby\d+\s/ }) # or through MacPorts
# Has Ruby been installed through MacPorts?
if system('command -v port>/dev/null') &&
(ruby_info = expand('port -q installed installed').strip.split("\n").find { |ln| ln.strip =~ /\Aruby\d+\s/ })
# this is really crap; with MacPorts we need to install swig-ruby instead of simply swig
# which for whatever nonsensical reason will pull in another (older) Ruby version (probably 2.3 or such)
# although SWIG's Ruby support is version agnostic and has no binary bindings
Expand All @@ -76,11 +74,14 @@ def do_install(pkgs)
# just run without sudo as we either have root privileges for root-installed MacPorts or
# we're running without root privileges for user-installed MacPorts
pkgs.each { |pkg| rc &&= sh("port install #{pkg}") }
elsif !is_root? && system('command -v brew>/dev/null') # or are we running without root privileges and have Homebrew installed?
pkgs.each { |pkg| rc &&= sh("brew install #{pkg}") }
else
$stderr.puts <<~__ERROR_TXT
ERROR: Unsupported Ruby installation. wxRuby3 requires a Homebrew or MacPorts installed Ruby version.
ERROR: Unsupported Ruby installation. wxRuby3 requires either a
MacPorts installed Ruby version or must have Homebrew installed.
Install Ruby using either Homebrew or MacPorts and try again.
Install either Homebrew or MacPorts and try again.
__ERROR_TXT
exit(1)
end
Expand Down

0 comments on commit e8c217c

Please sign in to comment.