diff options
Diffstat (limited to 'repo/ruby-nokogiri/ruby-nokogiri.xibuild')
-rw-r--r-- | repo/ruby-nokogiri/ruby-nokogiri.xibuild | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/repo/ruby-nokogiri/ruby-nokogiri.xibuild b/repo/ruby-nokogiri/ruby-nokogiri.xibuild new file mode 100644 index 0000000..dec12d1 --- /dev/null +++ b/repo/ruby-nokogiri/ruby-nokogiri.xibuild @@ -0,0 +1,62 @@ +#!/bin/sh + +NAME="ruby-nokogiri" +DESC="An HTML, XML, SAX, and Reader parser" + +MAKEDEPS="libxml2 libxslt ruby ruby-mini_portile2" + +_gemname=${pkgname#ruby-} + +PKG_VER=1.13.4 +SOURCE="https://github.com/sparklemotion/$_gemname/archive/v$PKG_VER/$_gemname-$PKG_VER.tar.gz" + +ADDITIONAL=" +gemspec-fix-deps.patch +shutdown-libxml2-warning.patch +test-helper-remove-unnecessary-deps.patch +" + +build() { + gem build $_gemname.gemspec + gem install \ + --local \ + --install-dir dist \ + --ignore-dependencies \ + --no-document \ + --verbose \ + $_gemname-$PKG_VER.gem -- \ + --use-system-libraries + + # Remove unnecessary files and rubbish... + find dist/extensions/ -name mkmf.log -delete + cd dist/gems/$_gemname-$PKG_VER/ + rm -rf ext/ patches/ + rm ./*.md ./*.yml + rm lib/*.jar + rm lib/nokogiri/*.so + rm lib/nokogiri/css/*.rex lib/nokogiri/css/*.y +} + +check() { + local extpath=$(dirname dist/extensions/*/*/$_gemname-$PKG_VER/gem_make.out) + + case "$CARCH" in + # Fix NotImplementedError: Compaction isn't available on this platform. + ppc64le) export NOKOGIRI_TEST_GC_LEVEL=major;; + esac + + # Note: This is based on Fedora package. + LANG="C.UTF-8" RUBYLIB=".:dist/gems/$_gemname-$PKG_VER/lib:test:$extpath" ruby \ + -e 'require "test/helper"' \ + -e 'Dir.glob("test/**/test_*.rb") {|f| require f }' +} + +package() { + local gemdir="$PKG_DEST/$(ruby -e 'puts Gem.default_dir')" + + cd "$BUILD_ROOT"/dist + + mkdir -p "$gemdir" + cp -r bin extensions gems specifications "$gemdir"/ +} + |