# Distributed under the terms of the GNU General Public License v2 SCM_REPOSITORY="https://github.com/psi-im/psi.git" SCM_EXTERNAL_REFS=" src/libpsi:libpsi iris:iris 3rdparty/qhttp:qhttp 3rdparty/http-parser:httpparser " SCM_SECONDARY_REPOSITORIES=" iris libpsi qhttp httpparser psiplus resources psiplusl10n " SCM_iris_REPOSITORY="https://github.com/psi-im/iris.git" SCM_libpsi_REPOSITORY="https://github.com/psi-im/libpsi.git" SCM_qhttp_REPOSITORY="https://github.com/psi-im/qhttp.git" SCM_httpparser_REPOSITORY="https://github.com/nodejs/http-parser.git" SCM_psiplus_REPOSITORY="https://github.com/psi-plus/main.git" SCM_resources_REPOSITORY="https://github.com/psi-plus/resources.git" #SCM_l10n_REPOSITORY="https://github.com/psi-im/psi-l10n.git" SCM_psiplusl10n_REPOSITORY="https://github.com/psi-plus/psi-plus-l10n.git" require scm-git require qmake [ slot=5 ] DOWNLOADS="" SLOT="0" PLATFORMS="~amd64 ~x86" SUMMARY="Qt XMPP client" HOMEPAGE="http://psi-im.org/" LANGS="be bg ca cs de en eo es et fa fi fr he hu it ja kk mk nl pl pt pt_BR ru sk sl sr@latin sv sw uk ur_PK vi zh_CN zh_TW" MYOPTIONS=" crypt debug doc ( providers: aspell hunspell enchant ) [[ number-selected = at-most-one ]] extras ( sql iconsets ) [[ *requires = extras ]] jingle ( providers: webengine webkit ) [[ number-selected = at-most-one ]] webp whiteboarding xscreensaver linguas: ( ${LANGS} ) " DEPENDENCIES=" build+run: app-crypt/qca[qt5] crypt? ( app-crypt/qca[gnupg] ) jingle? ( net-im/psimedia[extras?] ) webp? ( x11-libs/qtimageformats ) x11-libs/qtbase:5[gui][sql][sqlite] x11-libs/qtmultimedia:5 x11-libs/qtx11extras:5 net-dns/libidn sys-libs/zlib x11-libs/libX11 x11-libs/libxcb providers:aspell? ( app-spell/aspell ) providers:enchant? ( app-spell/enchant ) providers:hunspell? ( app-spell/hunspell ) providers:webengine? ( x11-libs/qtwebengine:5 x11-libs/qtwebchannel:5 net-libs/http-parser ) providers:webkit? ( x11-libs/qtwebkit:5 ) whiteboarding? ( x11-libs/qtsvg:5 ) xscreensaver? ( x11-libs/libXScrnSaver ) build: doc? ( app-doc/doxygen ) extras? ( sys-devel/qconf[>=2.4] ) " #$DEFAULT_SRC_PREPARE_PATCHES=( #) pkg_setup() { MY_PN=psi if option extras; then MY_PN=psi-plus fi } src_prepare() { default_src_prepare edo mv ../psiplus psi-plus edo mv ../psiplusl10n psi-l10n edo mv ../resources resources if option extras; then edo cp -a "${WORK}/psi-plus/iconsets" . || die "failed to copy iconsets" if option iconsets; then edo cp -a "${WORK}/resources/iconsets" . || die "failed to copy additional iconsets" fi expatch "${WORK}/psi-plus/patches"/*.diff option sql && expatch "${WORK}/psi-plus/patches/dev/psi-new-history.patch" vergen="${WORK}/psi-plus/admin/psi-plus-nightly-version" local features=() # option webkit && features+="--webkit" # option webengine && features+="--webengine" # option sql && features+="--sql" features="$(option providers:webkit && echo '--webkit') $(option providers:webengine && echo '--webengine') $(option sql && echo '--sql')" NIGHTLY_VER=$("${vergen}" ./ $features) elog "Prepared version: ${NIGHTLY_VER}" echo "${NIGHTLY_VER}" > version || die "Failed to write version file" qconf || die "Failed to create ./configure." fi } src_configure() { CONF=( --prefix=/usr/$(exhost --target) --no-separate-debug-info --enable-qdbus $(option_enable providers:aspell aspell) $(option_enable providers:enchant enchant) $(option_enable providers:hunspell hunspell) $(option_enable xscreensaver xss) $(option_enable whiteboarding) ) option debug && CONF+=("--debug") option providers:webengine && CONF+=("--enable-webkit" "--with-webkit=qtwebengine") option providers:webkit && CONF+=("--enable-webkit" "--with-webkit=qtwebkit") # This may generate warnings if passed option already matches with default. # Just ignore them. It's how qconf-based configure works and will be fixed in # future qconf versions. ./configure "${CONF[@]}" || die "configure failed" eqmake psi.pro edo rm -rf psi-plus } src_compile() { emake option doc && emake -C doc api_public } src_install() { # qmake_src_install default_src_install # rm "${ED}"/usr/share/${MY_PN}/{COPYING,README.html} || die "Installed file set seems to be changed by upstream" newdoc iconsets/roster/README README.roster newdoc iconsets/system/README README.system newdoc certs/README README.certs dodoc README.html option doc && HTML_DOCS=( doc/api/. ) emagicdocs mylrelease=lrelease-qt5 cd "${WORK}"/psi-l10n insinto /usr/share/${MY_PN} for lang in ${LANGS}; do if option "linguas:${lang}"; then "${mylrelease}" "translations/${PN}_${lang}.ts" || die "lrelease ${1} failed" doins "translations/${PN}_${lang}.qm" fi done }