rmpkg: ruby-unicode-display_width

This commit is contained in:
George Rawlinson 2022-10-16 20:08:47 +13:00
parent ed87f65c35
commit a5c6471503
Signed by: grawlinson
GPG key ID: E0959FEA8B550539

View file

@ -1,49 +0,0 @@
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
pkgname=ruby-unicode-display_width
_gemname="${pkgname#ruby-}"
pkgver=2.3.0
pkgrel=1
pkgdesc='Determines the monospace display width of a string in Ruby'
arch=('any')
url='https://github.com/janlelis/unicode-display_width'
license=('MIT')
depends=('ruby')
makedepends=('git' 'ruby-rdoc')
options=('!emptydirs')
_commit='64497bb7886d00dfbc56b4b95aba93633ad5b4d3'
source=("$pkgname::git+$url#commit=$_commit")
b2sums=('SKIP')
pkgver() {
cd "$pkgname"
git describe --tags | sed 's/^v//'
}
build() {
cd "$pkgname"
gem build "$_gemname.gemspec"
}
package() {
cd "$pkgname"
local _gemdir="$(ruby -e'puts Gem.default_dir')"
gem install \
--local \
--verbose \
--ignore-dependencies \
--no-user-install \
--install-dir "$pkgdir/$_gemdir" \
--bindir "$pkgdir/usr/bin" \
"$_gemname-$pkgver.gem"
# delete cache
rm -vrf "$pkgdir/$_gemdir/cache"
# license
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" MIT-LICENSE.txt
}