Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-runtime/
Date: Mon, 05 Jul 2021 22:50:38
Message-Id: 1625525423.607450dc409bf7978c2357ee771d0e0968b1a62f.slyfox@gentoo
1 commit: 607450dc409bf7978c2357ee771d0e0968b1a62f
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jul 5 22:48:09 2021 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 5 22:50:23 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=607450dc
7
8 dev-util/mingw64-runtime: bump up to 9.0.0
9
10 Reported-by: Mike Lothian
11 Closes: https://bugs.gentoo.org/799212
12 Package-Manager: Portage-3.0.20, Repoman-3.0.3
13 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
14
15 dev-util/mingw64-runtime/Manifest | 1 +
16 .../mingw64-runtime/mingw64-runtime-9.0.0.ebuild | 119 +++++++++++++++++++++
17 2 files changed, 120 insertions(+)
18
19 diff --git a/dev-util/mingw64-runtime/Manifest b/dev-util/mingw64-runtime/Manifest
20 index 6f80cb79411..28cfb0b7ae4 100644
21 --- a/dev-util/mingw64-runtime/Manifest
22 +++ b/dev-util/mingw64-runtime/Manifest
23 @@ -1,2 +1,3 @@
24 DIST mingw-w64-v7.0.0.tar.bz2 9071231 BLAKE2B da00794ec456ede5913a565248c79255407c058469cb7338cf81b8d03c1e39f4189016b01734b786c0ad8f18166a24fdb95ca72edc954f31151e5d3aa2b2a899 SHA512 30e5b2824a24eeb99ab519e3fc134cc9a7f04ee8b853bc8d66a13d1ab74144bf78b93e162bfe6de2a5e61f63c0e620a933b260b02d019cd68cc4b78bd36c67fd
25 DIST mingw-w64-v8.0.0.tar.bz2 9370799 BLAKE2B ec65191722f6f2ddbb93488ea4c4c21e22fb5ef777ef293d65d13de1057d96c9105a4a4936999d4babbd8fdfc52ed14675f1c5fbc630524df28805e0f66b1a2b SHA512 cefcc86ac3e6337c88ed224ab4692abbd5eb543ce78fb6c5462198a85f36c9274a0a1df0a0bebd182137fd527c15831f9237c782711a85f32e77d9104b28359e
26 +DIST mingw-w64-v9.0.0.tar.bz2 9537758 BLAKE2B 298b97f50c7632972aee2c75e90de0776f64c1dd5aaeb52d4e4be10a8e0365efee82c93179990cc090cc7b9f83525a7abf51a5d069b7a3e39abb37fdb733a70c SHA512 6691331a2ab521d22c1d32bebe0ed049bd62a7a7722cff38e7792b4e42c6b8df4356084afff6c916b487b3ebddc4372b398ab7cd0c7f4ff6991a70fe64177386
27
28 diff --git a/dev-util/mingw64-runtime/mingw64-runtime-9.0.0.ebuild b/dev-util/mingw64-runtime/mingw64-runtime-9.0.0.ebuild
29 new file mode 100644
30 index 00000000000..3dfff3894bf
31 --- /dev/null
32 +++ b/dev-util/mingw64-runtime/mingw64-runtime-9.0.0.ebuild
33 @@ -0,0 +1,119 @@
34 +# Copyright 1999-2021 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=7
38 +
39 +export CBUILD=${CBUILD:-${CHOST}}
40 +export CTARGET=${CTARGET:-${CHOST}}
41 +if [[ ${CTARGET} == ${CHOST} ]] ; then
42 + if [[ ${CATEGORY} == cross-* ]] ; then
43 + export CTARGET=${CATEGORY#cross-}
44 + fi
45 +fi
46 +
47 +inherit autotools flag-o-matic toolchain-funcs
48 +
49 +DESCRIPTION="Free Win64 runtime and import library definitions"
50 +HOMEPAGE="http://mingw-w64.sourceforge.net/"
51 +SRC_URI="mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2"
52 +
53 +LICENSE="BSD"
54 +SLOT="0"
55 +KEYWORDS="~amd64 ~x86"
56 +# USE=libraries needs working stage2 compiler: bug #665512
57 +IUSE="headers-only idl libraries tools"
58 +RESTRICT="strip"
59 +
60 +S="${WORKDIR}/mingw-w64-v${PV}"
61 +
62 +PATCHES=(
63 + "${FILESDIR}"/${PN}-7.0.0-fortify-only-ssp.patch
64 + "${FILESDIR}"/${PN}-8.0.0-__rdtsc.patch
65 +)
66 +
67 +is_crosscompile() {
68 + [[ ${CHOST} != ${CTARGET} ]]
69 +}
70 +just_headers() {
71 + use headers-only
72 +}
73 +alt_prefix() {
74 + is_crosscompile && echo /usr/${CTARGET}
75 +}
76 +crt_with() {
77 + just_headers && echo --without-$1 || echo --with-$1
78 +}
79 +crt_use_enable() {
80 + just_headers && echo --without-$2 || use_enable "$@"
81 +}
82 +crt_use_with() {
83 + just_headers && echo --without-$2 || use_with "$@"
84 +}
85 +
86 +pkg_setup() {
87 + if [[ ${CBUILD} == ${CHOST} ]] && [[ ${CHOST} == ${CTARGET} ]] ; then
88 + die "Invalid configuration"
89 + fi
90 +}
91 +
92 +src_configure() {
93 + CHOST=${CTARGET} strip-unsupported-flags
94 + # Normally mingw-64 does not use dynamic linker.
95 + # But at configure time it uses $LDFLAGS.
96 + # When default -Wl,--hash-style=gnu is passed
97 + # __CTORS_LIST__ / __DTORS_LIST__ is mis-detected
98 + # for target ld and binaries crash at shutdown.
99 + filter-ldflags '-Wl,--hash-style=*'
100 +
101 + if ! just_headers; then
102 + mkdir "${WORKDIR}/headers"
103 + pushd "${WORKDIR}/headers" > /dev/null
104 + CHOST=${CTARGET} "${S}/configure" \
105 + --prefix="${T}/tmproot" \
106 + --with-headers \
107 + --without-crt \
108 + || die
109 + popd > /dev/null
110 + append-cppflags "-I${T}/tmproot/include"
111 + fi
112 +
113 + # By default configure tries to set --sysroot=${prefix}. We disable
114 + # this behaviour with --with-sysroot=no to use gcc's sysroot default.
115 + # That way we can cross-build mingw64-runtime with cross-emerge.
116 + local prefix="${EPREFIX}"$(alt_prefix)/usr
117 + CHOST=${CTARGET} econf \
118 + --with-sysroot=no \
119 + --prefix="${prefix}" \
120 + --libdir="${prefix}"/lib \
121 + --with-headers \
122 + --enable-sdk \
123 + $(crt_with crt) \
124 + $(crt_use_enable idl idl) \
125 + $(crt_use_with libraries libraries) \
126 + $(crt_use_with tools tools) \
127 + $(
128 + $(tc-getCPP ${CTARGET}) ${CPPFLAGS} -dM - < /dev/null | grep -q __MINGW64__ \
129 + && echo --disable-lib32 --enable-lib64 \
130 + || echo --enable-lib32 --disable-lib64
131 + )
132 +}
133 +
134 +src_compile() {
135 + if ! just_headers; then
136 + emake -C "${WORKDIR}/headers" install
137 + fi
138 + default
139 +}
140 +
141 +src_install() {
142 + default
143 +
144 + if is_crosscompile ; then
145 + # gcc is configured to look at specific hard-coded paths for mingw #419601
146 + dosym usr /usr/${CTARGET}/mingw
147 + dosym usr /usr/${CTARGET}/${CTARGET}
148 + dosym usr/include /usr/${CTARGET}/sys-include
149 + fi
150 +
151 + rm -rf "${ED}/usr/share"
152 +}