summaryrefslogtreecommitdiffstats
path: root/chat-libs
diff options
context:
space:
mode:
Diffstat (limited to 'chat-libs')
-rwxr-xr-xchat-libs/libstrophe/DEPENDS16
-rwxr-xr-xchat-libs/libstrophe/DETAILS23
-rw-r--r--chat-libs/libstrophe/HISTORY7
-rwxr-xr-xchat-libs/libstrophe/PREPARE3
-rwxr-xr-xchat-libs/libstrophe/PRE_BUILD11
-rw-r--r--chat-libs/libstrophe/libressl.patch38
6 files changed, 87 insertions, 11 deletions
diff --git a/chat-libs/libstrophe/DEPENDS b/chat-libs/libstrophe/DEPENDS
index 43c4f1ac7d..e49e09f7a1 100755
--- a/chat-libs/libstrophe/DEPENDS
+++ b/chat-libs/libstrophe/DEPENDS
@@ -1,3 +1,13 @@
-optional_depends expat "" "" "for XML parsing" &&
-optional_depends libxml2 "--with-libxml2" "" "for XML parsing" &&
-optional_depends SSL "" "" "for TLS connections"
+optional_depends libxml2 \
+ "--with-libxml2" \
+ "--without-libxml2" \
+ "to use libxml2 instead of expat for XML parsing" &&
+
+if ! is_depends_enabled ${SPELL} libxml2; then
+ depends expat
+fi &&
+
+optional_depends SSL \
+ "--enable-tls" \
+ "--disable-tls" \
+ "for TLS support"
diff --git a/chat-libs/libstrophe/DETAILS b/chat-libs/libstrophe/DETAILS
index 3e18be9013..19c823d18e 100755
--- a/chat-libs/libstrophe/DETAILS
+++ b/chat-libs/libstrophe/DETAILS
@@ -1,14 +1,27 @@
+. "$GRIMOIRE/FUNCTIONS"
+
SPELL=libstrophe
- VERSION=git
- SOURCE="${SPELL}-${VERSION}.tar.bz2"
+case "${LIBSTROPHE_BRANCH}" in
+ scm)
+ VERSION=$(get_scm_version)
FORCE_DOWNLOAD=on
- SOURCE_IGNORE=volatile
+ SOURCE="${SPELL}-${VERSION}.tar.bz2"
SOURCE_URL[0]=git://github.com/strophe/${SPELL}.git
+ SOURCE_IGNORE=volatile
+ ;;
+ stable)
+ VERSION=0.9.2
+ SOURCE=${SPELL}-${VERSION}.tar.bz2
+ SOURCE_URL=https://github.com/strophe/${SPELL}/releases/download/${VERSION}/${SOURCE}
+ SOURCE_HASH=sha512:a1eeb966ef25536144d9cd67fd75f199ef685d9e7e4c03f1d76fe244f29f69409a819656d70374aa6a3a644d4a51bfead4c72500b36c620eaa07f66e11adf1d9
+ ;;
+esac
SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-${VERSION}"
WEB_SITE="http://strophe.im/libstrophe/"
- LICENSE[0]=GPL and MIT
+ LICENSE[0]=MIT
+ LICENSE[1]=GPL
ENTERED=20131013
- SHORT="an XMPP library for C"
+ SHORT="minimal XMPP library written in C"
cat << EOF
libstrophe is a minimal XMPP library written in C. It has almost no
external dependencies, only an XML parsing library (expat or libxml are both
diff --git a/chat-libs/libstrophe/HISTORY b/chat-libs/libstrophe/HISTORY
index 3d728cb63e..6290bb29cd 100644
--- a/chat-libs/libstrophe/HISTORY
+++ b/chat-libs/libstrophe/HISTORY
@@ -1,3 +1,10 @@
+2019-04-18 Vlad Glagolev <stealth@sourcemage.org>
+ * DETAILS: added stable branch; updated licenses
+ * PREPARE: added, for multi branch support
+ * DEPENDS: rewritten
+ * PRE_BUILD: apply patch
+ * libressl.patch: added, to fix build against libressl
+
2014-08-19 Treeve Jelbert <treeve@sourcemage.org>
* DEPENDS: openssl => SSL
diff --git a/chat-libs/libstrophe/PREPARE b/chat-libs/libstrophe/PREPARE
new file mode 100755
index 0000000000..c877f277e3
--- /dev/null
+++ b/chat-libs/libstrophe/PREPARE
@@ -0,0 +1,3 @@
+. ${GRIMOIRE}/FUNCTIONS &&
+
+prepare_select_branch stable scm
diff --git a/chat-libs/libstrophe/PRE_BUILD b/chat-libs/libstrophe/PRE_BUILD
index 6d548c9d1c..8671ce9077 100755
--- a/chat-libs/libstrophe/PRE_BUILD
+++ b/chat-libs/libstrophe/PRE_BUILD
@@ -1,3 +1,8 @@
-default_pre_build &&
-cd ${SOURCE_DIRECTORY} &&
-./bootstrap.sh
+default_pre_build &&
+cd "${SOURCE_DIRECTORY}" &&
+
+patch -p0 < "${SPELL_DIRECTORY}/libressl.patch" &&
+
+if [ ${LIBSTROPHE_BRANCH} = "scm" ]; then
+ ./bootstrap.sh
+fi
diff --git a/chat-libs/libstrophe/libressl.patch b/chat-libs/libstrophe/libressl.patch
new file mode 100644
index 0000000000..bf18a063f1
--- /dev/null
+++ b/chat-libs/libstrophe/libressl.patch
@@ -0,0 +1,38 @@
+--- src/tls_openssl.c.orig
++++ src/tls_openssl.c
+@@ -52,7 +52,7 @@ static void _tls_dump_cert_info(tls_t *tls);
+
+ void tls_initialize(void)
+ {
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ SSL_library_init();
+ SSL_load_error_strings();
+ #else
+@@ -67,14 +67,14 @@ void tls_shutdown(void)
+ * openssl after libstrophe finalization. Maybe better leak some fixed
+ * memory rather than cause random crashes of the main program.
+ */
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ ERR_free_strings();
+ EVP_cleanup();
+ CRYPTO_cleanup_all_ex_data();
+-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
++#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ SSL_COMP_free_compression_methods();
+ #endif
+-#if OPENSSL_VERSION_NUMBER < 0x10000000L
++#if OPENSSL_VERSION_NUMBER < 0x10000000L || defined(LIBRESSL_VERSION_NUMBER)
+ ERR_remove_state(0);
+ #else
+ ERR_remove_thread_state(NULL);
+@@ -121,7 +121,7 @@ tls_t *tls_new(xmpp_conn_t *conn)
+ /* 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)
+ /* Hostname verification is supported in OpenSSL 1.0.2 and newer. */
+ X509_VERIFY_PARAM *param = SSL_get0_param(tls->ssl);
+