void-packages/srcpkgs/libucontext/template

59 lines
1.7 KiB
Bash

# Template file for 'libucontext'
pkgname=libucontext
version=1.2
revision=1
archs="*-musl"
short_desc="Compatibility layer providing ucontext functions"
maintainer="Orphaned <orphan@voidlinux.org>"
license="ISC"
homepage="https://github.com/kaniini/libucontext"
changelog="https://raw.githubusercontent.com/kaniini/libucontext/master/NEWS"
distfiles="https://github.com/kaniini/libucontext/archive/refs/tags/libucontext-${version}.tar.gz"
checksum=937fba9d0beebd7cf957b79979b19fe3a29bb9c4bfd25e869477d7154bbf8fd3
case "${XBPS_TARGET_MACHINE}" in
x86_64*) _luctx_arch="x86_64" ;;
i686*) _luctx_arch="x86" ;;
aarch64*) _luctx_arch="aarch64" ;;
arm*) _luctx_arch="arm" ;;
ppc64*) _luctx_arch="ppc64" ;;
ppc*) _luctx_arch="ppc" ;;
mips*64*) _luctx_arch="mips64" ;;
mips*) _luctx_arch="mips" ;;
riscv64*) _luctx_arch="riscv64" ;;
s390x*) _luctx_arch="s390x" ;;
*) broken="libucontext not available for ${XBPS_TARGET_MACHINE}";;
esac
# we provide our own CFLAGS, which overwrite all of theirs
export CFLAGS=" -DEXPORT_UNPREFIXED"
do_build() {
make ARCH="${_luctx_arch}" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
}
do_check() {
make ARCH="${_luctx_arch}" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" check
}
do_install() {
make ARCH="${_luctx_arch}" DESTDIR="${DESTDIR}" LIBDIR="/usr/lib" install
# missing from release?
ln -s libucontext_posix.so.1 ${DESTDIR}/usr/lib/libucontext_posix.so
}
post_install() {
vlicense LICENSE
}
libucontext-devel_package() {
depends="libucontext>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
vmove "usr/lib/*.so"
vmove "usr/lib/*.a"
}
}