3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/ruby-modules/gem-config/xapian-Rakefile

34 lines
780 B
Plaintext
Raw Normal View History

2015-01-21 20:20:42 +00:00
# encoding: utf-8
# Install the xapian binaries into the lib folder of the gem
require 'rbconfig'
c = RbConfig::CONFIG
source_dir = 'xapian_source'
bindings = Dir["#{source_dir}/xapian-bindings-*"].first
bindings = File.basename(bindings, ".tar.xz")
task :default do
2019-04-30 19:13:18 +01:00
sh "tar -xJf #{source_dir}/#{bindings}.tar.xz"
2015-01-21 20:20:42 +00:00
prefix = Dir.pwd
ENV['LDFLAGS'] = "-L#{prefix}/lib"
2019-04-30 19:13:18 +01:00
sh "mkdir -p lib"
2015-01-21 20:20:42 +00:00
Dir.chdir bindings do
ENV['RUBY'] ||= "#{c['bindir']}/#{c['RUBY_INSTALL_NAME']}"
2019-04-30 19:13:18 +01:00
sh "./configure --prefix=#{prefix} --exec-prefix=#{prefix} --with-ruby"
sh "make clean all"
2015-01-21 20:20:42 +00:00
end
2019-04-30 19:13:18 +01:00
sh "cp -r #{bindings}/ruby/.libs/_xapian.* lib"
sh "cp #{bindings}/ruby/xapian.rb lib"
2015-01-21 20:20:42 +00:00
2019-04-30 19:13:18 +01:00
sh "rm lib/*.la"
sh "rm lib/*.lai"
2015-01-21 20:20:42 +00:00
2019-04-30 19:13:18 +01:00
sh "rm -R #{bindings}"
sh "rm -R #{source_dir}"
2015-01-21 20:20:42 +00:00
end