arch-pkgs/ruby-parser/PKGBUILD

42 lines
1.2 KiB
Text
Raw Normal View History

2021-07-31 21:50:21 +00:00
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
_gemname=parser
pkgname=ruby-$_gemname
pkgver=3.1.1.0
2021-07-31 21:50:21 +00:00
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")
sha512sums=('687cbf0eba36dc83d0ad55346da070683800762a4cf7b6c33f8866a32aa6bf07fb531400ce3d5d323854c737746df3899fe39d319127f23736736e0cc240c832')
b2sums=('9341fae497858bf33a2018bf7bf76b59ad9044deb62319a57f37ad4757ed4df7222f4a6bd7741d2b57a31c32149f0cc87fb851b9411311f64fe88998ce0e8e71')
2021-07-31 21:50:21 +00:00
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
}