diff --git a/ruby-parser/PKGBUILD b/ruby-parser/PKGBUILD new file mode 100644 index 0000000..7e7f0d4 --- /dev/null +++ b/ruby-parser/PKGBUILD @@ -0,0 +1,40 @@ +# Maintainer: George Rawlinson + +_gemname=parser +pkgname=ruby-$_gemname +pkgver=3.0.2.0 +pkgrel=1 +pkgdesc="A production-ready Ruby parser written in pure Ruby" +arch=('any') +url="https://github.com/whitequark/parser" +license=('MIT') +depends=('ruby' 'ruby-ast') +makedepends=('ruby-rdoc') +options=('!emptydirs') +source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem") +noextract=("$_gemname-$pkgver.gem") +b2sums=('efb8dd3ccfa24d02b3e85e92fcd08dea34bbc8a650842752529606a3e603027688d762ef64aa8f7007ed94c058d8d5b31e36c674394a82d04ce79014378add29') + +package() { + local _gemdir="$(ruby -e'puts Gem.default_dir')" + + gem install \ + --verbose \ + --ignore-dependencies \ + --no-user-install \ + --install-dir "$pkgdir/$_gemdir" \ + --bindir "$pkgdir/usr/bin" \ + "$_gemname-$pkgver.gem" + + # delete cache + cd "$pkgdir/$_gemdir" + rm -vrf cache + + # delete unnecessary files & folders + cd "gems/$_gemname-$pkgver" + rm -vrf "$_gemname.gemspec" + + # move license + install -vd "$pkgdir/usr/share/licenses/$pkgname" + mv -vt "$pkgdir/usr/share/licenses/$pkgname" LICENSE.txt +}