# Contributor: Jakub Jirutka # Maintainer: Jakub Jirutka pkgname=ruby-ox _gemname=${pkgname#ruby-} pkgver=2.13.4 pkgrel=0 pkgdesc="A fast XML parser and object serializer for Ruby" url="https://github.com/ohler55/ox" arch="all" license="MIT" depends="ruby-bigdecimal" checkdepends="ruby ruby-test-unit" makedepends="ruby-dev" source="$pkgname-$pkgver.tar.gz::https://github.com/ohler55/$_gemname/archive/v$pkgver.tar.gz gemspec.patch" builddir="$srcdir/$_gemname-$pkgver" build() { gem build $_gemname.gemspec gem install --local \ --install-dir dist \ --ignore-dependencies \ --no-document \ --verbose \ $_gemname cd dist/extensions/*/*/$_gemname-*/ # ox expects ox.so to be in ox/ subdirectory, but does not install it here. mkdir ox && mv *.so ox/ # Needed for tests. cp -l ox/*.so "$builddir"/ext/$_gemname/ } check() { ./test/tests.rb ./test/sax/sax_test.rb > sax_test.log || { tail -n 50 sax_test.log return 1 } } package() { local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')" cd "$builddir"/dist mkdir -p "$gemdir" cp -r extensions gems specifications "$gemdir"/ # Remove unnecessary and duplicated files. cd "$gemdir"/gems/$_gemname-$pkgver rm -r ext/ lib/*.so || true } sha512sums="a97fef40eee3616bab32394340c452138fe1cf5cec92e6457c3b2ce8866f7e5b143ee7e0191af09d96128a2d7a0ee3eb58fbcea16074ce33db8a845867175423 ruby-ox-2.13.4.tar.gz c65e16d1611c64dc640c11f00f2e6ef8c70e3efa68fe479f0d7b5d54a96241fedfb7d0775c9371c7deef0b9dce1de63dbb75cb2e6c5756c7dd066164549da0ed gemspec.patch"