summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-im/spectrum2')
-rw-r--r--net-im/spectrum2/files/spectrum2-2.0.13-musl-compatibility.patch95
-rw-r--r--net-im/spectrum2/spectrum2-2.0.12-r4.ebuild1
-rw-r--r--net-im/spectrum2/spectrum2-2.0.13-r2.ebuild5
3 files changed, 100 insertions, 1 deletions
diff --git a/net-im/spectrum2/files/spectrum2-2.0.13-musl-compatibility.patch b/net-im/spectrum2/files/spectrum2-2.0.13-musl-compatibility.patch
new file mode 100644
index 000000000000..07bde50b832d
--- /dev/null
+++ b/net-im/spectrum2/files/spectrum2-2.0.13-musl-compatibility.patch
@@ -0,0 +1,95 @@
+From 19b10896fa3426b2bd9e4e75a63ca52322373d33 Mon Sep 17 00:00:00 2001
+From: Vitaly Takmazov <vitalyster@gmail.com>
+Date: Fri, 24 Jul 2020 15:09:28 +0300
+Subject: [PATCH] musl compatibility
+
+---
+ backends/libpurple/main.cpp | 6 +++---
+ backends/swiften/main.cpp | 2 ++
+ libtransport/UserManager.cpp | 2 ++
+ spectrum/src/main.cpp | 2 ++
+ 4 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/backends/libpurple/main.cpp b/backends/libpurple/main.cpp
+index 54c618e0..4555edbc 100644
+--- a/backends/libpurple/main.cpp
++++ b/backends/libpurple/main.cpp
+@@ -528,7 +528,7 @@ class SpectrumNetworkPlugin : public NetworkPlugin {
+
+ purple_accounts_delete_wrapped(account);
+ #ifndef WIN32
+-#if !defined(__FreeBSD__) && !defined(__APPLE__)
++#if !defined(__FreeBSD__) && !defined(__APPLE__) && defined (__GLIBC__)
+ malloc_trim(0);
+ #endif
+ #endif
+@@ -2287,7 +2287,7 @@ static void signed_on(PurpleConnection *gc, gpointer unused) {
+ PurpleAccount *account = purple_connection_get_account_wrapped(gc);
+ np->handleConnected(np->m_accounts[account]);
+ #ifndef WIN32
+-#if !defined(__FreeBSD__) && !defined(__APPLE__)
++#if !defined(__FreeBSD__) && !defined(__APPLE__) && defined (__GLIBC__)
+ // force returning of memory chunks allocated by libxml2 to kernel
+ malloc_trim(0);
+ #endif
+@@ -2516,7 +2516,7 @@ int main(int argc, char **argv) {
+ boost::locale::generator gen;
+ std::locale::global(gen(""));
+ #ifndef WIN32
+-#if !defined(__FreeBSD__) && !defined(__APPLE__)
++#if !defined(__FreeBSD__) && !defined(__APPLE__) && defined (__GLIBC__)
+ mallopt(M_CHECK_ACTION, 2);
+ mallopt(M_PERTURB, 0xb);
+ #endif
+diff --git a/backends/swiften/main.cpp b/backends/swiften/main.cpp
+index f0acdb6d..6c111464 100644
+--- a/backends/swiften/main.cpp
++++ b/backends/swiften/main.cpp
+@@ -227,10 +227,12 @@ class SwiftenPlugin : public NetworkPlugin, Swift::XMPPParserClient {
+ #ifndef WIN32
+ #ifndef __FreeBSD__
+ #ifndef __MACH__
++#if defined (__GLIBC__)
+ // force returning of memory chunks allocated by libxml2 to kernel
+ malloc_trim(0);
+ #endif
+ #endif
++#endif
+ #endif
+ }
+
+diff --git a/libtransport/UserManager.cpp b/libtransport/UserManager.cpp
+index 73fcdae9..a622754f 100644
+--- a/libtransport/UserManager.cpp
++++ b/libtransport/UserManager.cpp
+@@ -125,10 +125,12 @@ void UserManager::removeUser(User *user, bool onUserBehalf) {
+ #ifndef WIN32
+ #ifndef __FreeBSD__
+ #ifndef __MACH__
++#if defined (__GLIBC__)
+ malloc_trim(0);
+ #endif
+ #endif
+ #endif
++#endif
+ // VALGRIND_DO_LEAK_CHECK;
+ }
+
+diff --git a/spectrum/src/main.cpp b/spectrum/src/main.cpp
+index 0f5985a2..89e5b9a1 100644
+--- a/spectrum/src/main.cpp
++++ b/spectrum/src/main.cpp
+@@ -320,11 +320,13 @@ int main(int argc, char **argv)
+ #ifndef WIN32
+ #ifndef __FreeBSD__
+ #ifndef __MACH__
++#if defined (__GLIBC__)
+ mallopt(M_CHECK_ACTION, 2);
+ mallopt(M_PERTURB, 0xb);
+ #endif
+ #endif
+ #endif
++#endif
+
+ #ifndef WIN32
+ if (signal(SIGINT, spectrum_sigint_handler) == SIG_ERR) {
diff --git a/net-im/spectrum2/spectrum2-2.0.12-r4.ebuild b/net-im/spectrum2/spectrum2-2.0.12-r4.ebuild
index 4f12c3c285e9..3bbf840a5229 100644
--- a/net-im/spectrum2/spectrum2-2.0.12-r4.ebuild
+++ b/net-im/spectrum2/spectrum2-2.0.12-r4.ebuild
@@ -62,6 +62,7 @@ PATCHES=(
"${FILESDIR}/${P}-boost-173-compatibility.patch"
"${FILESDIR}/${P}-gcc-10-compatibility.patch"
"${FILESDIR}/${PN}-2.0.13-libpqxx-7-compatibility.patch"
+ "${FILESDIR}/${PN}-2.0.13-musl-compatibility.patch"
)
src_prepare() {
diff --git a/net-im/spectrum2/spectrum2-2.0.13-r2.ebuild b/net-im/spectrum2/spectrum2-2.0.13-r2.ebuild
index 1c7985cbc6c4..d94c327ca2cc 100644
--- a/net-im/spectrum2/spectrum2-2.0.13-r2.ebuild
+++ b/net-im/spectrum2/spectrum2-2.0.13-r2.ebuild
@@ -58,7 +58,10 @@ DEPEND="
test? ( dev-util/cppunit )
"
-PATCHES=( "${FILESDIR}/${P}-libpqxx-7-compatibility.patch" )
+PATCHES=(
+ "${FILESDIR}/${P}-libpqxx-7-compatibility.patch"
+ "${FILESDIR}/${P}-musl-compatibility.patch"
+)
src_prepare() {
# Respect users LDFLAGS