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:50
Message-Id: 1652408969.4b7c1923fca6533a51be68bfbacc793469a521d4.ionen@gentoo
1 commit: 4b7c1923fca6533a51be68bfbacc793469a521d4
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 10 07:06:43 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=4b7c1923
7
8 dev-util/mingw64-runtime: build tools for CHOST and add widl
9
10 Non-native USE=tools never made much sense, If a package is
11 cross-compiling for mingw using e.g. widl, it'll need to be able
12 to run the tool. This also prevents build failure (bug #644556)
13 during bootstrap given this won't be trying to link with mingw
14 (note that can cross-emerge mingw64-runtime for old behavior).
15
16 wrt widl, it is provided by wine but that is a heavy dependency and
17 some upstreams (e.g. vkd3d-proton) default to using *-w64-mingw32-widl
18 instead -- small tool so may as well install it.
19
20 Closes: https://bugs.gentoo.org/644556
21 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
22
23 .../mingw64-runtime-10.0.0-r1.ebuild | 33 +++++++++++++++++++---
24 .../mingw64-runtime-8.0.0-r3.ebuild | 33 +++++++++++++++++++---
25 .../mingw64-runtime-9.0.0-r2.ebuild | 33 +++++++++++++++++++---
26 3 files changed, 87 insertions(+), 12 deletions(-)
27
28 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
29 index 8c12697778ba..61ebf16b4393 100644
30 --- a/dev-util/mingw64-runtime/mingw64-runtime-10.0.0-r1.ebuild
31 +++ b/dev-util/mingw64-runtime/mingw64-runtime-10.0.0-r1.ebuild
32 @@ -33,8 +33,32 @@ pkg_setup() {
33 die "Invalid configuration, please see: https://wiki.gentoo.org/wiki/Mingw"
34 }
35
36 +mingw-foreach_tool() {
37 + use !tools || use headers-only && return
38 +
39 + local tool
40 + for tool in gendef genidl widl; do
41 + # not using top-level --with-tools given it skips widl
42 + pushd mingw-w64-tools/${tool} || die
43 + "${@}"
44 + popd >/dev/null || die
45 + done
46 +}
47 +
48 src_configure() {
49 - CHOST=${CTARGET}
50 + # native tools, see #644556
51 + local toolsconf=(
52 + --prefix="${EPREFIX}"/usr
53 + )
54 + # normally only widl is prefixed, but avoids clash with other targets
55 + ${MW_CROSS} && toolsconf+=( --program-prefix=${CTARGET}- )
56 +
57 + mingw-foreach_tool econf "${toolsconf[@]}"
58 +
59 + MW_LDFLAGS=${LDFLAGS} # keep non-stripped for gendef not respecting it
60 +
61 + # cross-compiling from here
62 + local CHOST=${CTARGET}
63 strip-unsupported-flags
64
65 # Normally mingw64 does not use dynamic linker.
66 @@ -62,7 +86,6 @@ src_configure() {
67 conf+=(
68 $(use_enable idl)
69 $(use_with libraries)
70 - $(use_with tools)
71 )
72
73 # prefer tuple to determine if should do 32 or 64bits, but fall
74 @@ -91,13 +114,15 @@ src_configure() {
75
76 src_compile() {
77 use headers-only || emake -C ../headers install
78 -
79 - default
80 + emake
81 + mingw-foreach_tool emake LDFLAGS="${MW_LDFLAGS}"
82 }
83
84 src_install() {
85 default
86
87 + mingw-foreach_tool emake DESTDIR="${D}" install
88 +
89 if ${MW_CROSS}; then
90 # gcc is configured to look at specific hard-coded paths for mingw #419601
91 dosym usr /usr/${CTARGET}/mingw
92
93 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
94 index f287baeaa601..cde42642c57b 100644
95 --- a/dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r3.ebuild
96 +++ b/dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r3.ebuild
97 @@ -35,8 +35,32 @@ pkg_setup() {
98 die "Invalid configuration, please see: https://wiki.gentoo.org/wiki/Mingw"
99 }
100
101 +mingw-foreach_tool() {
102 + use !tools || use headers-only && return
103 +
104 + local tool
105 + for tool in gendef genidl widl; do
106 + # not using top-level --with-tools given it skips widl
107 + pushd mingw-w64-tools/${tool} || die
108 + "${@}"
109 + popd >/dev/null || die
110 + done
111 +}
112 +
113 src_configure() {
114 - CHOST=${CTARGET}
115 + # native tools, see #644556
116 + local toolsconf=(
117 + --prefix="${EPREFIX}"/usr
118 + )
119 + # normally only widl is prefixed, but avoids clash with other targets
120 + ${MW_CROSS} && toolsconf+=( --program-prefix=${CTARGET}- )
121 +
122 + mingw-foreach_tool econf "${toolsconf[@]}"
123 +
124 + MW_LDFLAGS=${LDFLAGS} # keep non-stripped for gendef not respecting it
125 +
126 + # cross-compiling from here
127 + local CHOST=${CTARGET}
128 strip-unsupported-flags
129
130 # Normally mingw64 does not use dynamic linker.
131 @@ -64,7 +88,6 @@ src_configure() {
132 conf+=(
133 $(use_enable idl)
134 $(use_with libraries)
135 - $(use_with tools)
136 )
137
138 # prefer tuple to determine if should do 32 or 64bits, but fall
139 @@ -93,13 +116,15 @@ src_configure() {
140
141 src_compile() {
142 use headers-only || emake -C ../headers install
143 -
144 - default
145 + emake
146 + mingw-foreach_tool emake LDFLAGS="${MW_LDFLAGS}"
147 }
148
149 src_install() {
150 default
151
152 + mingw-foreach_tool emake DESTDIR="${D}" install
153 +
154 if ${MW_CROSS}; then
155 # gcc is configured to look at specific hard-coded paths for mingw #419601
156 dosym usr /usr/${CTARGET}/mingw
157
158 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
159 index 8c12697778ba..61ebf16b4393 100644
160 --- a/dev-util/mingw64-runtime/mingw64-runtime-9.0.0-r2.ebuild
161 +++ b/dev-util/mingw64-runtime/mingw64-runtime-9.0.0-r2.ebuild
162 @@ -33,8 +33,32 @@ pkg_setup() {
163 die "Invalid configuration, please see: https://wiki.gentoo.org/wiki/Mingw"
164 }
165
166 +mingw-foreach_tool() {
167 + use !tools || use headers-only && return
168 +
169 + local tool
170 + for tool in gendef genidl widl; do
171 + # not using top-level --with-tools given it skips widl
172 + pushd mingw-w64-tools/${tool} || die
173 + "${@}"
174 + popd >/dev/null || die
175 + done
176 +}
177 +
178 src_configure() {
179 - CHOST=${CTARGET}
180 + # native tools, see #644556
181 + local toolsconf=(
182 + --prefix="${EPREFIX}"/usr
183 + )
184 + # normally only widl is prefixed, but avoids clash with other targets
185 + ${MW_CROSS} && toolsconf+=( --program-prefix=${CTARGET}- )
186 +
187 + mingw-foreach_tool econf "${toolsconf[@]}"
188 +
189 + MW_LDFLAGS=${LDFLAGS} # keep non-stripped for gendef not respecting it
190 +
191 + # cross-compiling from here
192 + local CHOST=${CTARGET}
193 strip-unsupported-flags
194
195 # Normally mingw64 does not use dynamic linker.
196 @@ -62,7 +86,6 @@ src_configure() {
197 conf+=(
198 $(use_enable idl)
199 $(use_with libraries)
200 - $(use_with tools)
201 )
202
203 # prefer tuple to determine if should do 32 or 64bits, but fall
204 @@ -91,13 +114,15 @@ src_configure() {
205
206 src_compile() {
207 use headers-only || emake -C ../headers install
208 -
209 - default
210 + emake
211 + mingw-foreach_tool emake LDFLAGS="${MW_LDFLAGS}"
212 }
213
214 src_install() {
215 default
216
217 + mingw-foreach_tool emake DESTDIR="${D}" install
218 +
219 if ${MW_CROSS}; then
220 # gcc is configured to look at specific hard-coded paths for mingw #419601
221 dosym usr /usr/${CTARGET}/mingw