| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
PACKAGE_ROOT_DIR = File.expand_path('../..', __dir__) |
| 12 |
REQUIRED_MINI_PORTILE_VERSION = '~> 2.8.9' |
| 13 |
|
| 14 |
def load_recipes |
| 15 |
require 'yaml' |
| 16 |
dependencies = YAML.load_file(File.join(PACKAGE_ROOT_DIR, 'dependencies.yml')) |
| 17 |
|
| 18 |
abseil_recipe = build_recipe('abseil', dependencies['abseil']['version']) do |recipe| |
| 19 |
recipe.files = [{ |
| 20 |
url: "https://github.com/abseil/abseil-cpp/archive/refs/tags/#{recipe.version}.tar.gz", |
| 21 |
sha256: dependencies['abseil']['sha256'] |
| 22 |
}] |
| 23 |
end |
| 24 |
|
| 25 |
re2_recipe = build_recipe('libre2', dependencies['libre2']['version']) do |recipe| |
| 26 |
recipe.files = [{ |
| 27 |
url: "https://github.com/google/re2/releases/download/#{recipe.version}/re2-#{recipe.version}.tar.gz", |
| 28 |
sha256: dependencies['libre2']['sha256'] |
| 29 |
}] |
| 30 |
end |
| 31 |
|
| 32 |
[abseil_recipe, re2_recipe] |
| 33 |
end |
| 34 |
|
| 35 |
def build_recipe(name, version) |
| 36 |
require 'rubygems' |
| 37 |
gem('mini_portile2', REQUIRED_MINI_PORTILE_VERSION) |
| 38 |
require 'mini_portile2' |
| 39 |
|
| 40 |
MiniPortileCMake.new(name, version).tap do |recipe| |
| 41 |
recipe.target = File.join(PACKAGE_ROOT_DIR, 'ports') |
| 42 |
recipe.configure_options += [ |
| 43 |
|
| 44 |
'-DCMAKE_CXX_STANDARD=17', |
| 45 |
|
| 46 |
'-DCMAKE_POSITION_INDEPENDENT_CODE=ON', |
| 47 |
|
| 48 |
'-DCMAKE_INSTALL_LIBDIR=lib', |
| 49 |
'-DCMAKE_CXX_VISIBILITY_PRESET=hidden' |
| 50 |
] |
| 51 |
|
| 52 |
yield recipe |
| 53 |
end |
| 54 |
end |