# Template file for 'oils-for-unix'
pkgname=oils-for-unix
version=0.34.0
revision=1
build_style=gnu-configure
configure_args="$(vopt_with readline) --readline=$XBPS_CROSS_BASE"
makedepends="$(vopt_if readline readline-devel)"
short_desc="New unix shell with JSON-compatible structured data"
maintainer="meator <meator.dev@gmail.com>"
license="Apache-2.0"
homepage="https://oils.pub/"
distfiles="https://oils.pub/download/oils-for-unix-${version}.tar.gz"
checksum=469018ef475a1ca9e8397c02f75b2dc63882a4a2e20d77a303d74a728ae31a22
register_shell="/usr/bin/osh /usr/bin/ysh"
conflicts="oil"

build_options="readline"
build_options_default="readline"

do_build() {
	# OILS_PARALLEL_BUILD affects only the first (largest) TU,
	# everything else is build sequentially.
	if [ "$XBPS_MAKEJOBS" -eq 1 ]; then
		export OILS_PARALLEL_BUILD=0
	else
		export OILS_PARALLEL_BUILD=1
	fi
	_build/oils.sh --cxx "$CXX"
}

do_install() {
	# Build dir embeds the compiler name in it.
	DESTDIR="$DESTDIR" ./install _bin/$CXX-opt-sh/oils-for-unix
}
