# Contributor: Thomas Kienlen <kommander@laposte.net>
# Maintainer: Thomas Kienlen <kommander@laposte.net>
pkgname=ruby-build
pkgver=20241017
pkgrel=0
pkgdesc="Compile and install Ruby"
url="https://github.com/rbenv/ruby-build"
arch="noarch"
license="MIT"
depends="
	bash
	"
subpackages="
	$pkgname-doc
	$pkgname-runtime
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/rbenv/ruby-build/archive/v$pkgver.tar.gz"
options="!check" # No test suite
install="$pkgname.post-install"

package() {
	PREFIX="$pkgdir/usr" ./install.sh

	install -Dvm644 LICENSE \
		-t "$pkgdir"/usr/share/licenses/$pkgname/
}

runtime() {
	pkgdesc="ruby-build runtime dependencies"

	depends="
		autoconf
		coreutils
		libffi-dev
		linux-headers
		gdbm-dev
		openssl-dev>3
		readline-dev
		yaml-dev
		zlib-dev
		"

	mkdir -p "$subpkgdir"
}

sha512sums="
e78b2d0997845a1bae134f0c3bee9cd46d1346b09292d3591d3ae82d2ecd4396ad9fae5d3b3d3962f2f5a57cf41af0b15a3c5fa9fa503a1a79e23ec11f3b0ac4  ruby-build-20241017.tar.gz
"
