# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=ruby-rouge
_gemname=rouge
pkgver=4.2.1
pkgrel=0
pkgdesc="A pure Ruby code highlighter that is compatible with Pygments"
url="https://github.com/rouge-ruby/rouge"
arch="noarch"
license="MIT AND BSD-2-Clause"
depends="ruby"
checkdepends="ruby-minitest ruby-rake"
source="https://github.com/rouge-ruby/rouge/archive/v$pkgver/ruby-rouge-$pkgver.tar.gz"
builddir="$srcdir/$_gemname-$pkgver"
options="!check"  # FIXME: run tests

build() {
	gem build $_gemname.gemspec
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"
	local geminstdir="$gemdir/gems/$_gemname-$pkgver"

	gem install \
		--local \
		--install-dir "$gemdir" \
		--bindir "$pkgdir/usr/bin" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	# Remove unnecessary files and rubbish...
	cd "$gemdir"
	rm -r cache build_info doc extensions

	rm "$geminstdir"/Gemfile
}

sha512sums="
3545e41e5815acf96fc2e48531bebf50424425bbc13816daf03376882f41319905db6fee609b2bea5c629c6056cb50ae40dd7e3dcd088cc7403506cbde5351f7  ruby-rouge-4.2.1.tar.gz
"
