summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIonen Wolkens <ionen@gentoo.org>2022-05-10 03:06:43 -0400
committerIonen Wolkens <ionen@gentoo.org>2022-05-12 22:29:29 -0400
commit4b7c1923fca6533a51be68bfbacc793469a521d4 (patch)
tree32ab9f4a6317f71bf9a23c34d3258ec172b6dc9b /dev-util/mingw64-runtime
parentdev-util/mingw64-runtime: re-arrange ebuilds some more (diff)
downloadgentoo-4b7c1923fca6533a51be68bfbacc793469a521d4.tar.gz
gentoo-4b7c1923fca6533a51be68bfbacc793469a521d4.tar.bz2
gentoo-4b7c1923fca6533a51be68bfbacc793469a521d4.zip
dev-util/mingw64-runtime: build tools for CHOST and add widl
Non-native USE=tools never made much sense, If a package is cross-compiling for mingw using e.g. widl, it'll need to be able to run the tool. This also prevents build failure (bug #644556) during bootstrap given this won't be trying to link with mingw (note that can cross-emerge mingw64-runtime for old behavior). wrt widl, it is provided by wine but that is a heavy dependency and some upstreams (e.g. vkd3d-proton) default to using *-w64-mingw32-widl instead -- small tool so may as well install it. Closes: https://bugs.gentoo.org/644556 Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'dev-util/mingw64-runtime')
-rw-r--r--dev-util/mingw64-runtime/mingw64-runtime-10.0.0-r1.ebuild33
-rw-r--r--dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r3.ebuild33
-rw-r--r--dev-util/mingw64-runtime/mingw64-runtime-9.0.0-r2.ebuild33
3 files changed, 87 insertions, 12 deletions
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
index 8c12697778ba..61ebf16b4393 100644
--- a/dev-util/mingw64-runtime/mingw64-runtime-10.0.0-r1.ebuild
+++ b/dev-util/mingw64-runtime/mingw64-runtime-10.0.0-r1.ebuild
@@ -33,8 +33,32 @@ pkg_setup() {
die "Invalid configuration, please see: https://wiki.gentoo.org/wiki/Mingw"
}
+mingw-foreach_tool() {
+ use !tools || use headers-only && return
+
+ local tool
+ for tool in gendef genidl widl; do
+ # not using top-level --with-tools given it skips widl
+ pushd mingw-w64-tools/${tool} || die
+ "${@}"
+ popd >/dev/null || die
+ done
+}
+
src_configure() {
- CHOST=${CTARGET}
+ # native tools, see #644556
+ local toolsconf=(
+ --prefix="${EPREFIX}"/usr
+ )
+ # normally only widl is prefixed, but avoids clash with other targets
+ ${MW_CROSS} && toolsconf+=( --program-prefix=${CTARGET}- )
+
+ mingw-foreach_tool econf "${toolsconf[@]}"
+
+ MW_LDFLAGS=${LDFLAGS} # keep non-stripped for gendef not respecting it
+
+ # cross-compiling from here
+ local CHOST=${CTARGET}
strip-unsupported-flags
# Normally mingw64 does not use dynamic linker.
@@ -62,7 +86,6 @@ src_configure() {
conf+=(
$(use_enable idl)
$(use_with libraries)
- $(use_with tools)
)
# prefer tuple to determine if should do 32 or 64bits, but fall
@@ -91,13 +114,15 @@ src_configure() {
src_compile() {
use headers-only || emake -C ../headers install
-
- default
+ emake
+ mingw-foreach_tool emake LDFLAGS="${MW_LDFLAGS}"
}
src_install() {
default
+ mingw-foreach_tool emake DESTDIR="${D}" install
+
if ${MW_CROSS}; then
# gcc is configured to look at specific hard-coded paths for mingw #419601
dosym usr /usr/${CTARGET}/mingw
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
index f287baeaa601..cde42642c57b 100644
--- a/dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r3.ebuild
+++ b/dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r3.ebuild
@@ -35,8 +35,32 @@ pkg_setup() {
die "Invalid configuration, please see: https://wiki.gentoo.org/wiki/Mingw"
}
+mingw-foreach_tool() {
+ use !tools || use headers-only && return
+
+ local tool
+ for tool in gendef genidl widl; do
+ # not using top-level --with-tools given it skips widl
+ pushd mingw-w64-tools/${tool} || die
+ "${@}"
+ popd >/dev/null || die
+ done
+}
+
src_configure() {
- CHOST=${CTARGET}
+ # native tools, see #644556
+ local toolsconf=(
+ --prefix="${EPREFIX}"/usr
+ )
+ # normally only widl is prefixed, but avoids clash with other targets
+ ${MW_CROSS} && toolsconf+=( --program-prefix=${CTARGET}- )
+
+ mingw-foreach_tool econf "${toolsconf[@]}"
+
+ MW_LDFLAGS=${LDFLAGS} # keep non-stripped for gendef not respecting it
+
+ # cross-compiling from here
+ local CHOST=${CTARGET}
strip-unsupported-flags
# Normally mingw64 does not use dynamic linker.
@@ -64,7 +88,6 @@ src_configure() {
conf+=(
$(use_enable idl)
$(use_with libraries)
- $(use_with tools)
)
# prefer tuple to determine if should do 32 or 64bits, but fall
@@ -93,13 +116,15 @@ src_configure() {
src_compile() {
use headers-only || emake -C ../headers install
-
- default
+ emake
+ mingw-foreach_tool emake LDFLAGS="${MW_LDFLAGS}"
}
src_install() {
default
+ mingw-foreach_tool emake DESTDIR="${D}" install
+
if ${MW_CROSS}; then
# gcc is configured to look at specific hard-coded paths for mingw #419601
dosym usr /usr/${CTARGET}/mingw
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
index 8c12697778ba..61ebf16b4393 100644
--- a/dev-util/mingw64-runtime/mingw64-runtime-9.0.0-r2.ebuild
+++ b/dev-util/mingw64-runtime/mingw64-runtime-9.0.0-r2.ebuild
@@ -33,8 +33,32 @@ pkg_setup() {
die "Invalid configuration, please see: https://wiki.gentoo.org/wiki/Mingw"
}
+mingw-foreach_tool() {
+ use !tools || use headers-only && return
+
+ local tool
+ for tool in gendef genidl widl; do
+ # not using top-level --with-tools given it skips widl
+ pushd mingw-w64-tools/${tool} || die
+ "${@}"
+ popd >/dev/null || die
+ done
+}
+
src_configure() {
- CHOST=${CTARGET}
+ # native tools, see #644556
+ local toolsconf=(
+ --prefix="${EPREFIX}"/usr
+ )
+ # normally only widl is prefixed, but avoids clash with other targets
+ ${MW_CROSS} && toolsconf+=( --program-prefix=${CTARGET}- )
+
+ mingw-foreach_tool econf "${toolsconf[@]}"
+
+ MW_LDFLAGS=${LDFLAGS} # keep non-stripped for gendef not respecting it
+
+ # cross-compiling from here
+ local CHOST=${CTARGET}
strip-unsupported-flags
# Normally mingw64 does not use dynamic linker.
@@ -62,7 +86,6 @@ src_configure() {
conf+=(
$(use_enable idl)
$(use_with libraries)
- $(use_with tools)
)
# prefer tuple to determine if should do 32 or 64bits, but fall
@@ -91,13 +114,15 @@ src_configure() {
src_compile() {
use headers-only || emake -C ../headers install
-
- default
+ emake
+ mingw-foreach_tool emake LDFLAGS="${MW_LDFLAGS}"
}
src_install() {
default
+ mingw-foreach_tool emake DESTDIR="${D}" install
+
if ${MW_CROSS}; then
# gcc is configured to look at specific hard-coded paths for mingw #419601
dosym usr /usr/${CTARGET}/mingw