commit b37f506cfa194cae0e619711000a804b562cff19
parent 25ebff1313759b89bf53f2863f78934e8b37ce9c
Author: Scott Bonds <scott@ggr.com>
Date: Sun, 14 Sep 2014 15:57:04 -0700
conditionally install xapian-ruby when not on OpenBSD
Diffstat:
2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/ext/mkrf_conf.rb b/ext/mkrf_conf.rb
@@ -0,0 +1,24 @@
+require 'rubygems'
+require 'rubygems/command.rb'
+require 'rubygems/dependency_installer.rb'
+require 'rbconfig'
+
+begin
+ Gem::Command.build_args = ARGV
+rescue NoMethodError
+end
+
+inst = Gem::DependencyInstaller.new
+begin
+ if RbConfig::CONFIG['arch'].include?('openbsd')
+ # TODO: in theory, we could put the OpenBSD install steps here
+ # see https://github.com/sup-heliotrope/sup/wiki/Installation%3A-OpenBSD
+ else
+ inst.install "xapian-ruby", "~> 1.2.15"
+ end
+rescue
+ exit(1)
+end
+f = File.open(File.join(File.dirname(__FILE__), "Rakefile"), "w") # create dummy rakefile to indicate success
+f.write("task :default\n")
+f.close
diff --git a/sup.gemspec b/sup.gemspec
@@ -35,7 +35,8 @@ SUP: please note that our old mailing lists have been shut down,
s.required_ruby_version = '>= 1.9.3'
- s.add_runtime_dependency "xapian-ruby", "~> 1.2.15"
+ s.extensions = 'ext/mkrf_conf.rb'
+
s.add_runtime_dependency "ncursesw", "~> 1.4.0"
s.add_runtime_dependency "rmail-sup", "~> 1.0.1"
s.add_runtime_dependency "highline"