From 47407d0aacab90b77285a671860fe3e748eb6856 Mon Sep 17 00:00:00 2001 From: sshao Date: Mon, 8 Sep 2014 23:57:30 -0500 Subject: [PATCH 1/7] Remove attempt to link xml_ruby in extconf.rb. --- ext/libxslt/extconf.rb | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/ext/libxslt/extconf.rb b/ext/libxslt/extconf.rb index 6cd38e5..0f765a8 100755 --- a/ext/libxslt/extconf.rb +++ b/ext/libxslt/extconf.rb @@ -123,35 +123,5 @@ def crash(str) EOL end - -RUBY_VERSION =~ /(\d+.\d+)/ -minor_version = $1 -paths = ["#{gem_spec.full_gem_path}/lib", - "#{gem_spec.full_gem_path}/lib/#{minor_version}", - "#{gem_spec.full_gem_path}/ext/libxml"] - -# No need to link xml_ruby on OS X -unless RbConfig::CONFIG['host_os'].match(/darwin/) - # Hack to make sure ruby library is *after* xml_ruby library - $LIBS = "#{$LIBRUBYARG_STATIC} #{$LIBS}" - - libraries = ["xml_ruby", # Linux - ":libxml_ruby.so", # mingw - "libxml_ruby-#{RbConfig::CONFIG["arch"]}"] # mswin - - libxml_library = libraries.detect do |library| - find_library(library, "Init_libxml_ruby", *paths) - end - - unless libxml_library - crash(<<-EOL) - Need libxml-ruby - Please install libxml-ruby or specify the path to the gem via: - --with-libxml-ruby=/path/to/libxml-ruby gem - EOL - end - $LIBS.gsub!($LIBRUBYARG_STATIC,'') -end - create_header() create_makefile("libxslt_ruby") From 58205f8185d8f2ef8c57b68730246ea12c30740e Mon Sep 17 00:00:00 2001 From: Sophia Shao Date: Mon, 13 Oct 2014 11:18:45 -0500 Subject: [PATCH 2/7] Add rdoc and rake to gemspec dev dependencies --- libxslt-ruby.gemspec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libxslt-ruby.gemspec b/libxslt-ruby.gemspec index 8c63782..03f307f 100644 --- a/libxslt-ruby.gemspec +++ b/libxslt-ruby.gemspec @@ -36,8 +36,10 @@ Gem::Specification.new do |spec| 'ext/vc/*.vcxproj', 'test/**/*']) spec.test_files = Dir.glob("test/test_*.rb") + spec.add_development_dependency 'rdoc' + spec.add_development_dependency 'rake' spec.add_development_dependency 'rake-compiler' spec.required_ruby_version = '>= 1.9.3' spec.date = DateTime.now spec.rubyforge_project = 'libxslt-ruby' -end \ No newline at end of file +end From b38ef24e7f42f197e6c1bba0932814f0d151bfb7 Mon Sep 17 00:00:00 2001 From: Sophia Shao Date: Mon, 13 Oct 2014 11:20:11 -0500 Subject: [PATCH 3/7] Add Gemfile for travis to install dependencies --- Gemfile | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Gemfile diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..8ff6ebb --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source 'https://rubygems.org' + +# Gem dependencies in gemspec +gemspec From c7effc9223906a3b1a987210634e06f873894b53 Mon Sep 17 00:00:00 2001 From: Sophia Shao Date: Mon, 13 Oct 2014 11:19:49 -0500 Subject: [PATCH 4/7] Add .travis.yml for testing --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..cb1a119 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: ruby +rvm: + - rbx-1.3 + - rbx-2 + - 1.8.7 + - 2.0.0 + - 2.1.2 +script: rake compile:libxslt_ruby && rake test From 9928061aef9d1cbb2cd0180017e768b2c94a64c1 Mon Sep 17 00:00:00 2001 From: sshao Date: Mon, 24 Nov 2014 21:19:31 -0600 Subject: [PATCH 5/7] Revert "Remove attempt to link xml_ruby in extconf.rb." This reverts commit 47407d0aacab90b77285a671860fe3e748eb6856. --- ext/libxslt/extconf.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/ext/libxslt/extconf.rb b/ext/libxslt/extconf.rb index 0f765a8..6cd38e5 100755 --- a/ext/libxslt/extconf.rb +++ b/ext/libxslt/extconf.rb @@ -123,5 +123,35 @@ def crash(str) EOL end + +RUBY_VERSION =~ /(\d+.\d+)/ +minor_version = $1 +paths = ["#{gem_spec.full_gem_path}/lib", + "#{gem_spec.full_gem_path}/lib/#{minor_version}", + "#{gem_spec.full_gem_path}/ext/libxml"] + +# No need to link xml_ruby on OS X +unless RbConfig::CONFIG['host_os'].match(/darwin/) + # Hack to make sure ruby library is *after* xml_ruby library + $LIBS = "#{$LIBRUBYARG_STATIC} #{$LIBS}" + + libraries = ["xml_ruby", # Linux + ":libxml_ruby.so", # mingw + "libxml_ruby-#{RbConfig::CONFIG["arch"]}"] # mswin + + libxml_library = libraries.detect do |library| + find_library(library, "Init_libxml_ruby", *paths) + end + + unless libxml_library + crash(<<-EOL) + Need libxml-ruby + Please install libxml-ruby or specify the path to the gem via: + --with-libxml-ruby=/path/to/libxml-ruby gem + EOL + end + $LIBS.gsub!($LIBRUBYARG_STATIC,'') +end + create_header() create_makefile("libxslt_ruby") From ba15f86b703cae68413b0bef35568f926834af18 Mon Sep 17 00:00:00 2001 From: sshao Date: Mon, 24 Nov 2014 21:35:08 -0600 Subject: [PATCH 6/7] skip linking libxml-ruby if rubyengine is rubinius --- ext/libxslt/extconf.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/libxslt/extconf.rb b/ext/libxslt/extconf.rb index 6cd38e5..af89db6 100755 --- a/ext/libxslt/extconf.rb +++ b/ext/libxslt/extconf.rb @@ -130,8 +130,12 @@ def crash(str) "#{gem_spec.full_gem_path}/lib/#{minor_version}", "#{gem_spec.full_gem_path}/ext/libxml"] +is_osx = RbConfig::CONFIG['host_os'].match(/darwin/) +is_rbx = defined?(RUBY_ENGINE) && (RUBY_ENGINE == "rbx") + # No need to link xml_ruby on OS X -unless RbConfig::CONFIG['host_os'].match(/darwin/) +# Also do not link on rubinius +unless (is_osx or is_rbx) # Hack to make sure ruby library is *after* xml_ruby library $LIBS = "#{$LIBRUBYARG_STATIC} #{$LIBS}" From 6013a7e263490fb62fe968852729abc86b5d14ec Mon Sep 17 00:00:00 2001 From: sshao Date: Mon, 24 Nov 2014 23:18:50 -0600 Subject: [PATCH 7/7] require date in gemspec should not assume that date has already been loaded --- libxslt-ruby.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/libxslt-ruby.gemspec b/libxslt-ruby.gemspec index e821967..87de130 100644 --- a/libxslt-ruby.gemspec +++ b/libxslt-ruby.gemspec @@ -1,4 +1,5 @@ # encoding: utf-8 +require 'date' # Determine the current version of the software version = File.read('ext/libxslt/version.h').match(/\s*RUBY_LIBXSLT_VERSION\s*['"](\d.+)['"]/)[1]