# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=libucontext
pkgver=0.11
pkgrel=0
pkgdesc="Implementation of software-defined threading"
url=" "
arch="all"
license="ISC"
depends=""
makedepends=""
subpackages="$pkgname-dev"
source="https://distfiles.dereferenced.org/libucontext/libucontext-$pkgver.tar.xz"

case "$CTARGET_ARCH" in
aarch64_be)	LIBUCONTEXT_ARCH="aarch64" ;;
arm*)		LIBUCONTEXT_ARCH="arm" ;;
ppc64le)	LIBUCONTEXT_ARCH="ppc64" ;;
pmmx)		LIBUCONTEXT_ARCH="x86" ;;
*)		LIBUCONTEXT_ARCH="$CTARGET_ARCH" ;;
esac

build() {
	make ARCH="$LIBUCONTEXT_ARCH"
}

check() {
	make ARCH="$LIBUCONTEXT_ARCH" check
}

package() {
	make ARCH="$LIBUCONTEXT_ARCH" DESTDIR="$pkgdir" install
}

sha512sums="afc8ea6e03b5f1757aec0035090e0553c58d84c03bab6809cf00df8f12a0a3d5aa6c3516f258f1fb531ff38ba7d39e3f72e450903a159df6e85d22da850cb3bb  libucontext-0.11.tar.xz"