From: Andrey Utkin Date: Mon, 6 May 2019 18:20:19 +0000 (+0100) Subject: dev-libs/libstrophe: add new package X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3c12b68547436990731331971833beff76d501eb;p=gentoo.git dev-libs/libstrophe: add new package A dependency of net-im/profanity. Based on chaoslab-overlay. Thanks Ian Moone for high quality work! Changes made to original work are motivated by avoidance of overcomplication, and conformance to current practices. Changes are: * USE flag 'xml' changed to existing global flag 'expat' * USE flag 'doc' now also installs examples * README file is not installed anymore, as it contains mostly compilation advise, which is useless once you have it installed * USE flags 'static-libs', 'ssl' are dropped * RESTRICT="mirror" dropped as unreasonable. Bug: https://bugs.gentoo.org/show_bug.cgi?id=558840 Package-Manager: Portage-2.3.62, Repoman-2.3.12 Signed-off-by: Andrey Utkin --- diff --git a/dev-libs/libstrophe/Manifest b/dev-libs/libstrophe/Manifest new file mode 100644 index 000000000000..e5c1bc327adc --- /dev/null +++ b/dev-libs/libstrophe/Manifest @@ -0,0 +1 @@ +DIST libstrophe-0.9.2.tar.gz 500459 BLAKE2B 0b1f6f1daac1215bcdcbde0e54264b98f5a863de339500826f625f8c5e8143ce7200fb251d04248715e9a8b6621a4360e7ca2780bf4684d916ec13361b5f6fcc SHA512 a0129c49ca574afaefa77c412143571af2eb1100c7d737d497b65d44680d35e2404ee2d4d4e1378b06ac1bcc5c587f505f79fea9251af1cbb36afd990d48570d diff --git a/dev-libs/libstrophe/files/libstrophe-0.9.2-libressl.patch b/dev-libs/libstrophe/files/libstrophe-0.9.2-libressl.patch new file mode 100644 index 000000000000..1c0cf239cdfc --- /dev/null +++ b/dev-libs/libstrophe/files/libstrophe-0.9.2-libressl.patch @@ -0,0 +1,20 @@ +--- a/src/tls_openssl.c ++++ b/src/tls_openssl.c +@@ -51,7 +51,7 @@ + + void tls_initialize(void) + { +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL) + SSL_library_init(); + SSL_load_error_strings(); + #else +@@ -120,7 +120,7 @@ + /* Trust server's certificate when user sets the flag explicitly. */ + mode = conn->tls_trust ? SSL_VERIFY_NONE : SSL_VERIFY_PEER; + SSL_set_verify(tls->ssl, mode, 0); +-#if OPENSSL_VERSION_NUMBER >= 0x10002000L ++#if OPENSSL_VERSION_NUMBER >= 0x10002000L && (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL) + /* Hostname verification is supported in OpenSSL 1.0.2 and newer. */ + X509_VERIFY_PARAM *param = SSL_get0_param(tls->ssl); + diff --git a/dev-libs/libstrophe/libstrophe-0.9.2.ebuild b/dev-libs/libstrophe/libstrophe-0.9.2.ebuild new file mode 100644 index 000000000000..f95cbfb67f5e --- /dev/null +++ b/dev-libs/libstrophe/libstrophe-0.9.2.ebuild @@ -0,0 +1,46 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +DESCRIPTION="A simple, lightweight C library for writing XMPP clients" +HOMEPAGE="http://strophe.im/libstrophe/" +SRC_URI="https://github.com/strophe/${PN}/releases/download/${PV}/${P}.tar.gz" +LICENSE="|| ( MIT GPL-3 )" +SLOT="0" +KEYWORDS="~amd64" +IUSE="doc expat libressl" + +RDEPEND=" + expat? ( dev-libs/expat ) + !expat? ( dev-libs/libxml2:2 ) + libressl? ( dev-libs/libressl:0= ) + !libressl? ( dev-libs/openssl:0= ) +" +DEPEND="${RDEPEND} + doc? ( app-doc/doxygen ) +" + +DOCS=( ChangeLog ) +PATCHES=( "${FILESDIR}/libstrophe-0.9.2-libressl.patch" ) + +src_configure() { + # shellcheck disable=SC2207 + local myeconf=( + --enable-tls + $(use_with !expat libxml2) + ) + econf "${myeconf[@]}" +} +src_compile() { + default + if use doc; then + doxygen || die + HTML_DOCS=( docs/html/* ) + fi +} + +src_install() { + default + use doc && dodoc -r examples + find "${D}" -name '*.la' -delete || die +} diff --git a/dev-libs/libstrophe/metadata.xml b/dev-libs/libstrophe/metadata.xml new file mode 100644 index 000000000000..66bfa18199e7 --- /dev/null +++ b/dev-libs/libstrophe/metadata.xml @@ -0,0 +1,17 @@ + + + + + andrey_utkin@gentoo.org + Andrey Utkin + + + strophe/libstrophe + https://github.com/strophe/libstrophe/issues + + + libstrophe is a lightweight XMPP client library written + in C. It has minimal dependencies and is configurable + for various environments. + +