net-im/libcommuni: New package
authorConrad Kostecki <conrad@kostecki.com>
Tue, 1 May 2018 20:19:34 +0000 (22:19 +0200)
committerMichał Górny <mgorny@gentoo.org>
Wed, 9 May 2018 12:46:43 +0000 (14:46 +0200)
Closes: https://bugs.gentoo.org/652462
Closes: https://github.com/gentoo/gentoo/pull/7813
Package-Manager: Portage-2.3.24, Repoman-2.3.6

net-im/libcommuni/Manifest [new file with mode: 0644]
net-im/libcommuni/files/uchardet.pri [new file with mode: 0644]
net-im/libcommuni/libcommuni-3.5.0.ebuild [new file with mode: 0644]
net-im/libcommuni/metadata.xml [new file with mode: 0644]

diff --git a/net-im/libcommuni/Manifest b/net-im/libcommuni/Manifest
new file mode 100644 (file)
index 0000000..3adc414
--- /dev/null
@@ -0,0 +1 @@
+DIST libcommuni-3.5.0.tar.gz 646734 BLAKE2B 81e2c783625a0befe2d364423e862967bc76e8a66e9b5d7f2f94f46f46530d54b030bfd3a48d7877532092c607295cff5a77ecd8bb669112d53507a1ea18c5b0 SHA512 4d62f7e5edd32b9121f2b69d15a4022ad5d6cf7136dc48d0a1ca4bd413b3334533d7734d6939906fa3426f8db9bc255696107ecada19875c60ce59990b54dee4
diff --git a/net-im/libcommuni/files/uchardet.pri b/net-im/libcommuni/files/uchardet.pri
new file mode 100644 (file)
index 0000000..d22393b
--- /dev/null
@@ -0,0 +1,17 @@
+######################################################################
+# Communi
+######################################################################
+
+include(../pkg.pri)
+
+pkgExists(uchardet) {
+       CONFIG += link_pkgconfig
+       PKGCONFIG += uchardet
+}
+
+isEmpty(PKGCONFIG) {
+       error("UChardet support has been enabled, but the UChardet installation has not been found. Did you emerged app-i18n/uchardet?")
+} else {
+       LIBS += -luchardet
+       INCPATH += -isystem /usr/include/uchardet
+}
diff --git a/net-im/libcommuni/libcommuni-3.5.0.ebuild b/net-im/libcommuni/libcommuni-3.5.0.ebuild
new file mode 100644 (file)
index 0000000..166369b
--- /dev/null
@@ -0,0 +1,74 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit qmake-utils
+
+DESCRIPTION="A cross-platform IRC framework written with Qt"
+HOMEPAGE="http://communi.github.io/"
+SRC_URI="https://github.com/communi/libcommuni/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="qml test +uchardet"
+
+# Compiling with USE="test" is currently broken with dev-libs/icu
+# See: https://github.com/communi/libcommuni/issues/60
+REQUIRED_USE="test? ( uchardet )"
+
+RDEPEND="dev-qt/qtcore:5
+       dev-qt/qtdeclarative:5
+       uchardet? ( app-i18n/uchardet )
+       !uchardet? ( dev-libs/icu:= )"
+
+DEPEND="test? ( dev-qt/qttest:5 )
+       ${RDEPEND}"
+
+RESTRICT="!test? ( test )"
+
+src_prepare() {
+       default
+
+       # Don't use bundled uchardet, use instead app-i18n/uchardet
+       rm -rf src/3rdparty/uchardet-0.0.1/* || die
+       cp "${FILESDIR}"/uchardet.pri src/3rdparty/uchardet-0.0.1/uchardet.pri || die
+}
+
+src_configure() {
+       local myqmakeargs=( libcommuni.pro
+               # Disables compile run-time benchmarks, as they don't make any sense
+               -config no_benchmarks
+               # Disables examples, as no new files are installed
+               -config no_examples
+               # Is needed for fixing the QA Notice: The following files contain insecure RUNPATHs
+               -config no_rpath
+               # Compile libcommuni always in Release mode, as Debug seems to do nothing
+               -config release
+               # Don't silence all compile messages
+               -config verbose
+               -config $(usex qml '' 'no_')install_imports
+               -config $(usex qml '' 'no_')install_qml
+               -config $(usex test '' 'no_')tests
+               -config $(usex uchardet 'no_' '')icu
+               -config $(usex uchardet '' 'no_')uchardet )
+
+       eqmake5 "${myqmakeargs[@]}"
+}
+
+src_test() {
+       # This is a hack to delete the existing LD_LIBRARY_PATH and set a new one,
+       # otherwise a test will fail, because it uses the system installed lib instead of the new compiled lib.
+       # The test will fail, when libcommuni is emerged with USE="uchardet" and
+       # libcommuni is already installed with USE="-uchardat", or the other way around.
+       find "${S}" -type f -name 'target_wrapper.sh' -exec sed -i -e "/.*LD_LIBRARY_PATH.*/d" {} \; || die
+       local -x LD_LIBRARY_PATH="${S}/lib"
+
+       default
+}
+
+src_install() {
+       emake install INSTALL_ROOT="${D}"
+       einstalldocs
+}
diff --git a/net-im/libcommuni/metadata.xml b/net-im/libcommuni/metadata.xml
new file mode 100644 (file)
index 0000000..40dcff9
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <maintainer type="person">
+               <email>ck+gentoo@bl4ckb0x.de</email>
+               <name>Conrad Kostecki</name>
+       </maintainer>
+       <maintainer type="project">
+               <email>proxy-maint@gentoo.org</email>
+               <name>Proxy Maintainers</name>
+       </maintainer>
+       <longdescription>
+               A cross-platform IRC framework written with Qt.
+               Communi provides a set of tools for enabling
+               IRC connectivity in Qt-based C++ and QML applications.
+       </longdescription>
+       <use>
+               <flag name="qml">Install optional qml files.</flag>
+               <flag name="uchardet">Use <pkg>app-i18n/uchardet</pkg>, which is upstreams default, instead of <pkg>dev-libs/icu</pkg>, which makes impossible to run tests.</flag>
+       </use>
+</pkgmetadata>