Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-runtime/
Date: Fri, 13 May 2022 02:48:51
Message-Id: 1652408969.7e1fc3f22395c5a7733a1a4462551f69c892ce3e.ionen@gentoo
1 commit: 7e1fc3f22395c5a7733a1a4462551f69c892ce3e
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 10 05:32:32 2022 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Fri May 13 02:29:29 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e1fc3f2
7
8 dev-util/mingw64-runtime: re-arrange ebuilds some more
9
10 Mostly just style, but also now checking tuples again to ensure
11 more deterministic results (e.g. a cpp check gone wrong could
12 give 32bit despite x86_64 tuple), then fallback on the cpp check
13 rather than die like tuple check formerly did.
14
15 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
16
17 .../mingw64-runtime-10.0.0-r1.ebuild | 109 ++++++++++++++++++++
18 .../mingw64-runtime-8.0.0-r3.ebuild | 111 +++++++++++++++++++++
19 .../mingw64-runtime-9.0.0-r2.ebuild | 109 ++++++++++++++++++++
20 3 files changed, 329 insertions(+)
21
22 diff --git a/dev-util/mingw64-runtime/mingw64-runtime-10.0.0-r1.ebuild b/dev-util/mingw64-runtime/mingw64-runtime-10.0.0-r1.ebuild
23 new file mode 100644
24 index 000000000000..8c12697778ba
25 --- /dev/null
26 +++ b/dev-util/mingw64-runtime/mingw64-runtime-10.0.0-r1.ebuild
27 @@ -0,0 +1,109 @@
28 +# Copyright 1999-2022 Gentoo Authors
29 +# Distributed under the terms of the GNU General Public License v2
30 +
31 +EAPI=8
32 +
33 +inherit flag-o-matic toolchain-funcs
34 +
35 +DESCRIPTION="Free Win64 runtime and import library definitions"
36 +HOMEPAGE="https://www.mingw-w64.org/"
37 +SRC_URI="mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2"
38 +S="${WORKDIR}/mingw-w64-v${PV}"
39 +
40 +LICENSE="ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain tools? ( GPL-3+ )"
41 +SLOT="0"
42 +KEYWORDS="~amd64 ~x86"
43 +# USE=libraries needs working stage2 compiler: bug #665512
44 +IUSE="headers-only idl libraries tools"
45 +RESTRICT="strip"
46 +
47 +PATCHES=(
48 + "${FILESDIR}"/${PN}-7.0.0-fortify-only-ssp.patch
49 +)
50 +
51 +pkg_setup() {
52 + : ${CBUILD:=${CHOST}}
53 + : ${CTARGET:=${CHOST}}
54 + [[ ${CTARGET} == ${CHOST} && ${CATEGORY} == cross-* ]] &&
55 + CTARGET=${CATEGORY#cross-}
56 +
57 + [[ ${CHOST} != ${CTARGET} ]] && MW_CROSS=true || MW_CROSS=false
58 +
59 + [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] &&
60 + die "Invalid configuration, please see: https://wiki.gentoo.org/wiki/Mingw"
61 +}
62 +
63 +src_configure() {
64 + CHOST=${CTARGET}
65 + strip-unsupported-flags
66 +
67 + # Normally mingw64 does not use dynamic linker.
68 + # But at configure time it uses $LDFLAGS.
69 + # When default -Wl,--hash-style=gnu is passed
70 + # __CTORS_LIST__ / __DTORS_LIST__ is mis-detected
71 + # for target ld and binaries crash at shutdown.
72 + filter-ldflags '-Wl,--hash-style=*'
73 +
74 + local prefix=${EPREFIX}/usr
75 + ${MW_CROSS} && prefix+=/${CTARGET}/usr
76 +
77 + local conf=(
78 + --prefix="${prefix}"
79 + --libdir="${prefix}"/lib
80 + $(use_with !headers-only crt)
81 +
82 + # By default configure tries to set --sysroot=${prefix}. We disable
83 + # this behaviour with --with-sysroot=no to use gcc's sysroot default.
84 + # That way we can cross-build mingw64-runtime with cross-emerge.
85 + --with-sysroot=no
86 + )
87 +
88 + if use !headers-only; then
89 + conf+=(
90 + $(use_enable idl)
91 + $(use_with libraries)
92 + $(use_with tools)
93 + )
94 +
95 + # prefer tuple to determine if should do 32 or 64bits, but fall
96 + # back to cpp test if missing (bug #584858, see also #840662)
97 + local b32=true
98 + case ${CHOST} in
99 + x86_64-*) b32=false;;
100 + i*86-*) ;;
101 + *) [[ $($(tc-getCPP) -dM - <<<'') =~ __MINGW64__ ]] && b32=false;;
102 + esac
103 + ${b32} &&
104 + conf+=( --enable-lib32 --disable-lib64 ) ||
105 + conf+=( --disable-lib32 --enable-lib64 )
106 +
107 + # prepare temporary headers install to build against same-version
108 + mkdir ../headers || die
109 + pushd ../headers >/dev/null || die
110 + ECONF_SOURCE=${S} econf --prefix="${T}"/root --without-crt
111 + popd >/dev/null || die
112 +
113 + append-cppflags "-I${T}/root/include"
114 + fi
115 +
116 + econf "${conf[@]}"
117 +}
118 +
119 +src_compile() {
120 + use headers-only || emake -C ../headers install
121 +
122 + default
123 +}
124 +
125 +src_install() {
126 + default
127 +
128 + if ${MW_CROSS}; then
129 + # gcc is configured to look at specific hard-coded paths for mingw #419601
130 + dosym usr /usr/${CTARGET}/mingw
131 + dosym usr /usr/${CTARGET}/${CTARGET}
132 + dosym usr/include /usr/${CTARGET}/sys-include
133 + fi
134 +
135 + rm -r "${ED}"/usr/share || die
136 +}
137
138 diff --git a/dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r3.ebuild b/dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r3.ebuild
139 new file mode 100644
140 index 000000000000..f287baeaa601
141 --- /dev/null
142 +++ b/dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r3.ebuild
143 @@ -0,0 +1,111 @@
144 +# Copyright 1999-2022 Gentoo Authors
145 +# Distributed under the terms of the GNU General Public License v2
146 +
147 +EAPI=8
148 +
149 +inherit flag-o-matic toolchain-funcs
150 +
151 +DESCRIPTION="Free Win64 runtime and import library definitions"
152 +HOMEPAGE="https://www.mingw-w64.org/"
153 +SRC_URI="mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2"
154 +S="${WORKDIR}/mingw-w64-v${PV}"
155 +
156 +LICENSE="ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain tools? ( GPL-3+ )"
157 +SLOT="0"
158 +KEYWORDS="~amd64 ~x86"
159 +# USE=libraries needs working stage2 compiler: bug #665512
160 +IUSE="headers-only idl libraries tools"
161 +RESTRICT="strip"
162 +
163 +PATCHES=(
164 + "${FILESDIR}"/${PN}-7.0.0-fortify-only-ssp.patch
165 + "${FILESDIR}"/${P}-__rdtsc.patch
166 + "${FILESDIR}"/${P}-udivmod.patch
167 +)
168 +
169 +pkg_setup() {
170 + : ${CBUILD:=${CHOST}}
171 + : ${CTARGET:=${CHOST}}
172 + [[ ${CTARGET} == ${CHOST} && ${CATEGORY} == cross-* ]] &&
173 + CTARGET=${CATEGORY#cross-}
174 +
175 + [[ ${CHOST} != ${CTARGET} ]] && MW_CROSS=true || MW_CROSS=false
176 +
177 + [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] &&
178 + die "Invalid configuration, please see: https://wiki.gentoo.org/wiki/Mingw"
179 +}
180 +
181 +src_configure() {
182 + CHOST=${CTARGET}
183 + strip-unsupported-flags
184 +
185 + # Normally mingw64 does not use dynamic linker.
186 + # But at configure time it uses $LDFLAGS.
187 + # When default -Wl,--hash-style=gnu is passed
188 + # __CTORS_LIST__ / __DTORS_LIST__ is mis-detected
189 + # for target ld and binaries crash at shutdown.
190 + filter-ldflags '-Wl,--hash-style=*'
191 +
192 + local prefix=${EPREFIX}/usr
193 + ${MW_CROSS} && prefix+=/${CTARGET}/usr
194 +
195 + local conf=(
196 + --prefix="${prefix}"
197 + --libdir="${prefix}"/lib
198 + $(use_with !headers-only crt)
199 +
200 + # By default configure tries to set --sysroot=${prefix}. We disable
201 + # this behaviour with --with-sysroot=no to use gcc's sysroot default.
202 + # That way we can cross-build mingw64-runtime with cross-emerge.
203 + --with-sysroot=no
204 + )
205 +
206 + if use !headers-only; then
207 + conf+=(
208 + $(use_enable idl)
209 + $(use_with libraries)
210 + $(use_with tools)
211 + )
212 +
213 + # prefer tuple to determine if should do 32 or 64bits, but fall
214 + # back to cpp test if missing (bug #584858, see also #840662)
215 + local b32=true
216 + case ${CHOST} in
217 + x86_64-*) b32=false;;
218 + i*86-*) ;;
219 + *) [[ $($(tc-getCPP) -dM - <<<'') =~ __MINGW64__ ]] && b32=false;;
220 + esac
221 + ${b32} &&
222 + conf+=( --enable-lib32 --disable-lib64 ) ||
223 + conf+=( --disable-lib32 --enable-lib64 )
224 +
225 + # prepare temporary headers install to build against same-version
226 + mkdir ../headers || die
227 + pushd ../headers >/dev/null || die
228 + ECONF_SOURCE=${S} econf --prefix="${T}"/root --without-crt
229 + popd >/dev/null || die
230 +
231 + append-cppflags "-I${T}/root/include"
232 + fi
233 +
234 + econf "${conf[@]}"
235 +}
236 +
237 +src_compile() {
238 + use headers-only || emake -C ../headers install
239 +
240 + default
241 +}
242 +
243 +src_install() {
244 + default
245 +
246 + if ${MW_CROSS}; then
247 + # gcc is configured to look at specific hard-coded paths for mingw #419601
248 + dosym usr /usr/${CTARGET}/mingw
249 + dosym usr /usr/${CTARGET}/${CTARGET}
250 + dosym usr/include /usr/${CTARGET}/sys-include
251 + fi
252 +
253 + rm -r "${ED}"/usr/share || die
254 +}
255
256 diff --git a/dev-util/mingw64-runtime/mingw64-runtime-9.0.0-r2.ebuild b/dev-util/mingw64-runtime/mingw64-runtime-9.0.0-r2.ebuild
257 new file mode 100644
258 index 000000000000..8c12697778ba
259 --- /dev/null
260 +++ b/dev-util/mingw64-runtime/mingw64-runtime-9.0.0-r2.ebuild
261 @@ -0,0 +1,109 @@
262 +# Copyright 1999-2022 Gentoo Authors
263 +# Distributed under the terms of the GNU General Public License v2
264 +
265 +EAPI=8
266 +
267 +inherit flag-o-matic toolchain-funcs
268 +
269 +DESCRIPTION="Free Win64 runtime and import library definitions"
270 +HOMEPAGE="https://www.mingw-w64.org/"
271 +SRC_URI="mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2"
272 +S="${WORKDIR}/mingw-w64-v${PV}"
273 +
274 +LICENSE="ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain tools? ( GPL-3+ )"
275 +SLOT="0"
276 +KEYWORDS="~amd64 ~x86"
277 +# USE=libraries needs working stage2 compiler: bug #665512
278 +IUSE="headers-only idl libraries tools"
279 +RESTRICT="strip"
280 +
281 +PATCHES=(
282 + "${FILESDIR}"/${PN}-7.0.0-fortify-only-ssp.patch
283 +)
284 +
285 +pkg_setup() {
286 + : ${CBUILD:=${CHOST}}
287 + : ${CTARGET:=${CHOST}}
288 + [[ ${CTARGET} == ${CHOST} && ${CATEGORY} == cross-* ]] &&
289 + CTARGET=${CATEGORY#cross-}
290 +
291 + [[ ${CHOST} != ${CTARGET} ]] && MW_CROSS=true || MW_CROSS=false
292 +
293 + [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] &&
294 + die "Invalid configuration, please see: https://wiki.gentoo.org/wiki/Mingw"
295 +}
296 +
297 +src_configure() {
298 + CHOST=${CTARGET}
299 + strip-unsupported-flags
300 +
301 + # Normally mingw64 does not use dynamic linker.
302 + # But at configure time it uses $LDFLAGS.
303 + # When default -Wl,--hash-style=gnu is passed
304 + # __CTORS_LIST__ / __DTORS_LIST__ is mis-detected
305 + # for target ld and binaries crash at shutdown.
306 + filter-ldflags '-Wl,--hash-style=*'
307 +
308 + local prefix=${EPREFIX}/usr
309 + ${MW_CROSS} && prefix+=/${CTARGET}/usr
310 +
311 + local conf=(
312 + --prefix="${prefix}"
313 + --libdir="${prefix}"/lib
314 + $(use_with !headers-only crt)
315 +
316 + # By default configure tries to set --sysroot=${prefix}. We disable
317 + # this behaviour with --with-sysroot=no to use gcc's sysroot default.
318 + # That way we can cross-build mingw64-runtime with cross-emerge.
319 + --with-sysroot=no
320 + )
321 +
322 + if use !headers-only; then
323 + conf+=(
324 + $(use_enable idl)
325 + $(use_with libraries)
326 + $(use_with tools)
327 + )
328 +
329 + # prefer tuple to determine if should do 32 or 64bits, but fall
330 + # back to cpp test if missing (bug #584858, see also #840662)
331 + local b32=true
332 + case ${CHOST} in
333 + x86_64-*) b32=false;;
334 + i*86-*) ;;
335 + *) [[ $($(tc-getCPP) -dM - <<<'') =~ __MINGW64__ ]] && b32=false;;
336 + esac
337 + ${b32} &&
338 + conf+=( --enable-lib32 --disable-lib64 ) ||
339 + conf+=( --disable-lib32 --enable-lib64 )
340 +
341 + # prepare temporary headers install to build against same-version
342 + mkdir ../headers || die
343 + pushd ../headers >/dev/null || die
344 + ECONF_SOURCE=${S} econf --prefix="${T}"/root --without-crt
345 + popd >/dev/null || die
346 +
347 + append-cppflags "-I${T}/root/include"
348 + fi
349 +
350 + econf "${conf[@]}"
351 +}
352 +
353 +src_compile() {
354 + use headers-only || emake -C ../headers install
355 +
356 + default
357 +}
358 +
359 +src_install() {
360 + default
361 +
362 + if ${MW_CROSS}; then
363 + # gcc is configured to look at specific hard-coded paths for mingw #419601
364 + dosym usr /usr/${CTARGET}/mingw
365 + dosym usr /usr/${CTARGET}/${CTARGET}
366 + dosym usr/include /usr/${CTARGET}/sys-include
367 + fi
368 +
369 + rm -r "${ED}"/usr/share || die
370 +}