void-packages/srcpkgs/nspr/template

47 lines
1.5 KiB
Bash

# Template file for 'nspr'
pkgname=nspr
version=4.35
revision=1
build_wrksrc=nspr
build_style=gnu-configure
configure_args="--enable-optimize --enable-debug --enable-ipv6"
makedepends="zlib-devel"
short_desc="NetScape Portable Runtime"
maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
license="MPL-2.0"
homepage="http://www.mozilla.org/projects/nspr/"
distfiles="${MOZILLA_SITE}/nspr/releases/v${version}/src/${pkgname}-${version}.tar.gz"
checksum=7ea3297ea5969b5d25a5dd8d47f2443cda88e9ee746301f6e1e1426f8a6abc8f
CFLAGS="-D_PR_POLL_AVAILABLE -D_PR_HAVE_OFF64_T -D_PR_INET6 -D_PR_HAVE_INET_NTOP -D_PR_HAVE_GETHOSTBYNAME2 -D_PR_HAVE_GETADDRINFO -D_PR_INET6_PROBE"
if [ "$XBPS_TARGET_WORDSIZE" = 64 ]; then
configure_args+=" --enable-64bit"
fi
if [ "$CROSS_BUILD" ]; then
# nspr misused host in place of build
configure_args+=" --host=$XBPS_TRIPLET --target=$XBPS_CROSS_TRIPLET"
export HOST_CC="$CC_FOR_BUILD"
export HOST_CFLAGS="$CFLAGS_FOR_BUILD"
export HOST_LDFLAGS="$LDFLAGS_FOR_BUILD"
fi
post_install() {
sed -i "s|\(-specs=.*hardened-ld\)||g" ${DESTDIR}/usr/bin/nspr-config
ln -s nspr.pc ${DESTDIR}/usr/lib/pkgconfig/mozilla-nspr.pc
rm -r ${DESTDIR}/usr/bin/{compile-et.pl,prerr.properties} \
${DESTDIR}/usr/include/nspr/md
}
nspr-devel_package() {
depends="nspr>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/bin
vmove usr/lib/pkgconfig
vmove usr/share/aclocal
vmove "usr/lib/*.a"
}
}