void-packages/srcpkgs/swiften/template

92 lines
2.3 KiB
Bash

# Template file for 'swiften'
pkgname=swiften
version=4.0.3
revision=2
wrksrc="swift-${version}"
hostmakedepends="scons pkg-config"
makedepends="boost-devel openssl-devel libxml2-devel libidn-devel
lua51-devel miniupnpc-devel sqlite-devel"
short_desc="XMPP library for C++"
maintainer="John Regan <john@jrjrtech.com>"
license="GPL-3.0-only"
homepage="http://swift.im/"
distfiles="http://swift.im/git/swift/snapshot/swift-${version}.tar.bz2"
checksum=6a3f93e807afb51f1b8ab6ec8fef379dfcc50ba71fef6abeee7c123348da66b0
patch_args=-Np0
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
makedepends+=" musl-legacy-compat"
fi
CXXFLAGS="-I${XBPS_CROSS_BASE}/usr/include/libxml2 -DBOOST_FILESYSTEM_VERSION=3 -DBOOST_SIGNALS_NO_DEPRECATION_WARNING=1"
_scons_options="assertions=1 build_examples=1 max_jobs=1 optimize=1 debug=0 swiften_dll=1"
# otherwise boost will miscompile and fail to link
case "$XBPS_TARGET_MACHINE" in
ppc*) CXXFLAGS+=" -fPIC";;
esac
post_patch() {
rm -rf 3rdParty/Boost/src
rm -rf 3rdParty/Expat/src
rm -rf 3rdParty/LibIDN/src
rm -rf 3rdParty/LibMiniUPnPc/src
# rm -rf 3rdParty/LibNATPMP/src
rm -rf 3rdParty/Lua/src
rm -rf 3rdParty/SCons
rm -rf 3rdParty/SQLite/sqlite*
rm -rf 3rdParty/ZLib/src
find . \( \
-name '*.py' -o -name SConscript -o -name SConstruct \
\) -exec 2to3 -w {} +
if [ "$CROSS_BUILD" ]; then
vsed -i -e "s,/usr/include,$XBPS_CROSS_BASE&," \
BuildTools/SCons/SConstruct
fi
}
do_build() {
for _llib in $($PKG_CONFIG --libs lua)
do
if [[ "$_llib" = -llua* ]]; then
lua_libname=${_llib#-l}
vsed -i -e "
/lua_libname/s/\"lua\"/\"$lua_libname\"/
" BuildTools/SCons/SConscript.boot
fi
done
CXXFLAGS+=" $($PKG_CONFIG --cflags lua)"
scons \
cc="${CC}" \
cxx="${CXX}" \
linkflags="${LDFLAGS}" \
ccflags="${CXXFLAGS}" \
${_scons_options} \
${make_build_targets}
}
do_install() {
CXXFLAGS+=" $($PKG_CONFIG --cflags lua)"
scons \
cc="${CC}" \
cxx="${CXX}" \
linkflags="${LDFLAGS}" \
ccflags="${CXXFLAGS}" \
${_scons_options} \
SWIFTEN_INSTALLDIR="${DESTDIR}/usr" \
"${DESTDIR}/usr"
# bundled 3rd party BSD-3-Clause
vlicense 3rdParty/LibNATPMP/src/libnatpmp/LICENSE
}
swiften-devel_package() {
short_desc+=" - development files"
depends="${sourcepkg}>=${version}_${revision}"
pkg_install() {
vmove usr/bin
vmove usr/include
vmove usr/lib/*.so
}
}