Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-im/spectrum2/files/, net-im/spectrum2/
Date: Thu, 27 Aug 2020 17:28:16
Message-Id: 1598549280.73b5c4466f2c421fb3bdbe13b3f7b27be76fc968.conikost@gentoo
1 commit: 73b5c4466f2c421fb3bdbe13b3f7b27be76fc968
2 Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 27 17:27:46 2020 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 27 17:28:00 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73b5c446
7
8 net-im/spectrum2: fix compilation with musl
9
10 Closes: https://bugs.gentoo.org/717410
11 Package-Manager: Portage-3.0.4, Repoman-3.0.1
12 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
13
14 .../spectrum2-2.0.13-musl-compatibility.patch | 95 ++++++++++++++++++++++
15 net-im/spectrum2/spectrum2-2.0.12-r4.ebuild | 1 +
16 net-im/spectrum2/spectrum2-2.0.13-r2.ebuild | 5 +-
17 3 files changed, 100 insertions(+), 1 deletion(-)
18
19 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
20 new file mode 100644
21 index 00000000000..07bde50b832
22 --- /dev/null
23 +++ b/net-im/spectrum2/files/spectrum2-2.0.13-musl-compatibility.patch
24 @@ -0,0 +1,95 @@
25 +From 19b10896fa3426b2bd9e4e75a63ca52322373d33 Mon Sep 17 00:00:00 2001
26 +From: Vitaly Takmazov <vitalyster@×××××.com>
27 +Date: Fri, 24 Jul 2020 15:09:28 +0300
28 +Subject: [PATCH] musl compatibility
29 +
30 +---
31 + backends/libpurple/main.cpp | 6 +++---
32 + backends/swiften/main.cpp | 2 ++
33 + libtransport/UserManager.cpp | 2 ++
34 + spectrum/src/main.cpp | 2 ++
35 + 4 files changed, 9 insertions(+), 3 deletions(-)
36 +
37 +diff --git a/backends/libpurple/main.cpp b/backends/libpurple/main.cpp
38 +index 54c618e0..4555edbc 100644
39 +--- a/backends/libpurple/main.cpp
40 ++++ b/backends/libpurple/main.cpp
41 +@@ -528,7 +528,7 @@ class SpectrumNetworkPlugin : public NetworkPlugin {
42 +
43 + purple_accounts_delete_wrapped(account);
44 + #ifndef WIN32
45 +-#if !defined(__FreeBSD__) && !defined(__APPLE__)
46 ++#if !defined(__FreeBSD__) && !defined(__APPLE__) && defined (__GLIBC__)
47 + malloc_trim(0);
48 + #endif
49 + #endif
50 +@@ -2287,7 +2287,7 @@ static void signed_on(PurpleConnection *gc, gpointer unused) {
51 + PurpleAccount *account = purple_connection_get_account_wrapped(gc);
52 + np->handleConnected(np->m_accounts[account]);
53 + #ifndef WIN32
54 +-#if !defined(__FreeBSD__) && !defined(__APPLE__)
55 ++#if !defined(__FreeBSD__) && !defined(__APPLE__) && defined (__GLIBC__)
56 + // force returning of memory chunks allocated by libxml2 to kernel
57 + malloc_trim(0);
58 + #endif
59 +@@ -2516,7 +2516,7 @@ int main(int argc, char **argv) {
60 + boost::locale::generator gen;
61 + std::locale::global(gen(""));
62 + #ifndef WIN32
63 +-#if !defined(__FreeBSD__) && !defined(__APPLE__)
64 ++#if !defined(__FreeBSD__) && !defined(__APPLE__) && defined (__GLIBC__)
65 + mallopt(M_CHECK_ACTION, 2);
66 + mallopt(M_PERTURB, 0xb);
67 + #endif
68 +diff --git a/backends/swiften/main.cpp b/backends/swiften/main.cpp
69 +index f0acdb6d..6c111464 100644
70 +--- a/backends/swiften/main.cpp
71 ++++ b/backends/swiften/main.cpp
72 +@@ -227,10 +227,12 @@ class SwiftenPlugin : public NetworkPlugin, Swift::XMPPParserClient {
73 + #ifndef WIN32
74 + #ifndef __FreeBSD__
75 + #ifndef __MACH__
76 ++#if defined (__GLIBC__)
77 + // force returning of memory chunks allocated by libxml2 to kernel
78 + malloc_trim(0);
79 + #endif
80 + #endif
81 ++#endif
82 + #endif
83 + }
84 +
85 +diff --git a/libtransport/UserManager.cpp b/libtransport/UserManager.cpp
86 +index 73fcdae9..a622754f 100644
87 +--- a/libtransport/UserManager.cpp
88 ++++ b/libtransport/UserManager.cpp
89 +@@ -125,10 +125,12 @@ void UserManager::removeUser(User *user, bool onUserBehalf) {
90 + #ifndef WIN32
91 + #ifndef __FreeBSD__
92 + #ifndef __MACH__
93 ++#if defined (__GLIBC__)
94 + malloc_trim(0);
95 + #endif
96 + #endif
97 + #endif
98 ++#endif
99 + // VALGRIND_DO_LEAK_CHECK;
100 + }
101 +
102 +diff --git a/spectrum/src/main.cpp b/spectrum/src/main.cpp
103 +index 0f5985a2..89e5b9a1 100644
104 +--- a/spectrum/src/main.cpp
105 ++++ b/spectrum/src/main.cpp
106 +@@ -320,11 +320,13 @@ int main(int argc, char **argv)
107 + #ifndef WIN32
108 + #ifndef __FreeBSD__
109 + #ifndef __MACH__
110 ++#if defined (__GLIBC__)
111 + mallopt(M_CHECK_ACTION, 2);
112 + mallopt(M_PERTURB, 0xb);
113 + #endif
114 + #endif
115 + #endif
116 ++#endif
117 +
118 + #ifndef WIN32
119 + if (signal(SIGINT, spectrum_sigint_handler) == SIG_ERR) {
120
121 diff --git a/net-im/spectrum2/spectrum2-2.0.12-r4.ebuild b/net-im/spectrum2/spectrum2-2.0.12-r4.ebuild
122 index 4f12c3c285e..3bbf840a522 100644
123 --- a/net-im/spectrum2/spectrum2-2.0.12-r4.ebuild
124 +++ b/net-im/spectrum2/spectrum2-2.0.12-r4.ebuild
125 @@ -62,6 +62,7 @@ PATCHES=(
126 "${FILESDIR}/${P}-boost-173-compatibility.patch"
127 "${FILESDIR}/${P}-gcc-10-compatibility.patch"
128 "${FILESDIR}/${PN}-2.0.13-libpqxx-7-compatibility.patch"
129 + "${FILESDIR}/${PN}-2.0.13-musl-compatibility.patch"
130 )
131
132 src_prepare() {
133
134 diff --git a/net-im/spectrum2/spectrum2-2.0.13-r2.ebuild b/net-im/spectrum2/spectrum2-2.0.13-r2.ebuild
135 index 1c7985cbc6c..d94c327ca2c 100644
136 --- a/net-im/spectrum2/spectrum2-2.0.13-r2.ebuild
137 +++ b/net-im/spectrum2/spectrum2-2.0.13-r2.ebuild
138 @@ -58,7 +58,10 @@ DEPEND="
139 test? ( dev-util/cppunit )
140 "
141
142 -PATCHES=( "${FILESDIR}/${P}-libpqxx-7-compatibility.patch" )
143 +PATCHES=(
144 + "${FILESDIR}/${P}-libpqxx-7-compatibility.patch"
145 + "${FILESDIR}/${P}-musl-compatibility.patch"
146 +)
147
148 src_prepare() {
149 # Respect users LDFLAGS