summaryrefslogtreecommitdiff
path: root/dev-util/mingw64-runtime
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
commit0f558761aa2dee1017b4751e4017205e015a9560 (patch)
tree037df795519468a25d9362b4e95cdaeb84eb1cf9 /dev-util/mingw64-runtime
parent752d6256e5204b958b0ef7905675a940b5e9172f (diff)
gentoo resync : 29.12.2022
Diffstat (limited to 'dev-util/mingw64-runtime')
-rw-r--r--dev-util/mingw64-runtime/Manifest8
-rw-r--r--dev-util/mingw64-runtime/metadata.xml10
-rw-r--r--dev-util/mingw64-runtime/mingw64-runtime-10.0.0-r1.ebuild137
-rw-r--r--dev-util/mingw64-runtime/mingw64-runtime-10.0.0.ebuild120
-rw-r--r--dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r2.ebuild122
-rw-r--r--dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r3.ebuild138
-rw-r--r--dev-util/mingw64-runtime/mingw64-runtime-9.0.0-r1.ebuild120
-rw-r--r--dev-util/mingw64-runtime/mingw64-runtime-9.0.0-r2.ebuild136
8 files changed, 422 insertions, 369 deletions
diff --git a/dev-util/mingw64-runtime/Manifest b/dev-util/mingw64-runtime/Manifest
index 7eec69ce715e..cd1331f6e704 100644
--- a/dev-util/mingw64-runtime/Manifest
+++ b/dev-util/mingw64-runtime/Manifest
@@ -4,7 +4,7 @@ AUX mingw64-runtime-8.0.0-udivmod.patch 865 BLAKE2B 848b45fb68c775baa5b285293df0
DIST mingw-w64-v10.0.0.tar.bz2 9620291 BLAKE2B 451372403289c492ca939d65bb4d9f6e9fa6bdd6b32d79d6438d858e106e8cc291712ada1f3f7b951a4c6908e7d0385d485ca76920af39bcf86effa48408e330 SHA512 3c0827af7c40809a867758f6cd9ef3ff0c988b43082345bf725e03949af95968d634ace99a7ffae323189549221dcb5d861de9e801f1fbc7904e446641b60516
DIST mingw-w64-v8.0.0.tar.bz2 9370799 BLAKE2B ec65191722f6f2ddbb93488ea4c4c21e22fb5ef777ef293d65d13de1057d96c9105a4a4936999d4babbd8fdfc52ed14675f1c5fbc630524df28805e0f66b1a2b SHA512 cefcc86ac3e6337c88ed224ab4692abbd5eb543ce78fb6c5462198a85f36c9274a0a1df0a0bebd182137fd527c15831f9237c782711a85f32e77d9104b28359e
DIST mingw-w64-v9.0.0.tar.bz2 9537758 BLAKE2B 298b97f50c7632972aee2c75e90de0776f64c1dd5aaeb52d4e4be10a8e0365efee82c93179990cc090cc7b9f83525a7abf51a5d069b7a3e39abb37fdb733a70c SHA512 6691331a2ab521d22c1d32bebe0ed049bd62a7a7722cff38e7792b4e42c6b8df4356084afff6c916b487b3ebddc4372b398ab7cd0c7f4ff6991a70fe64177386
-EBUILD mingw64-runtime-10.0.0.ebuild 3071 BLAKE2B fdbb874b182c86e125ce54b575cb683270b221cb7cea568733784a25c8c48a97bdbaa6d783ae05d4e0e095bd52f5a877e2d0f3532a54b7183e12bd27c24a67fb SHA512 c94d482c0bee8fdcd1a45a8fd527cffba3fc546149555163e8c8fc838c977e6ce21acd703cdf4771ac9179e060fc163728dbca503121077fe3f6a7840dc57373
-EBUILD mingw64-runtime-8.0.0-r2.ebuild 3139 BLAKE2B e4ba23887bdc3152f5892e628a76aec7d4df2214f8e64c6783b6b77f63071572851b5ef5c734e9aceb0a48bf7fed214070b12f2be74ee9343edbc17c25ea3561 SHA512 8024896d0d111be6dae9e003a90cfe33e21b72e21230ff45372a22a1eac60c9c21c9b54b9696035e5266069cb1ab2d78dff72f1e4ef5f990829022a76f485c6d
-EBUILD mingw64-runtime-9.0.0-r1.ebuild 3071 BLAKE2B fdbb874b182c86e125ce54b575cb683270b221cb7cea568733784a25c8c48a97bdbaa6d783ae05d4e0e095bd52f5a877e2d0f3532a54b7183e12bd27c24a67fb SHA512 c94d482c0bee8fdcd1a45a8fd527cffba3fc546149555163e8c8fc838c977e6ce21acd703cdf4771ac9179e060fc163728dbca503121077fe3f6a7840dc57373
-MISC metadata.xml 676 BLAKE2B f799f3635f3b3ee45700c4b477e80f345473fb3b5e65a70168747ed6064ae984000d84be368de632a231b2994003650028201a30c9b06463e821957510b0f9d3 SHA512 c6789e67985aebdc9216837e109d14eff760cb3f4563c08d3c171e3755f3d49c5a2ae7321cc596ef27ae43bd7d918626443108a1332abc86aee82763fc0045b8
+EBUILD mingw64-runtime-10.0.0-r1.ebuild 3821 BLAKE2B e0d8d9849026ef80aa32362ced9dafa928997c037abf9ef8d59380bfcabd6c0067164fb11b76a43c2c8bad694d945d6e2bdfd55a6d4a7d7e90afd2d59b16d71e SHA512 fa52708dd8a7d472f4fae3f7613d8de0a49fe91fa54f40a78af5e07436c41b86de24f80c1f2ffd5945d56d62bafd7739e6f4f03f1a3150b153b300b746859ece
+EBUILD mingw64-runtime-8.0.0-r3.ebuild 3826 BLAKE2B f7fdc38895e7acff66a685eaebd8ffd71f4637bc4aab9e48624675362275f5beeadf078a62e90e8d5c4b21c492453741578487e3a1a2178ffd22df765e47d4ca SHA512 3c66f71c61f5f54babc20a571eb1a7aec29eb14a7dedfd0ce575b3d65a40059df9b6c5370a7ef3cfe8715e35bc2167c290b49af5b1113fff4c760cf25da4bf30
+EBUILD mingw64-runtime-9.0.0-r2.ebuild 3758 BLAKE2B d30c933883cd1a69a7ae76f8a7a37f8752dac21447f167e201e1d031b0419171f3f4dd5f0c49c2d458d51adc777aadab90cf4efb30be17b41b19ad849a09c4a5 SHA512 1d0bf51007b942d8fc9e550997e1bf9072d8b17026444887c7a271334747cb4df5e1ecf539bc7cd2e65dcdaf15cbdd301f25bcbd2eafb2114c4947bdb8b0d3f1
+MISC metadata.xml 904 BLAKE2B b7b42242ff7a39ba87ec4889295bb1229122bd20f34c163499423d989120569d5b6c69ed9490f328aa1af8a9dd3ff2ec0f07b85910e7d2eb401f40dbd670d366 SHA512 80bb5c58cf80d7233599e772a1e615ec4b4f16bd9387539a684d11e0b7196e7a3d21f1b56d18271b9a4b0544253e3fec4130ff70702ba4cf5684941ff8d49a51
diff --git a/dev-util/mingw64-runtime/metadata.xml b/dev-util/mingw64-runtime/metadata.xml
index e2958c042969..b1a857e80f12 100644
--- a/dev-util/mingw64-runtime/metadata.xml
+++ b/dev-util/mingw64-runtime/metadata.xml
@@ -10,9 +10,13 @@
<name>Gentoo Toolchain Project</name>
</maintainer>
<use>
- <flag name="idl">Install idl files.</flag>
- <flag name="libraries">Build extra libraries: mangle, pseh, winpthreads.</flag>
- <flag name="tools">Build extra tools: gendef, genidl.</flag>
+ <flag name="default-ucrt">
+ Use ucrt instead of msvcrt-os as the default crt (WARNING:
+ incompatible with each others and also for building Wine with
+ USE=mingw, pick one from the start and keep it)</flag>
+ <flag name="idl">Install idl files</flag>
+ <flag name="libraries">Build extra libraries: mangle, pseh, winpthreads</flag>
+ <flag name="tools">Build extra tools: gendef, genidl, widl</flag>
</use>
<upstream>
<remote-id type="sourceforge">mingw-w64</remote-id>
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
new file mode 100644
index 000000000000..3b3854308f65
--- /dev/null
+++ b/dev-util/mingw64-runtime/mingw64-runtime-10.0.0-r1.ebuild
@@ -0,0 +1,137 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Free Win64 runtime and import library definitions"
+HOMEPAGE="https://www.mingw-w64.org/"
+SRC_URI="mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2"
+S="${WORKDIR}/mingw-w64-v${PV}"
+
+LICENSE="ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain tools? ( GPL-3+ )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+# USE=libraries needs working stage2 compiler: bug #665512
+IUSE="default-ucrt headers-only idl libraries tools"
+RESTRICT="strip"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-7.0.0-fortify-only-ssp.patch
+)
+
+pkg_setup() {
+ : ${CBUILD:=${CHOST}}
+ : ${CTARGET:=${CHOST}}
+ [[ ${CTARGET} == ${CHOST} && ${CATEGORY} == cross-* ]] &&
+ CTARGET=${CATEGORY#cross-}
+
+ [[ ${CHOST} != ${CTARGET} ]] && MW_CROSS=true || MW_CROSS=false
+
+ [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] &&
+ 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} >/dev/null || die
+ "${@}"
+ popd >/dev/null || die
+ done
+}
+
+src_configure() {
+ # 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
+
+ # likely cross-compiling from here, update toolchain variables
+ ${MW_CROSS} && [[ ! -v MINGW_BYPASS ]] &&
+ unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
+ local CHOST=${CTARGET}
+ strip-unsupported-flags
+
+ # Normally mingw64 does not use dynamic linker.
+ # But at configure time it uses $LDFLAGS.
+ # When default -Wl,--hash-style=gnu is passed
+ # __CTORS_LIST__ / __DTORS_LIST__ is mis-detected
+ # for target ld and binaries crash at shutdown.
+ filter-ldflags '-Wl,--hash-style=*'
+
+ local prefix=${EPREFIX}/usr
+ ${MW_CROSS} && prefix+=/${CTARGET}/usr
+
+ local conf=(
+ --prefix="${prefix}"
+ --libdir="${prefix}"/lib
+ $(use_with !headers-only crt)
+ $(usev default-ucrt --with-default-msvcrt=ucrt)
+
+ # By default configure tries to set --sysroot=${prefix}. We disable
+ # this behaviour with --with-sysroot=no to use gcc's sysroot default.
+ # That way we can cross-build mingw64-runtime with cross-emerge.
+ --with-sysroot=no
+ )
+
+ if use !headers-only; then
+ conf+=(
+ $(use_enable idl)
+ $(use_with libraries)
+ )
+
+ # prefer tuple to determine if should do 32 or 64bits, but fall
+ # back to cpp test if missing (bug #584858, see also #840662)
+ local b32=true
+ case ${CHOST} in
+ x86_64-*) b32=false;;
+ i*86-*) ;;
+ *) [[ $($(tc-getCPP) -dM - <<<'') =~ __MINGW64__ ]] && b32=false;;
+ esac
+ ${b32} &&
+ conf+=( --enable-lib32 --disable-lib64 ) ||
+ conf+=( --disable-lib32 --enable-lib64 )
+
+ # prepare temporary headers install to build against same-version
+ mkdir ../headers || die
+ pushd ../headers >/dev/null || die
+ ECONF_SOURCE=${S} econf --prefix="${T}"/root --without-crt
+ popd >/dev/null || die
+
+ append-cppflags "-I${T}/root/include"
+ fi
+
+ econf "${conf[@]}"
+}
+
+src_compile() {
+ use headers-only || emake -C ../headers install
+ 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
+ dosym usr /usr/${CTARGET}/${CTARGET}
+ dosym usr/include /usr/${CTARGET}/sys-include
+ fi
+
+ rm -r "${ED}"/usr/share || die
+}
diff --git a/dev-util/mingw64-runtime/mingw64-runtime-10.0.0.ebuild b/dev-util/mingw64-runtime/mingw64-runtime-10.0.0.ebuild
deleted file mode 100644
index 077a2a52ccd6..000000000000
--- a/dev-util/mingw64-runtime/mingw64-runtime-10.0.0.ebuild
+++ /dev/null
@@ -1,120 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} && ${CATEGORY} == cross-* ]]; then
- export CTARGET=${CATEGORY#cross-}
-fi
-
-inherit flag-o-matic toolchain-funcs
-
-DESCRIPTION="Free Win64 runtime and import library definitions"
-HOMEPAGE="https://www.mingw-w64.org/"
-SRC_URI="mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2"
-S="${WORKDIR}/mingw-w64-v${PV}"
-
-LICENSE="ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain tools? ( GPL-3+ )"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-# USE=libraries needs working stage2 compiler: bug #665512
-IUSE="headers-only idl libraries tools"
-RESTRICT="strip"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-7.0.0-fortify-only-ssp.patch
-)
-
-mingw-is_cross() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-pkg_setup() {
- if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]]; then
- die "Invalid configuration"
- fi
-}
-
-src_configure() {
- CHOST=${CTARGET} strip-unsupported-flags
-
- # Normally mingw-64 does not use dynamic linker.
- # But at configure time it uses $LDFLAGS.
- # When default -Wl,--hash-style=gnu is passed
- # __CTORS_LIST__ / __DTORS_LIST__ is mis-detected
- # for target ld and binaries crash at shutdown.
- filter-ldflags '-Wl,--hash-style=*'
-
- if use !headers-only; then
- mkdir "${WORKDIR}"/headers || die
- pushd "${WORKDIR}"/headers >/dev/null || die
-
- local econfargs=(
- --prefix="${T}"/tmproot
- --with-headers
- --without-crt
- )
-
- CHOST=${CTARGET} ECONF_SOURCE=${S} econf "${econfargs[@]}"
-
- popd >/dev/null || die
-
- append-cppflags "-I${T}/tmproot/include"
- fi
-
- crt-use_enable() {
- use headers-only && echo --without-${2:-${1}} || use_enable "${@}"
- }
- crt-use_with() {
- use headers-only && echo --without-${2:-${1}} || use_with "${@}"
- }
-
- local prefix="${EPREFIX}"$(mingw-is_cross && echo /usr/${CTARGET})/usr
- local econfargs=(
- --prefix="${prefix}"
- --libdir="${prefix}"/lib
- --enable-sdk
- --with-headers
-
- # By default configure tries to set --sysroot=${prefix}. We disable
- # this behaviour with --with-sysroot=no to use gcc's sysroot default.
- # That way we can cross-build mingw64-runtime with cross-emerge.
- --with-sysroot=no
-
- $(use_with !headers-only crt)
- $(crt-use_enable idl)
- $(crt-use_with libraries)
- $(crt-use_with tools)
- $(
- if use !headers-only; then
- # not checking cpp errors due to bug #840662
- $(tc-getCPP ${CTARGET}) ${CPPFLAGS} -dM - </dev/null | grep -q __MINGW64__ \
- && echo --disable-lib32 --enable-lib64 \
- || echo --enable-lib32 --disable-lib64
- fi
- )
- )
-
- CHOST=${CTARGET} econf "${econfargs[@]}"
-}
-
-src_compile() {
- use headers-only || emake -C "${WORKDIR}"/headers install
-
- default
-}
-
-src_install() {
- default
-
- if mingw-is_cross; then
- # gcc is configured to look at specific hard-coded paths for mingw #419601
- dosym usr /usr/${CTARGET}/mingw
- dosym usr /usr/${CTARGET}/${CTARGET}
- dosym usr/include /usr/${CTARGET}/sys-include
- fi
-
- rm -r "${ED}"/usr/share || die
-}
diff --git a/dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r2.ebuild b/dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r2.ebuild
deleted file mode 100644
index 8b0afea5649a..000000000000
--- a/dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r2.ebuild
+++ /dev/null
@@ -1,122 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} && ${CATEGORY} == cross-* ]]; then
- export CTARGET=${CATEGORY#cross-}
-fi
-
-inherit flag-o-matic toolchain-funcs
-
-DESCRIPTION="Free Win64 runtime and import library definitions"
-HOMEPAGE="https://www.mingw-w64.org/"
-SRC_URI="mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2"
-S="${WORKDIR}/mingw-w64-v${PV}"
-
-LICENSE="ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain tools? ( GPL-3+ )"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-# USE=libraries needs working stage2 compiler: bug #665512
-IUSE="headers-only idl libraries tools"
-RESTRICT="strip"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-7.0.0-fortify-only-ssp.patch
- "${FILESDIR}"/${P}-__rdtsc.patch
- "${FILESDIR}"/${P}-udivmod.patch
-)
-
-mingw-is_cross() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-pkg_setup() {
- if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]]; then
- die "Invalid configuration"
- fi
-}
-
-src_configure() {
- CHOST=${CTARGET} strip-unsupported-flags
-
- # Normally mingw-64 does not use dynamic linker.
- # But at configure time it uses $LDFLAGS.
- # When default -Wl,--hash-style=gnu is passed
- # __CTORS_LIST__ / __DTORS_LIST__ is mis-detected
- # for target ld and binaries crash at shutdown.
- filter-ldflags '-Wl,--hash-style=*'
-
- if use !headers-only; then
- mkdir "${WORKDIR}"/headers || die
- pushd "${WORKDIR}"/headers >/dev/null || die
-
- local econfargs=(
- --prefix="${T}"/tmproot
- --with-headers
- --without-crt
- )
-
- CHOST=${CTARGET} ECONF_SOURCE=${S} econf "${econfargs[@]}"
-
- popd >/dev/null || die
-
- append-cppflags "-I${T}/tmproot/include"
- fi
-
- crt-use_enable() {
- use headers-only && echo --without-${2:-${1}} || use_enable "${@}"
- }
- crt-use_with() {
- use headers-only && echo --without-${2:-${1}} || use_with "${@}"
- }
-
- local prefix="${EPREFIX}"$(mingw-is_cross && echo /usr/${CTARGET})/usr
- local econfargs=(
- --prefix="${prefix}"
- --libdir="${prefix}"/lib
- --enable-sdk
- --with-headers
-
- # By default configure tries to set --sysroot=${prefix}. We disable
- # this behaviour with --with-sysroot=no to use gcc's sysroot default.
- # That way we can cross-build mingw64-runtime with cross-emerge.
- --with-sysroot=no
-
- $(use_with !headers-only crt)
- $(crt-use_enable idl)
- $(crt-use_with libraries)
- $(crt-use_with tools)
- $(
- if use !headers-only; then
- # not checking cpp errors due to bug #840662
- $(tc-getCPP ${CTARGET}) ${CPPFLAGS} -dM - </dev/null | grep -q __MINGW64__ \
- && echo --disable-lib32 --enable-lib64 \
- || echo --enable-lib32 --disable-lib64
- fi
- )
- )
-
- CHOST=${CTARGET} econf "${econfargs[@]}"
-}
-
-src_compile() {
- use headers-only || emake -C "${WORKDIR}"/headers install
-
- default
-}
-
-src_install() {
- default
-
- if mingw-is_cross; then
- # gcc is configured to look at specific hard-coded paths for mingw #419601
- dosym usr /usr/${CTARGET}/mingw
- dosym usr /usr/${CTARGET}/${CTARGET}
- dosym usr/include /usr/${CTARGET}/sys-include
- fi
-
- rm -r "${ED}"/usr/share || die
-}
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
new file mode 100644
index 000000000000..9efc43518403
--- /dev/null
+++ b/dev-util/mingw64-runtime/mingw64-runtime-8.0.0-r3.ebuild
@@ -0,0 +1,138 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Free Win64 runtime and import library definitions"
+HOMEPAGE="https://www.mingw-w64.org/"
+SRC_URI="mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2"
+S="${WORKDIR}/mingw-w64-v${PV}"
+
+LICENSE="ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain tools? ( GPL-3+ )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+# USE=libraries needs working stage2 compiler: bug #665512
+IUSE="headers-only idl libraries tools"
+RESTRICT="strip"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-7.0.0-fortify-only-ssp.patch
+ "${FILESDIR}"/${P}-__rdtsc.patch
+ "${FILESDIR}"/${P}-udivmod.patch
+)
+
+pkg_setup() {
+ : ${CBUILD:=${CHOST}}
+ : ${CTARGET:=${CHOST}}
+ [[ ${CTARGET} == ${CHOST} && ${CATEGORY} == cross-* ]] &&
+ CTARGET=${CATEGORY#cross-}
+
+ [[ ${CHOST} != ${CTARGET} ]] && MW_CROSS=true || MW_CROSS=false
+
+ [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] &&
+ 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} >/dev/null || die
+ "${@}"
+ popd >/dev/null || die
+ done
+}
+
+src_configure() {
+ # 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
+
+ # likely cross-compiling from here, update toolchain variables
+ ${MW_CROSS} && [[ ! -v MINGW_BYPASS ]] &&
+ unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
+ local CHOST=${CTARGET}
+ strip-unsupported-flags
+
+ # Normally mingw64 does not use dynamic linker.
+ # But at configure time it uses $LDFLAGS.
+ # When default -Wl,--hash-style=gnu is passed
+ # __CTORS_LIST__ / __DTORS_LIST__ is mis-detected
+ # for target ld and binaries crash at shutdown.
+ filter-ldflags '-Wl,--hash-style=*'
+
+ local prefix=${EPREFIX}/usr
+ ${MW_CROSS} && prefix+=/${CTARGET}/usr
+
+ local conf=(
+ --prefix="${prefix}"
+ --libdir="${prefix}"/lib
+ $(use_with !headers-only crt)
+
+ # By default configure tries to set --sysroot=${prefix}. We disable
+ # this behaviour with --with-sysroot=no to use gcc's sysroot default.
+ # That way we can cross-build mingw64-runtime with cross-emerge.
+ --with-sysroot=no
+ )
+
+ if use !headers-only; then
+ conf+=(
+ $(use_enable idl)
+ $(use_with libraries)
+ )
+
+ # prefer tuple to determine if should do 32 or 64bits, but fall
+ # back to cpp test if missing (bug #584858, see also #840662)
+ local b32=true
+ case ${CHOST} in
+ x86_64-*) b32=false;;
+ i*86-*) ;;
+ *) [[ $($(tc-getCPP) -dM - <<<'') =~ __MINGW64__ ]] && b32=false;;
+ esac
+ ${b32} &&
+ conf+=( --enable-lib32 --disable-lib64 ) ||
+ conf+=( --disable-lib32 --enable-lib64 )
+
+ # prepare temporary headers install to build against same-version
+ mkdir ../headers || die
+ pushd ../headers >/dev/null || die
+ ECONF_SOURCE=${S} econf --prefix="${T}"/root --without-crt
+ popd >/dev/null || die
+
+ append-cppflags "-I${T}/root/include"
+ fi
+
+ econf "${conf[@]}"
+}
+
+src_compile() {
+ use headers-only || emake -C ../headers install
+ 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
+ dosym usr /usr/${CTARGET}/${CTARGET}
+ dosym usr/include /usr/${CTARGET}/sys-include
+ fi
+
+ rm -r "${ED}"/usr/share || die
+}
diff --git a/dev-util/mingw64-runtime/mingw64-runtime-9.0.0-r1.ebuild b/dev-util/mingw64-runtime/mingw64-runtime-9.0.0-r1.ebuild
deleted file mode 100644
index 077a2a52ccd6..000000000000
--- a/dev-util/mingw64-runtime/mingw64-runtime-9.0.0-r1.ebuild
+++ /dev/null
@@ -1,120 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-export CBUILD=${CBUILD:-${CHOST}}
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} && ${CATEGORY} == cross-* ]]; then
- export CTARGET=${CATEGORY#cross-}
-fi
-
-inherit flag-o-matic toolchain-funcs
-
-DESCRIPTION="Free Win64 runtime and import library definitions"
-HOMEPAGE="https://www.mingw-w64.org/"
-SRC_URI="mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2"
-S="${WORKDIR}/mingw-w64-v${PV}"
-
-LICENSE="ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain tools? ( GPL-3+ )"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-# USE=libraries needs working stage2 compiler: bug #665512
-IUSE="headers-only idl libraries tools"
-RESTRICT="strip"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-7.0.0-fortify-only-ssp.patch
-)
-
-mingw-is_cross() {
- [[ ${CHOST} != ${CTARGET} ]]
-}
-
-pkg_setup() {
- if [[ ${CBUILD} == ${CHOST} && ${CHOST} == ${CTARGET} ]]; then
- die "Invalid configuration"
- fi
-}
-
-src_configure() {
- CHOST=${CTARGET} strip-unsupported-flags
-
- # Normally mingw-64 does not use dynamic linker.
- # But at configure time it uses $LDFLAGS.
- # When default -Wl,--hash-style=gnu is passed
- # __CTORS_LIST__ / __DTORS_LIST__ is mis-detected
- # for target ld and binaries crash at shutdown.
- filter-ldflags '-Wl,--hash-style=*'
-
- if use !headers-only; then
- mkdir "${WORKDIR}"/headers || die
- pushd "${WORKDIR}"/headers >/dev/null || die
-
- local econfargs=(
- --prefix="${T}"/tmproot
- --with-headers
- --without-crt
- )
-
- CHOST=${CTARGET} ECONF_SOURCE=${S} econf "${econfargs[@]}"
-
- popd >/dev/null || die
-
- append-cppflags "-I${T}/tmproot/include"
- fi
-
- crt-use_enable() {
- use headers-only && echo --without-${2:-${1}} || use_enable "${@}"
- }
- crt-use_with() {
- use headers-only && echo --without-${2:-${1}} || use_with "${@}"
- }
-
- local prefix="${EPREFIX}"$(mingw-is_cross && echo /usr/${CTARGET})/usr
- local econfargs=(
- --prefix="${prefix}"
- --libdir="${prefix}"/lib
- --enable-sdk
- --with-headers
-
- # By default configure tries to set --sysroot=${prefix}. We disable
- # this behaviour with --with-sysroot=no to use gcc's sysroot default.
- # That way we can cross-build mingw64-runtime with cross-emerge.
- --with-sysroot=no
-
- $(use_with !headers-only crt)
- $(crt-use_enable idl)
- $(crt-use_with libraries)
- $(crt-use_with tools)
- $(
- if use !headers-only; then
- # not checking cpp errors due to bug #840662
- $(tc-getCPP ${CTARGET}) ${CPPFLAGS} -dM - </dev/null | grep -q __MINGW64__ \
- && echo --disable-lib32 --enable-lib64 \
- || echo --enable-lib32 --disable-lib64
- fi
- )
- )
-
- CHOST=${CTARGET} econf "${econfargs[@]}"
-}
-
-src_compile() {
- use headers-only || emake -C "${WORKDIR}"/headers install
-
- default
-}
-
-src_install() {
- default
-
- if mingw-is_cross; then
- # gcc is configured to look at specific hard-coded paths for mingw #419601
- dosym usr /usr/${CTARGET}/mingw
- dosym usr /usr/${CTARGET}/${CTARGET}
- dosym usr/include /usr/${CTARGET}/sys-include
- fi
-
- rm -r "${ED}"/usr/share || die
-}
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
new file mode 100644
index 000000000000..fbd35d0570b7
--- /dev/null
+++ b/dev-util/mingw64-runtime/mingw64-runtime-9.0.0-r2.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Free Win64 runtime and import library definitions"
+HOMEPAGE="https://www.mingw-w64.org/"
+SRC_URI="mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2"
+S="${WORKDIR}/mingw-w64-v${PV}"
+
+LICENSE="ZPL BSD BSD-2 ISC LGPL-2+ LGPL-2.1+ MIT public-domain tools? ( GPL-3+ )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+# USE=libraries needs working stage2 compiler: bug #665512
+IUSE="headers-only idl libraries tools"
+RESTRICT="strip"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-7.0.0-fortify-only-ssp.patch
+)
+
+pkg_setup() {
+ : ${CBUILD:=${CHOST}}
+ : ${CTARGET:=${CHOST}}
+ [[ ${CTARGET} == ${CHOST} && ${CATEGORY} == cross-* ]] &&
+ CTARGET=${CATEGORY#cross-}
+
+ [[ ${CHOST} != ${CTARGET} ]] && MW_CROSS=true || MW_CROSS=false
+
+ [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] &&
+ 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} >/dev/null || die
+ "${@}"
+ popd >/dev/null || die
+ done
+}
+
+src_configure() {
+ # 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
+
+ # likely cross-compiling from here, update toolchain variables
+ ${MW_CROSS} && [[ ! -v MINGW_BYPASS ]] &&
+ unset AR AS CC CPP CXX LD NM OBJCOPY OBJDUMP RANLIB RC STRIP
+ local CHOST=${CTARGET}
+ strip-unsupported-flags
+
+ # Normally mingw64 does not use dynamic linker.
+ # But at configure time it uses $LDFLAGS.
+ # When default -Wl,--hash-style=gnu is passed
+ # __CTORS_LIST__ / __DTORS_LIST__ is mis-detected
+ # for target ld and binaries crash at shutdown.
+ filter-ldflags '-Wl,--hash-style=*'
+
+ local prefix=${EPREFIX}/usr
+ ${MW_CROSS} && prefix+=/${CTARGET}/usr
+
+ local conf=(
+ --prefix="${prefix}"
+ --libdir="${prefix}"/lib
+ $(use_with !headers-only crt)
+
+ # By default configure tries to set --sysroot=${prefix}. We disable
+ # this behaviour with --with-sysroot=no to use gcc's sysroot default.
+ # That way we can cross-build mingw64-runtime with cross-emerge.
+ --with-sysroot=no
+ )
+
+ if use !headers-only; then
+ conf+=(
+ $(use_enable idl)
+ $(use_with libraries)
+ )
+
+ # prefer tuple to determine if should do 32 or 64bits, but fall
+ # back to cpp test if missing (bug #584858, see also #840662)
+ local b32=true
+ case ${CHOST} in
+ x86_64-*) b32=false;;
+ i*86-*) ;;
+ *) [[ $($(tc-getCPP) -dM - <<<'') =~ __MINGW64__ ]] && b32=false;;
+ esac
+ ${b32} &&
+ conf+=( --enable-lib32 --disable-lib64 ) ||
+ conf+=( --disable-lib32 --enable-lib64 )
+
+ # prepare temporary headers install to build against same-version
+ mkdir ../headers || die
+ pushd ../headers >/dev/null || die
+ ECONF_SOURCE=${S} econf --prefix="${T}"/root --without-crt
+ popd >/dev/null || die
+
+ append-cppflags "-I${T}/root/include"
+ fi
+
+ econf "${conf[@]}"
+}
+
+src_compile() {
+ use headers-only || emake -C ../headers install
+ 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
+ dosym usr /usr/${CTARGET}/${CTARGET}
+ dosym usr/include /usr/${CTARGET}/sys-include
+ fi
+
+ rm -r "${ED}"/usr/share || die
+}