From 634af320cea37096cd6c12b389f4483548caf15a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 17 Jul 2023 15:04:02 +0100 Subject: [PATCH] Rebase to Fedora Rawhide resolves: rhbz#2213435 side-tag: c9s-build-side-2090-stack-gate --- macros.mingw | 52 ++++++++++++++++++++----------------- macros.mingw32 | 10 ++++---- macros.mingw64 | 10 ++++---- macros.ucrt64 | 2 +- mingw-filesystem.spec | 57 +++++++++++++++++++++++++++++++++++++---- mingw-find-debuginfo.sh | 2 +- mingw-find-lang.sh | 11 ++++++-- 7 files changed, 102 insertions(+), 42 deletions(-) diff --git a/macros.mingw b/macros.mingw index bd0f635..6118c46 100644 --- a/macros.mingw +++ b/macros.mingw @@ -65,12 +65,15 @@ run_mingw_configure run_mingw_make() \ { \ %if 0%{?mingw_build_win32} == 1 \ +%{mingw32_env} \ %{__make} -C build_win32$MINGW_BUILDDIR_SUFFIX "$@" $MINGW32_MAKE_ARGS \ %endif \ %if 0%{?mingw_build_win64} == 1 \ +%{mingw64_env} \ %{__make} -C build_win64$MINGW_BUILDDIR_SUFFIX "$@" $MINGW64_MAKE_ARGS \ %endif \ %if 0%{?mingw_build_ucrt64} == 1 \ +%{ucrt64_env} \ %{__make} -C build_ucrt64$MINGW_BUILDDIR_SUFFIX "$@" $UCRT64_MAKE_ARGS \ %endif \ } \ @@ -100,29 +103,6 @@ popd \ } \ run_mingw_cmake -%mingw_cmake_kde4 \ -run_mingw_cmake_kde4() \ -{ \ -%if 0%{?mingw_build_win32} == 1 \ -mkdir -p build_win32$MINGW_BUILDDIR_SUFFIX \ -pushd build_win32$MINGW_BUILDDIR_SUFFIX \ - %{?mingw32_cmake_kde4 "$@"} \ -popd \ -%endif \ -%if 0%{?mingw_build_win64} == 1 \ -mkdir -p build_win64$MINGW_BUILDDIR_SUFFIX \ -pushd build_win64$MINGW_BUILDDIR_SUFFIX \ - %{?mingw64_cmake_kde4 "$@"} \ -popd \ -%endif \ -%if 0%{?mingw_build_ucrt64} == 1 \ -mkdir -p build_ucrt64$MINGW_BUILDDIR_SUFFIX \ -pushd build_ucrt64$MINGW_BUILDDIR_SUFFIX \ - %{?ucrt64_cmake_kde4 "$@"} \ -popd \ -%endif \ -} \ -run_mingw_cmake_kde4 %mingw_qmake_qt5 \ run_mingw_qmake_qt5() \ @@ -148,6 +128,32 @@ popd \ } \ run_mingw_qmake_qt5 + +%mingw_qmake_qt6 \ +run_mingw_qmake_qt6() \ +{ \ +%if 0%{?mingw_build_win32} == 1 \ +mkdir -p build_win32$MINGW_BUILDDIR_SUFFIX \ +pushd build_win32$MINGW_BUILDDIR_SUFFIX \ + %{?mingw32_qmake_qt6} "$@" \ +popd \ +%endif \ +%if 0%{?mingw_build_win64} == 1 \ +mkdir -p build_win64$MINGW_BUILDDIR_SUFFIX \ +pushd build_win64$MINGW_BUILDDIR_SUFFIX \ + %{?mingw64_qmake_qt6} "$@" \ +popd \ +%endif \ +%if 0%{?mingw_build_ucrt64} == 1 \ +mkdir -p build_ucrt64$MINGW_BUILDDIR_SUFFIX \ +pushd build_ucrt64$MINGW_BUILDDIR_SUFFIX \ + %{?ucrt64_qmake_qt6} "$@" \ +popd \ +%endif \ +} \ +run_mingw_qmake_qt6 + + %mingw_meson \ run_mingw_meson() \ { \ diff --git a/macros.mingw32 b/macros.mingw32 index 6caf0a2..250675c 100644 --- a/macros.mingw32 +++ b/macros.mingw32 @@ -27,6 +27,7 @@ %mingw32_cppflags %{nil} %mingw32_fflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 %mingw32_ldflags -fstack-protector -lssp +%mingw32_rustflags -Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cforce-frame-pointers=yes --cap-lints=warn %mingw32_cc %{mingw32_target}-gcc %mingw32_cxx %{mingw32_target}-g++ @@ -50,7 +51,7 @@ %mingw32_windmc %{mingw32_target}-windmc %mingw32_windres %{mingw32_target}-windres -%mingw32_env unset $(/usr/bin/env | egrep '^(\w+)=(.*)$' | egrep -vw 'PWD|USER|LANG' | /usr/bin/cut -d= -f1); \ +%mingw32_env unset $(/usr/bin/env | grep -E '^(\w+)=(.*)$' | grep -Evw 'PWD|USER|LANG' | /usr/bin/cut -d= -f1); \ if test -z "$PATH_ORIG" ; then \ PATH_ORIG="$PATH"; export PATH_ORIG; \ fi; \ @@ -77,6 +78,7 @@ FFLAGS="${MINGW32_FFLAGS-%mingw32_fflags}"; export FFLAGS; \ FCFLAGS="${MINGW32_FCFLAGS-%mingw32_fflags}"; export FCFLAGS; \ LDFLAGS="${MINGW32_LDFLAGS:-%mingw32_ldflags}"; export LDFLAGS; \ + RUSTFLAGS="${MINGW32_RUSTFLAGS:-%mingw32_rustflags}"; export RUSTFLAGS; \ for i in `ls %{mingw32_bindir}/*|grep -- "-config\$"` ; do \ x=`basename $i|tr "a-z+-." "A-ZX_"`; \ declare -x $x="$i" ; export $x; \ @@ -146,12 +148,10 @@ MINGW32_CMAKE_ARGS="-DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir} ${MINGW32_CMAKE_ARGS}" \ %mingw32_cmake_generic -%mingw32_cmake_kde4 \ - MINGW32_CMAKE_ARGS="-DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir}/kde4 ${MINGW32_CMAKE_ARGS}" \ - %mingw32_cmake_generic - %mingw32_qmake_qt5 /usr/bin/mingw32-qmake-qt5 +%mingw32_qmake_qt6 /usr/bin/%{mingw32_target}-qmake-qt6 + %mingw32_meson %{mingw32_env} ; \ unset CC CFLAGS CPPFLAGS CXX CXXFLAGS LD LDFLAGS; \\\ CFLAGS="${MINGW32_CFLAGS-%mingw32_cflags}"; export CFLAGS; \\\ diff --git a/macros.mingw64 b/macros.mingw64 index bf28141..493024d 100644 --- a/macros.mingw64 +++ b/macros.mingw64 @@ -27,6 +27,7 @@ %mingw64_cppflags %{nil} %mingw64_fflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 %mingw64_ldflags -fstack-protector -lssp +%mingw64_rustflags -Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cforce-frame-pointers=yes --cap-lints=warn %mingw64_cc %{mingw64_target}-gcc %mingw64_cxx %{mingw64_target}-g++ @@ -50,7 +51,7 @@ %mingw64_windmc %{mingw64_target}-windmc %mingw64_windres %{mingw64_target}-windres -%mingw64_env unset $(/usr/bin/env | egrep '^(\w+)=(.*)$' | egrep -vw 'PWD|USER|LANG' | /usr/bin/cut -d= -f1); \ +%mingw64_env unset $(/usr/bin/env | grep -E '^(\w+)=(.*)$' | grep -Evw 'PWD|USER|LANG' | /usr/bin/cut -d= -f1); \ if test -z "$PATH_ORIG" ; then \ PATH_ORIG="$PATH"; export PATH_ORIG; \ fi; \ @@ -77,6 +78,7 @@ FFLAGS="${MINGW64_FFLAGS-%mingw64_fflags}"; export FFLAGS; \ FCFLAGS="${MINGW64_FCFLAGS-%mingw64_fflags}"; export FCFLAGS; \ LDFLAGS="${MINGW64_LDFLAGS:-%mingw64_ldflags}"; export LDFLAGS; \ + RUSTFLAGS="${MINGW64_RUSTFLAGS:-%mingw64_rustflags}"; export RUSTFLAGS; \ for i in `ls %{mingw64_bindir}/*|grep -- "-config\$"` ; do \ x=`basename $i|tr "a-z+-." "A-ZX_"`; \ declare -x $x="$i" ; export $x; \ @@ -146,12 +148,10 @@ MINGW64_CMAKE_ARGS="-DINCLUDE_INSTALL_DIR:PATH=%{mingw64_includedir} ${MINGW64_CMAKE_ARGS}" \ %mingw64_cmake_generic -%mingw64_cmake_kde4 \ - MINGW64_CMAKE_ARGS="-DINCLUDE_INSTALL_DIR:PATH=%{mingw64_includedir}/kde4 ${MINGW64_CMAKE_ARGS}" \ - %mingw64_cmake_generic - %mingw64_qmake_qt5 /usr/bin/mingw64-qmake-qt5 +%mingw64_qmake_qt6 /usr/bin/%{mingw64_target}-qmake-qt6 + %mingw64_meson %{mingw64_env} ; \ unset CC CFLAGS CPPFLAGS CXX CXXFLAGS LD LDFLAGS; \\\ CFLAGS="${MINGW64_CFLAGS-%mingw64_cflags}"; export CFLAGS; \\\ diff --git a/macros.ucrt64 b/macros.ucrt64 index acbde9e..28e13dc 100644 --- a/macros.ucrt64 +++ b/macros.ucrt64 @@ -49,7 +49,7 @@ %ucrt64_windmc %{ucrt64_target}-windmc %ucrt64_windres %{ucrt64_target}-windres -%ucrt64_env unset $(/usr/bin/env | egrep '^(\w+)=(.*)$' | egrep -vw 'PWD|USER|LANG' | /usr/bin/cut -d= -f1); \ +%ucrt64_env unset $(/usr/bin/env | grep -E '^(\w+)=(.*)$' | grep -Evw 'PWD|USER|LANG' | /usr/bin/cut -d= -f1); \ if test -z "$PATH_ORIG" ; then \ PATH_ORIG="$PATH"; export PATH_ORIG; \ fi; \ diff --git a/mingw-filesystem.spec b/mingw-filesystem.spec index 1c66b2d..e671eed 100644 --- a/mingw-filesystem.spec +++ b/mingw-filesystem.spec @@ -1,3 +1,6 @@ +# Define before mingw-binutils is build +%bcond_with bootstrap + %global debug_package %{nil} # Place RPM macros in %%{_rpmconfigdir}/macros.d if it exists (RPM 4.11+) @@ -6,11 +9,11 @@ %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) Name: mingw-filesystem -Version: 139 +Version: 147 Release: 1%{?dist} Summary: MinGW cross compiler base filesystem and environment -License: GPLv2+ +License: GPL-2.0-or-later URL: http://fedoraproject.org/wiki/MinGW BuildArch: noarch @@ -90,6 +93,9 @@ Requires: %{name}-base = %{version}-%{release} Conflicts: mingw32-pkg-config < 0.28-17 Obsoletes: mingw32-pkg-config < 0.28-17 Provides: mingw32-pkg-config = 0.28-17 +%if %{without bootstrap} +Requires: mingw-binutils-generic +%endif %description -n mingw32-filesystem This package contains the base filesystem layout, RPM macros and @@ -107,7 +113,9 @@ Requires: %{name}-base = %{version}-%{release} Conflicts: mingw64-pkg-config < 0.28-17 Obsoletes: mingw64-pkg-config < 0.28-17 Provides: mingw64-pkg-config = 0.28-17 - +%if %{without bootstrap} +Requires: mingw-binutils-generic +%endif %description -n mingw64-filesystem This package contains the base filesystem layout, RPM macros and @@ -117,6 +125,7 @@ This environment is maintained by the Fedora MinGW SIG at: http://fedoraproject.org/wiki/SIGs/MinGW + %package -n ucrt64-filesystem Summary: MinGW cross compiler base filesystem and environment for the win64 UCRT target Requires: %{name}-base = %{version}-%{release} @@ -124,7 +133,9 @@ Requires: %{name}-base = %{version}-%{release} Conflicts: ucrt64-pkg-config < 0.28-17 Obsoletes: ucrt64-pkg-config < 0.28-17 Provides: ucrt64-pkg-config = 0.28-17 - +%if %{without bootstrap} +Requires: mingw-binutils-generic +%endif %description -n ucrt64-filesystem This package contains the base filesystem layout, RPM macros and @@ -208,6 +219,8 @@ for target in i686-w64-mingw32 x86_64-w64-mingw32 x86_64-w64-mingw32ucrt; do mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/share/locale mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/share/pkgconfig mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/share/xml + mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/share/icons + mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/share/metainfo mkdir -p %{buildroot}%{_prefix}/lib/debug/%{_prefix}/$target done @@ -245,7 +258,7 @@ cat %{SOURCE101} | grep -v "^#" | grep -v "^$" | while read loc ; do fi # If the locale is not official and not special, skip it if [ -z "$special" ]; then - egrep -q "[[:space:]]${locale%%_*}[[:space:]]" %{buildroot}/iso_639.tab || continue + grep -Eq "[[:space:]]${locale%%_*}[[:space:]]" %{buildroot}/iso_639.tab || continue fi echo "%lang(${locale}) %{_prefix}/i686-w64-mingw32/sys-root/mingw/share/locale/${loc}" >> filelist_mingw32 echo "%lang(${locale}) %{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/locale/${loc}" >> filelist_mingw64 @@ -363,6 +376,40 @@ echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/x86_64-w64-mingw32ucrt-p %dir %{_prefix}/lib/debug/%{_prefix}/x86_64-w64-mingw32ucrt %changelog +* Fri Apr 07 2023 Sandro Mani - 147-1 +- Set mingw_env before in run_mingw_make + +* Wed Apr 05 2023 Sandro Mani - 146-1 +- Set RUSTFLAGS in mingw env + +* Thu Jan 19 2023 Fedora Release Engineering - 145-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sat Dec 31 2022 Sandro Mani - 145-1 +- Fix mingw-find-lang.sh exit code + +* Fri Dec 23 2022 Sandro Mani - 144-1 +- Add mingw-qmake-qt6 macros, drop mingw-cmake-kde4 macros + +* Fri Dec 09 2022 Sandro Mani - 143-1 +- Prevent mingw-find-lang.sh from clobbering previous find-lang results + +* Tue Oct 18 2022 Sandro Mani - 142-1 +- Require mingw-binutils-generic + +* Tue Sep 27 2022 Sandro Mani - 141-2 +- Replace egrep with grep -E + +* Sat Jul 30 2022 Sandro Mani - 141-1 +- Revert unsetting _PREFIX + +* Fri Jul 29 2022 Sandro Mani - 140-1 +- Don't unset _PREFIX in mingw-env macro, it leads to ${_PREFIX} + being empty when evaluated the lines above + +* Thu Jul 21 2022 Fedora Release Engineering - 139-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Fri May 20 2022 Sandro Mani - 139-1 - Set CMAKE_FIND_ROOT_PATH_MODE_PACKAGE in cmake toolchain files diff --git a/mingw-find-debuginfo.sh b/mingw-find-debuginfo.sh index 317749a..a7c6a98 100755 --- a/mingw-find-debuginfo.sh +++ b/mingw-find-debuginfo.sh @@ -12,7 +12,7 @@ shift for f in `find $RPM_BUILD_ROOT -type f -name "*.exe" -or -name "*.dll" -or -name "*.pyd"` do - case $(mingw-objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in + case $(mingw-objdump -h $f 2>/dev/null | grep -Eo '(debug[\.a-z_]*|gnu.version)') in *debuglink*) continue ;; *debug*) ;; *gnu.version*) diff --git a/mingw-find-lang.sh b/mingw-find-lang.sh index 097fc21..81421fd 100755 --- a/mingw-find-lang.sh +++ b/mingw-find-lang.sh @@ -2,16 +2,23 @@ # Wrapper for the %find_lang macro which splits out the various translations in per-target lists +PACKAGE_NAME=$2 + +# If previous result from native find-lang exists, filter mingw entries and move it out of the way +test -f ${PACKAGE_NAME}.lang && grep -v mingw32 ${PACKAGE_NAME}.lang > ${PACKAGE_NAME}-native.lang + /usr/lib/rpm/find-lang.sh $* + if test $? != 0 ; then + test -f ${PACKAGE_NAME}-native.lang && mv ${PACKAGE_NAME}-native.lang ${PACKAGE_NAME}.lang exit 1 fi -PACKAGE_NAME=$2 targets=`rpm --eval '%{mingw_build_targets}'` for target in $targets; do prefix=`rpm --eval "%{${target}_prefix}"` - cat $2.lang | grep "$prefix" > ${target}-$PACKAGE_NAME.lang + cat ${PACKAGE_NAME}.lang | grep "$prefix" > ${target}-$PACKAGE_NAME.lang done +test -f ${PACKAGE_NAME}-native.lang && mv ${PACKAGE_NAME}-native.lang ${PACKAGE_NAME}.lang exit 0