summaryrefslogtreecommitdiff
path: root/packages/net-libs/toxcore/toxcore.exlib
diff options
context:
space:
mode:
Diffstat (limited to 'packages/net-libs/toxcore/toxcore.exlib')
-rw-r--r--packages/net-libs/toxcore/toxcore.exlib74
1 files changed, 74 insertions, 0 deletions
diff --git a/packages/net-libs/toxcore/toxcore.exlib b/packages/net-libs/toxcore/toxcore.exlib
new file mode 100644
index 0000000..63b2927
--- /dev/null
+++ b/packages/net-libs/toxcore/toxcore.exlib
@@ -0,0 +1,74 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+require github [ user=TokTok project=c-toxcore tag=v${PV} ]
+#require scm-git
+require systemd-service
+require autotools [ supported_autoconf=[ 2.5 ] supported_automake=[ 1.15 1.13 1.12 1.11 ] need_libtool=false ]
+
+export_exlib_phases src_configure src_install
+
+SLOT="0"
+SUMMARY="Encrypted P2P, messaging, and audio/video calling platform"
+DESCRIPTION=""
+HOMEPAGE="https://tox.chat"
+LICENCES="GPL-3+"
+MYOPTIONS="
+ av [[ description = [ Enable audio/video support ] ]]
+ daemon [[ description = [ Build and install tox network booststrap daemon ] ]]
+ ntox [[ description = [ Build testing console-based client ] ]]
+ (
+ log-debug [[ description = [ Turn on debug logging ] ]]
+ log-error [[ description = [ Turn on error logging ] ]]
+ log-info [[ description = [ Turn on info logging ] ]]
+ log-trace [[ description = [ Turn on trace logging ] ]]
+ log-warn [[ description = [ Turn on warn logging ] ]]
+ )
+ [[ number-selected = at-most-one ]]
+"
+
+DEPENDENCIES="
+ build+run:
+ av? ( media-libs/libvpx media-libs/opus )
+ daemon? ( dev-libs/libconfig )
+ ntox? ( sys-libs/ncurses )
+ dev-libs/libsodium
+"
+
+toxcore_src_configure() {
+ myconf=()
+ if option log-debug; then
+ myconf+=( --enable-logging )
+ myconf+=( --with-log-level=DEBUG )
+ elif option log-error; then
+ myconf+=( --enable-logging )
+ myconf+=( --with-log-level=ERROR )
+ elif option log-info; then
+ myconf+=( --enable-logging )
+ myconf+=( --with-log-level=INFO )
+ elif option log-trace; then
+ myconf+=( --enable-logging )
+ myconf+=( --with-log-level=TRACE )
+ elif option log-warn; then
+ myconf+=( --enable-logging )
+ myconf+=( --with-log-level=WARNING )
+ fi
+ econf \
+ $(option_enable av av ) \
+ $(option_enable ntox ntox ) \
+ $(option_enable daemon daemon ) \
+ "${myconf[@]}"
+
+}
+
+toxcore_src_install() {
+ default_src_install
+ if option daemon; then
+ newconfd "${FILESDIR}"/confd tox-dht-daemon
+ insinto /etc
+ doins "${FILESDIR}"/tox-bootstrapd.conf
+ install_systemd_files
+ else
+ edo rmdir "${IMAGE}"/usr/$(exhost --target)/bin
+ fi
+}