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>
2022-06-13 21:42:43 +00:00
pkgname=ruby-parser
_gemname="${pkgname#ruby-}"
pkgver=3.1.2.0
2021-07-31 21:50:21 +00:00
pkgrel=1
2022-06-13 21:42:43 +00:00
pkgdesc='A production-ready Ruby parser written in pure Ruby'
2021-07-31 21:50:21 +00:00
arch=('any')
2022-06-13 21:42:43 +00:00
url='https://github.com/whitequark/parser'
2021-07-31 21:50:21 +00:00
license=('MIT')
depends=('ruby' 'ruby-ast')
makedepends=('ruby-rdoc')
options=('!emptydirs')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
2022-06-13 21:42:43 +00:00
sha512sums=('3ca552cb6fda293e3e52f4b9921467a952c4c7a3288428efdb3e7b1383c053fb4858f79cb2f2c9db0303e1c50765c44747e763a970d78cbc8eef2b2567e9d3c3')
b2sums=('f99f82ae66090a8530cd7ad12cc8672f32422b6cb5167679068c29c76485e17af9b15db8b622770e04554c9348cb2ab9f91954eb5ff3a5a528a1f1863df83635')
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
}