# Distributed under the terms of the GNU General Public License v2 # Copyright 2018 Gluzskiy Alexandr SCM_REPOSITORY="git://swift.im/swift" if ever is_scm; then SCM_BRANCH="swift-4.x" else SCM_TAG=swift-${PV} fi require scons scm-git export_exlib_phases src_prepare src_install SUMMARY="Just a perfect C++ XMPP library" HOMEPAGE="http://swift.im/" SLOT="0" LICENCES="GPL-3" MYOPTIONS=" avahi ( providers: libressl openssl ) [[ number-selected = exactly-one ]] " DEPENDENCIES=" build+run: dev-libs/boost[>=1.65] dev-libs/expat dev-libs/libxml2:= net-dns/libidn[>=1.10] net-libs/miniupnpc sys-libs/zlib avahi? ( net-dns/avahi ) providers:libressl? ( dev-libs/libressl:= ) providers:openssl? ( dev-libs/openssl ) build: sys-apps/sed " DEFAULT_SRC_PREPARE_PATCHES=( "${FILES}"/boost.patch "${FILES}"/sconstruct.patch "${FILES}"/ranlib.patch ) swiften_src_prepare() { edo pushd 3rdParty edo rm -rf Boost CAres DocBook Expat LCov LibIDN OpenSSL SCons SQLite ZLib edo popd edo rm -rf Swiften/Examples default edo sed -i -e "s/\"ranlib\"/\"$(exhost --target)-ranlib\"/g" BuildTools/SCons/SConscript.boot } BASE_OPTIONS=( cc=$(exhost --target)-cc cxx=$(exhost --target)-c++ ar=$(exhost --target)-ar link=$(exhost --target)-c++ swiften_dll=1 allow_warnings=1 optimize=1 Swiften ) SCONS_SRC_CONFIGURE_PARAMS=( "${BASE_OPTIONS[@]}" ) SCONS_SRC_COMPILE_PARAMS=( "${BASE_OPTIONS[@]}" ) SCONS_SRC_INSTALL_PARAMS=( "${BASE_OPTIONS[@]}" ) swiften_src_install() { escons --config=cache \ "${SCONS_SRC_INSTALL_PARAMS[@]}" \ SWIFTEN_INSTALLDIR="${IMAGE}"/usr/$(exhost --target) \ SWIFTEN_LIBDIR="${IMAGE}"/usr/$(exhost --target)/lib \ "${IMAGE}"/usr/$(exhost --target) }