Skip to content

Commit

Permalink
Update to mini_portile2 v2.8.3
Browse files Browse the repository at this point in the history
This pulls in flavorjones/mini_portile#129.
When cross-compiling Windows targets with cmake in a Linux
environment, the MSYS generator may not be available. Supplying -G
MSYS will cause the build to fail.
  • Loading branch information
stanhu authored and mudge committed Sep 13, 2023
1 parent 67e0f1c commit 288902a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
19 changes: 1 addition & 18 deletions ext/re2/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

PACKAGE_ROOT_DIR = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))

REQUIRED_MINI_PORTILE_VERSION = "~> 2.8.2" # keep this version in sync with the one in the gemspec
REQUIRED_MINI_PORTILE_VERSION = "~> 2.8.3" # keep this version in sync with the one in the gemspec

RE2_HELP_MESSAGE = <<~HELP
USAGE: ruby #{$0} [options]
Expand Down Expand Up @@ -135,22 +135,6 @@ def cmake_compile_flags(host)
]
end

# By default, mini_portile2 might add an unnecessary option:
# https://github.com/flavorjones/mini_portile/blob/5084a2aeab12076f534cf0cabc81a4d5f84b5c25/lib/mini_portile2/mini_portile_cmake.rb#L17
# See https://github.com/flavorjones/mini_portile/issues/127.
def delete_cmake_generator_option!(options)
indices = []

options.each_with_index do |element, index|
if element == '-G' && index + 1 < options.length
indices << index
indices << index + 1
end
end

indices.reverse_each { |index| options.delete_at(index) }
end

#
# main
#
Expand Down Expand Up @@ -277,7 +261,6 @@ def process_recipe(name, version)
'-DCMAKE_INSTALL_LIBDIR=lib'
]
recipe.configure_options += cmake_compile_flags(recipe.host)
delete_cmake_generator_option!(recipe.configure_options)

yield recipe

Expand Down
2 changes: 1 addition & 1 deletion re2.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ Gem::Specification.new do |s|
s.add_development_dependency "rake-compiler", "~> 1.2.1"
s.add_development_dependency "rake-compiler-dock", "~> 1.3.0"
s.add_development_dependency("rspec", "~> 3.2")
s.add_runtime_dependency("mini_portile2", "~> 2.8.2") # keep version in sync with extconf.rb
s.add_runtime_dependency("mini_portile2", "~> 2.8.3") # keep version in sync with extconf.rb
end

0 comments on commit 288902a

Please sign in to comment.