addpkg: ruby-parser 3.0.2.0-1

This commit is contained in:
George Rawlinson 2021-07-31 21:50:21 +00:00
parent 855be1230f
commit b0a58b602f
Signed by: grawlinson
GPG key ID: E0959FEA8B550539

40
ruby-parser/PKGBUILD Normal file
View file

@ -0,0 +1,40 @@
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
_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
}