Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 10 additions & 5 deletions mrbgems/mruby-regexp/mrbgem.rake
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,15 @@ MRuby::Gem::Specification.new('mruby-regexp') do |spec|
# patterns (one that /i folds them, the other that /i refuses to compile
# them), so each belongs to exactly one of the two builds. Everything /i
# does the same way in both is in the unconditional test files and
# always runs.
if build.cc.defines.include?('MRB_REGEXP_UNICODE_CASE')
spec.test_rbfiles -= ["#{spec.dir}/test/ascii_case.rb"]
else
spec.test_rbfiles -= ["#{spec.dir}/test/unicode_case.rb"]
# always runs. What the build defines can only be asked once every gem has
# had its say, which is what `build_settings` waits for; this gem sets no
# build command in the block above, so the reset that comes with it drops
# nothing.
spec.build_settings do
if build.has_define?('MRB_REGEXP_UNICODE_CASE')
spec.test_rbfiles -= ["#{spec.dir}/test/ascii_case.rb"]
else
spec.test_rbfiles -= ["#{spec.dir}/test/unicode_case.rb"]
end
end
end
74 changes: 40 additions & 34 deletions mrbgems/mruby-task/mrbgem.rake
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,50 @@ MRuby::Gem::Specification.new('mruby-task') do |spec|
# Enable task scheduler globally (required for vm.c integration)
spec.build.defines << 'MRB_USE_TASK_SCHEDULER'

if spec.for_windows?
spec.linker.libraries << "winmm"
end
# What the build defines can only be asked once every gem has had its say,
# which is what `build_settings` waits for. The reset it comes with drops
# any build command set outside it, so the linker library and the
# pkg-config query below sit in here too.
spec.build_settings do
if spec.for_windows?
spec.linker.libraries << "winmm"
end

ports = spec.build.effective_ports
ports = spec.build.effective_ports

# ports/glib/ needs glib-2.0 (GSource, GMainContext, GRecMutex) and
# gthread-2.0 (GThread). On modern distros gthread-2.0 is a transparent
# alias for glib-2.0; on older ones it's a separate .pc that pulls in
# -lpthread, so query it separately.
if ports.include?('glib')
unless spec.search_package('glib-2.0') && spec.search_package('gthread-2.0')
abort <<~MSG
[mruby-task] conf.ports :glib selected but pkg-config could not find
glib-2.0 / gthread-2.0. Install the GLib development headers
(Debian/Ubuntu: libglib2.0-dev; Fedora: glib2-devel; Arch: glib2;
macOS Homebrew: glib). For non-default install locations, set
PKG_CONFIG_PATH before invoking rake.
MSG
# ports/glib/ needs glib-2.0 (GSource, GMainContext, GRecMutex) and
# gthread-2.0 (GThread). On modern distros gthread-2.0 is a transparent
# alias for glib-2.0; on older ones it's a separate .pc that pulls in
# -lpthread, so query it separately.
if ports.include?('glib')
unless spec.search_package('glib-2.0') && spec.search_package('gthread-2.0')
abort <<~MSG
[mruby-task] conf.ports :glib selected but pkg-config could not find
glib-2.0 / gthread-2.0. Install the GLib development headers
(Debian/Ubuntu: libglib2.0-dev; Fedora: glib2-devel; Arch: glib2;
macOS Homebrew: glib). For non-default install locations, set
PKG_CONFIG_PATH before invoking rake.
MSG
end
end
end

# Optional demo tool that exercises the GLib HAL end-to-end (basic
# scheduling, priority ordering, timeslice preemption, auto-execution
# under a foreign GLib main loop). Default off; opt in from your
# build_config with:
#
# conf.cc.defines << 'MRB_TASK_BUILD_DEMO'
# conf.ports :glib
# conf.gem core: 'mruby-task'
#
# When enabled, `rake` produces bin/mruby-task-demo from
# tools/mruby-task-demo/. The define is only inspected here -- the
# demo's C source does not condition on it.
if spec.build.cc.defines.include?('MRB_TASK_BUILD_DEMO')
unless ports.include?('glib')
abort '[mruby-task] MRB_TASK_BUILD_DEMO requires conf.ports :glib'
# Optional demo tool that exercises the GLib HAL end-to-end (basic
# scheduling, priority ordering, timeslice preemption, auto-execution
# under a foreign GLib main loop). Default off; opt in from your
# build_config with:
#
# conf.cc.defines << 'MRB_TASK_BUILD_DEMO'
# conf.ports :glib
# conf.gem core: 'mruby-task'
#
# When enabled, `rake` produces bin/mruby-task-demo from
# tools/mruby-task-demo/. The define is only inspected here -- the
# demo's C source does not condition on it.
if build.has_define?('MRB_TASK_BUILD_DEMO')
unless ports.include?('glib')
abort '[mruby-task] MRB_TASK_BUILD_DEMO requires conf.ports :glib'
end
spec.bins = %w(mruby_task_demo)
end
spec.bins = %w(mruby_task_demo)
end
end
Loading