arch-pkgs/ruby-unicode-display_width/PKGBUILD

50 lines
1 KiB
Text
Raw Normal View History

# 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
}