Gentoo Archives: gentoo-commits

From: Austin English <wizardedit@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/zthread/, dev-libs/zthread/files/
Date: Thu, 02 Jun 2016 21:43:25
Message-Id: 1464903735.5f3562b328dcadeb4f73863bac2128a67df87eda.wizardedit@gentoo
1 commit: 5f3562b328dcadeb4f73863bac2128a67df87eda
2 Author: Austin English <wizardedit <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 2 06:41:15 2016 +0000
4 Commit: Austin English <wizardedit <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 2 21:42:15 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5f3562b3
7
8 dev-libs/zthread: fix building with clang
9
10 Gentoo-Bug: https://bugs.gentoo.org/506934
11
12 Reviewed-By: David Seifert <soap <AT> gentoo.org>
13
14 Package-Manager: portage-2.2.26
15
16 dev-libs/zthread/files/zthread-2.3.2-clang.patch | 16 ++++
17 .../files/zthread-2.3.2-no-fpermissive-r1.diff | 94 ++++++++++++++++++++++
18 dev-libs/zthread/zthread-2.3.2-r4.ebuild | 67 +++++++++++++++
19 3 files changed, 177 insertions(+)
20
21 diff --git a/dev-libs/zthread/files/zthread-2.3.2-clang.patch b/dev-libs/zthread/files/zthread-2.3.2-clang.patch
22 new file mode 100644
23 index 0000000..13dd91e
24 --- /dev/null
25 +++ b/dev-libs/zthread/files/zthread-2.3.2-clang.patch
26 @@ -0,0 +1,16 @@
27 +fix compile when using clang as $CC:
28 +
29 +Based on patch from https://bugs.launchpad.net/hugin/+bug/1213585 (rebased)
30 +
31 +diff -r 2a43e83684d5 src/foreign/zthread/include/zthread/Guard.h
32 +--- a/include/zthread/Guard.h Sat Aug 10 11:31:46 2013 +0200
33 ++++ b/include/zthread/Guard.h Sun Aug 18 09:46:43 2013 +0200
34 +@@ -108,7 +108,7 @@
35 + }
36 +
37 + template <class LockType>
38 +- static void createScope(LockHolder<LockType>& l, unsigned long ms) {
39 ++ static bool createScope(LockHolder<LockType>& l, unsigned long ms) {
40 +
41 + if(Scope1::createScope(l, ms))
42 + if(!Scope2::createScope(l, ms)) {
43
44 diff --git a/dev-libs/zthread/files/zthread-2.3.2-no-fpermissive-r1.diff b/dev-libs/zthread/files/zthread-2.3.2-no-fpermissive-r1.diff
45 new file mode 100644
46 index 0000000..94b42ee
47 --- /dev/null
48 +++ b/dev-libs/zthread/files/zthread-2.3.2-no-fpermissive-r1.diff
49 @@ -0,0 +1,94 @@
50 +--- a/include/zthread/Guard.h 2008-07-22 14:46:28.000000000 +0200
51 ++++ b/include/zthread/Guard.h 2008-07-22 14:51:41.000000000 +0200
52 +@@ -491,7 +491,7 @@
53 +
54 + try {
55 +
56 +- if(!isDisabled())
57 ++ if(!LockHolder<LockType>::isDisabled())
58 + LockingPolicy::destroyScope(*this);
59 +
60 + } catch (...) { /* ignore */ }
61 +--- a/src/MutexImpl.h 2008-07-22 14:54:40.000000000 +0200
62 ++++ b/src/MutexImpl.h 2008-07-22 15:03:30.000000000 +0200
63 +@@ -153,7 +153,7 @@
64 +
65 + _owner = self;
66 +
67 +- ownerAcquired(self);
68 ++ MutexImpl<List,Behavior>::ownerAcquired(self);
69 +
70 + }
71 +
72 +@@ -164,7 +164,7 @@
73 + _waiters.insert(self);
74 + m.acquire();
75 +
76 +- waiterArrived(self);
77 ++ MutexImpl<List, Behavior>::waiterArrived(self);
78 +
79 + {
80 +
81 +@@ -173,7 +173,7 @@
82 +
83 + }
84 +
85 +- waiterDeparted(self);
86 ++ MutexImpl<List, Behavior>::waiterDeparted(self);
87 +
88 + m.release();
89 +
90 +@@ -192,7 +192,7 @@
91 + assert(_owner == 0);
92 + _owner = self;
93 +
94 +- ownerAcquired(self);
95 ++ MutexImpl<List, Behavior>::ownerAcquired(self);
96 +
97 + break;
98 +
99 +@@ -236,7 +236,7 @@
100 +
101 + _owner = self;
102 +
103 +- ownerAcquired(self);
104 ++ MutexImpl<List, Behavior>::ownerAcquired(self);
105 +
106 + }
107 +
108 +@@ -253,7 +253,7 @@
109 +
110 + m.acquire();
111 +
112 +- waiterArrived(self);
113 ++ MutexImpl<List, Behavior>:: waiterArrived(self);
114 +
115 + {
116 +
117 +@@ -262,7 +262,7 @@
118 +
119 + }
120 +
121 +- waiterDeparted(self);
122 ++ MutexImpl<List, Behavior>::waiterDeparted(self);
123 +
124 + m.release();
125 +
126 +@@ -284,7 +284,7 @@
127 + assert(0 == _owner);
128 + _owner = self;
129 +
130 +- ownerAcquired(self);
131 ++ MutexImpl<List, Behavior>::ownerAcquired(self);
132 +
133 + break;
134 +
135 +@@ -326,7 +326,7 @@
136 +
137 + _owner = 0;
138 +
139 +- ownerReleased(impl);
140 ++ MutexImpl<List, Behavior>::ownerReleased(impl);
141 +
142 + // Try to find a waiter with a backoff & retry scheme
143 + for(;;) {
144
145 diff --git a/dev-libs/zthread/zthread-2.3.2-r4.ebuild b/dev-libs/zthread/zthread-2.3.2-r4.ebuild
146 new file mode 100644
147 index 0000000..154f895
148 --- /dev/null
149 +++ b/dev-libs/zthread/zthread-2.3.2-r4.ebuild
150 @@ -0,0 +1,67 @@
151 +# Copyright 1999-2016 Gentoo Foundation
152 +# Distributed under the terms of the GNU General Public License v2
153 +# $Id$
154 +
155 +EAPI=6
156 +
157 +inherit autotools eutils
158 +
159 +MY_P="ZThread-${PV}"
160 +
161 +DESCRIPTION="platform-independent multi-threading and synchronization library for C++"
162 +HOMEPAGE="http://zthread.sourceforge.net/"
163 +SRC_URI="mirror://sourceforge/zthread/${MY_P}.tar.gz"
164 +
165 +LICENSE="MIT"
166 +SLOT="0"
167 +KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~sparc ~x86"
168 +IUSE="debug doc kernel_linux static-libs"
169 +
170 +DEPEND="doc? ( app-doc/doxygen )"
171 +RDEPEND=""
172 +
173 +S="${WORKDIR}/${MY_P}"
174 +
175 +PATCHES=(
176 + "${FILESDIR}"/${P}-no-fpermissive-r1.diff
177 + "${FILESDIR}"/${P}-m4-quote.patch
178 + "${FILESDIR}"/${P}-automake-r2.patch
179 + "${FILESDIR}"/${P}-gcc47.patch
180 + "${FILESDIR}"/${P}-clang.patch
181 +)
182 +
183 +src_prepare() {
184 + default
185 +
186 + rm -f include/zthread/{.Barrier.h.swp,Barrier.h.orig} || die
187 +
188 + sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.ac || die #467778
189 +
190 + AT_M4DIR="share" eautoreconf
191 +}
192 +
193 +src_configure() {
194 + econf \
195 + $(use_enable debug) \
196 + $(use_enable kernel_linux atomic-linux) \
197 + $(use_enable static-libs static)
198 +}
199 +
200 +src_compile() {
201 + default
202 +
203 + if use doc; then
204 + doxygen doc/zthread.doxygen || die
205 + sed -i -e 's|href="html/|href="|' doc/documentation.html || die
206 + cp doc/documentation.html doc/html/index.html || die
207 + cp doc/{zthread.css,bugs.js} doc/html/ || die
208 + fi
209 +}
210 +
211 +src_install() {
212 + default
213 +
214 + use doc && dodoc -r doc/html
215 +
216 + prune_libtool_files
217 +}