diff options
| author | Charles Oliver Nutter <headius@headius.com> | 2024-01-18 19:45:05 -0600 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-01-22 00:12:45 +0000 |
| commit | c6b548accbd211b69b0611b584e7673147aaea41 (patch) | |
| tree | 29082554a4e3375f52edf8e52e533446d7b23eac /ext | |
| parent | e2e15ddd676f4ec69589599bad0961c435c5aba5 (diff) | |
[ruby/nkf] Add JRuby extension to the gem
This pulls in the nkf extension implementation from JRuby. The
build and load logic has been updated along the same lines as
ruby/digest and the gem appears to build correctly for the -java
platform.
Fixes https://github.com/ruby/nkf/pull/13
https://github.com/ruby/nkf/commit/18f57f36ed
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/nkf/nkf.gemspec | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/ext/nkf/nkf.gemspec b/ext/nkf/nkf.gemspec index 097a9485ed..7fb5cc3be0 100644 --- a/ext/nkf/nkf.gemspec +++ b/ext/nkf/nkf.gemspec @@ -11,8 +11,8 @@ end Gem::Specification.new do |spec| spec.name = "nkf" spec.version = source_version - spec.authors = ["NARUSE Yui"] - spec.email = ["naruse@airemix.jp"] + spec.authors = ["NARUSE Yui", "Charles Oliver Nutter"] + spec.email = ["naruse@airemix.jp", "headius@headius.com"] spec.summary = %q{Ruby extension for Network Kanji Filter} spec.description = %q{Ruby extension for Network Kanji Filter} @@ -28,8 +28,16 @@ Gem::Specification.new do |spec| spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } end + + if Gem::Platform === spec.platform and spec.platform =~ 'java' or RUBY_ENGINE == 'jruby' + spec.platform = 'java' + + spec.files += Dir["lib/nkf.jar"] + else + spec.extensions = ["ext/nkf/extconf.rb"] + end + spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.extensions = ["ext/nkf/extconf.rb"] end |
