void-packages/srcpkgs/libucontext/template

45 lines
1.2 KiB
Bash

# Template file for 'libucontext'
pkgname=libucontext
version=0.1.1
revision=1
short_desc="Compatibility layer providing ucontext functions"
maintainer="Peter Bui <pbui@github.bx612.space>"
license="ISC"
homepage="http://github.com/kaniini/libucontext"
distfiles="https://distfiles.dereferenced.org/${pkgname}/${pkgname}-${version}.tar.xz"
only_for_archs="aarch64-musl armv5tel-musl armv6l-musl armv7l-musl i686-musl mips-musl mipshf-musl mipsel-musl mipselhf-musl x86_64-musl"
checksum=0dfe75b3f2d8e0b0b2901f0217bb4ab1baf319a1374a68c5242d776abb797e98
case "${XBPS_TARGET_MACHINE}" in
arm*) export LIBUCONTEXT_ARCH="arm";;
i686*) export LIBUCONTEXT_ARCH="x86";;
*) export LIBUCONTEXT_ARCH="${XBPS_TARGET_MACHINE%%-musl}";;
esac
do_build() {
case "${XBPS_TARGET_MACHINE}" in
i686*) sed -i arch/x86/startcontext.S -e "s;__i686.get_pc_thunk.bx;i686_get_pc_thunk_bx;g" ;;
esac
make ARCH="${LIBUCONTEXT_ARCH}"
}
do_check() {
make ARCH="${LIBUCONTEXT_ARCH}" check
}
do_install() {
make ARCH="${LIBUCONTEXT_ARCH}" DESTDIR="${DESTDIR}/usr" install
}
post_install() {
vlicense LICENSE
}
libucontext-devel_package() {
depends="libucontext>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove "usr/lib/*.so"
}
}