diff --git a/mrbgems/hal-posix-dir/mrbgem.rake b/mrbgems/hal-posix-dir/mrbgem.rake deleted file mode 100644 index 877b110cb..000000000 --- a/mrbgems/hal-posix-dir/mrbgem.rake +++ /dev/null @@ -1,7 +0,0 @@ -MRuby::Gem::Specification.new('hal-posix-dir') do |spec| - spec.license = 'MIT' - spec.authors = 'mruby developers' - spec.summary = 'POSIX HAL for mruby-dir (Linux, macOS, BSD, Unix)' - - spec.add_dependency 'mruby-dir', core: 'mruby-dir' -end diff --git a/mrbgems/hal-win-dir/mrbgem.rake b/mrbgems/hal-win-dir/mrbgem.rake deleted file mode 100644 index 426829dbb..000000000 --- a/mrbgems/hal-win-dir/mrbgem.rake +++ /dev/null @@ -1,7 +0,0 @@ -MRuby::Gem::Specification.new('hal-win-dir') do |spec| - spec.license = 'MIT and MIT-like license' - spec.authors = ['mruby developers', 'Kevlin Henney'] - spec.summary = 'Windows HAL for mruby-dir' - - spec.add_dependency 'mruby-dir', core: 'mruby-dir' -end diff --git a/mrbgems/mruby-dir/mrbgem.rake b/mrbgems/mruby-dir/mrbgem.rake index 71ed21cbd..ed05e14d1 100644 --- a/mrbgems/mruby-dir/mrbgem.rake +++ b/mrbgems/mruby-dir/mrbgem.rake @@ -1,35 +1,4 @@ MRuby::Gem::Specification.new('mruby-dir') do |spec| spec.license = 'MIT and MIT-like license' spec.authors = ['Internet Initiative Japan Inc.', 'Kevlin Henney'] - - # Check if HAL gem is loaded - # HAL gems must be explicitly specified in build config (recommended) or via auto-selection below - spec.build.gems.one? { |g| g.name =~ /^hal-.*-dir$/ } or begin - # No HAL found - determine appropriate error message or auto-load - suggested_hal = if ENV['MRUBY_DIR_HAL'] - ENV['MRUBY_DIR_HAL'] - elsif spec.for_windows? - 'hal-win-dir' - elsif RUBY_PLATFORM =~ /linux|darwin|bsd/ - 'hal-posix-dir' - else - nil - end - - if suggested_hal - # Auto-load HAL gem for convenience (for development) - # This works because HAL gems declare dependency on mruby-dir - warn "mruby-dir: No HAL specified, loading #{suggested_hal} (explicit selection recommended)" - spec.build.gem core: suggested_hal - else - # Unknown platform - fail with helpful message - fail "mruby-dir: No HAL available for platform '#{RUBY_PLATFORM}'.\n" \ - "Please specify HAL gem explicitly in your build config:\n" \ - " conf.gem core: 'hal-posix-dir' # For Linux/macOS/BSD\n" \ - " conf.gem core: 'hal-win-dir' # For Windows\n" \ - "Or set environment variable:\n" \ - " MRUBY_DIR_HAL=hal-myplatform-dir\n" \ - "See mrbgems/mruby-dir/README.md for creating custom HAL." - end - end end diff --git a/mrbgems/hal-posix-dir/src/dir_hal.c b/mrbgems/mruby-dir/ports/posix/dir_hal.c similarity index 90% rename from mrbgems/hal-posix-dir/src/dir_hal.c rename to mrbgems/mruby-dir/ports/posix/dir_hal.c index 2ad1c33c7..898cef32a 100644 --- a/mrbgems/hal-posix-dir/src/dir_hal.c +++ b/mrbgems/mruby-dir/ports/posix/dir_hal.c @@ -173,21 +173,3 @@ mrb_hal_dir_final(mrb_state *mrb) (void)mrb; /* No cleanup needed for POSIX */ } - -/* - * Gem initialization - */ - -void -mrb_hal_posix_dir_gem_init(mrb_state *mrb) -{ - (void)mrb; - /* HAL interface functions are called by mruby-dir gem */ -} - -void -mrb_hal_posix_dir_gem_final(mrb_state *mrb) -{ - (void)mrb; - /* Cleanup handled by mrb_hal_dir_final called from mruby-dir */ -} diff --git a/mrbgems/hal-win-dir/src/dir_hal.c b/mrbgems/mruby-dir/ports/win/dir_hal.c similarity index 84% rename from mrbgems/hal-win-dir/src/dir_hal.c rename to mrbgems/mruby-dir/ports/win/dir_hal.c index db2123951..8bc3b1be2 100644 --- a/mrbgems/hal-win-dir/src/dir_hal.c +++ b/mrbgems/mruby-dir/ports/win/dir_hal.c @@ -214,36 +214,3 @@ mrb_hal_dir_final(mrb_state *mrb) (void)mrb; /* No cleanup needed for Windows */ } - -/* - * Gem initialization - */ - -void -mrb_hal_win_dir_gem_init(mrb_state *mrb) -{ - (void)mrb; - /* HAL interface functions are called by mruby-dir gem */ -} - -void -mrb_hal_win_dir_gem_final(mrb_state *mrb) -{ - (void)mrb; - /* Cleanup handled by mrb_hal_dir_final called from mruby-dir */ -} - -/* -** Portions derived from dirent.c by Kevlin Henney: -** -** Copyright Kevlin Henney, 1997, 2003, 2012. All rights reserved. -** -** Permission to use, copy, modify, and distribute this software and its -** documentation for any purpose is hereby granted without fee, provided -** that this copyright and permissions notice appear in all copies and -** derivatives. -** -** This software is supplied "as is" without express or implied warranty. -** -** But that said, if there are any problems please get in touch. -*/