Rebase to Fedora Rawhide

resolves: rhbz#2080168
side-tag: c9s-build-side-467-stack-gate
This commit is contained in:
Richard W.M. Jones 2022-05-06 12:21:14 +01:00
parent a53cf1735c
commit 2c8268dc36
23 changed files with 630 additions and 200 deletions

16
README.md Normal file
View File

@ -0,0 +1,16 @@
Building the MinGW environment
==============================
Build order:
- mingw-filesystem
- mingw-binutils
- mingw-headers (bundle_dummy_pthread_headers=1)
- mingw-w64-tools
- mingw-gcc (bootstrap=1)
- mingw-crt (bootstrap=1)
- mingw-crt (bootstrap=0)
- mingw-winpthreads
- mingw-headers (bundle_dummy_pthread_headers=0)
- mingw-gcc (bootstrap=0)
- mingw-gdb

View File

@ -1,16 +1,15 @@
# RPM macros for the Fedora MinGW Cross Compiler collection # RPM macros for the Fedora MinGW Cross Compiler collection
%mingw_build_targets mingw32 mingw64 %mingw_build_targets mingw32 mingw64 ucrt64
%mingw_build_win32 1 %mingw_build_win32 1
%mingw_build_win64 1 %mingw_build_win64 1
%mingw_build_ucrt64 0
%mingw_strip mingw-strip %mingw_strip mingw-strip
%mingw_objdump mingw-objdump %mingw_objdump mingw-objdump
%mingw_objcopy mingw-objcopy %mingw_objcopy mingw-objcopy
%mingw_nm mingw-nm %mingw_nm mingw-nm
%mingw_findprovides %{_rpmconfigdir}/mingw-find-provides.sh %{mingw_build_targets}
%mingw_findrequires %{_rpmconfigdir}/mingw-find-requires.sh %{mingw_build_targets}
%mingw_finddebuginfo %{_rpmconfigdir}/mingw-find-debuginfo.sh %mingw_finddebuginfo %{_rpmconfigdir}/mingw-find-debuginfo.sh
%mingw_find_lang %{_rpmconfigdir}/mingw-find-lang.sh %{buildroot} %mingw_find_lang %{_rpmconfigdir}/mingw-find-lang.sh %{buildroot}
@ -24,16 +23,14 @@
%if 0%{?mingw_build_win64} == 1 \ %if 0%{?mingw_build_win64} == 1 \
%{?mingw64_debug_package} \ %{?mingw64_debug_package} \
%endif \ %endif \
%if 0%{?mingw_build_ucrt64} == 1 \
%{?ucrt64_debug_package} \
%endif \
%{nil} %{nil}
%mingw_package_header \ %mingw_package_header \
%global __strip %{mingw_strip} \ %global __strip %{mingw_strip} \
%global __objdump %{mingw_objdump} \ %global __objdump %{mingw_objdump} \
%if 0%{?rhel} == 6 \
%global _use_internal_dependency_generator 0 \
%global __find_requires %{mingw_findrequires} \
%global __find_provides %{mingw_findprovides} \
%endif \
%global __debug_install_post %%{mingw_debug_install_post} \ %global __debug_install_post %%{mingw_debug_install_post} \
%{nil} %{nil}
@ -44,17 +41,23 @@ run_mingw_configure() \
[ -f /usr/lib/rpm/redhat/$(basename $i) ] && %{__rm} -f $i && %{__cp} -fv /usr/lib/rpm/redhat/$(basename $i) $i ; \ [ -f /usr/lib/rpm/redhat/$(basename $i) ] && %{__rm} -f $i && %{__cp} -fv /usr/lib/rpm/redhat/$(basename $i) $i ; \
done ; \ done ; \
%if 0%{?mingw_build_win32} == 1 \ %if 0%{?mingw_build_win32} == 1 \
mkdir build_win32$MINGW_BUILDDIR_SUFFIX \ mkdir -p build_win32$MINGW_BUILDDIR_SUFFIX \
pushd build_win32$MINGW_BUILDDIR_SUFFIX \ pushd build_win32$MINGW_BUILDDIR_SUFFIX \
%{?mingw32_configure} "$@" \ %{?mingw32_configure} "$@" \
popd \ popd \
%endif \ %endif \
%if 0%{?mingw_build_win64} == 1 \ %if 0%{?mingw_build_win64} == 1 \
mkdir build_win64$MINGW_BUILDDIR_SUFFIX \ mkdir -p build_win64$MINGW_BUILDDIR_SUFFIX \
pushd build_win64$MINGW_BUILDDIR_SUFFIX \ pushd build_win64$MINGW_BUILDDIR_SUFFIX \
%{?mingw64_configure} "$@" \ %{?mingw64_configure} "$@" \
popd \ popd \
%endif \ %endif \
%if 0%{?mingw_build_ucrt64} == 1 \
mkdir -p build_ucrt64$MINGW_BUILDDIR_SUFFIX \
pushd build_ucrt64$MINGW_BUILDDIR_SUFFIX \
%{?ucrt64_configure} "$@" \
popd \
%endif \
} \ } \
run_mingw_configure run_mingw_configure
@ -67,6 +70,9 @@ run_mingw_make() \
%if 0%{?mingw_build_win64} == 1 \ %if 0%{?mingw_build_win64} == 1 \
%{__make} -C build_win64$MINGW_BUILDDIR_SUFFIX "$@" $MINGW64_MAKE_ARGS \ %{__make} -C build_win64$MINGW_BUILDDIR_SUFFIX "$@" $MINGW64_MAKE_ARGS \
%endif \ %endif \
%if 0%{?mingw_build_ucrt64} == 1 \
%{__make} -C build_ucrt64$MINGW_BUILDDIR_SUFFIX "$@" $UCRT64_MAKE_ARGS \
%endif \
} \ } \
run_mingw_make run_mingw_make
@ -74,17 +80,23 @@ run_mingw_make
run_mingw_cmake() \ run_mingw_cmake() \
{ \ { \
%if 0%{?mingw_build_win32} == 1 \ %if 0%{?mingw_build_win32} == 1 \
mkdir build_win32$MINGW_BUILDDIR_SUFFIX \ mkdir -p build_win32$MINGW_BUILDDIR_SUFFIX \
pushd build_win32$MINGW_BUILDDIR_SUFFIX \ pushd build_win32$MINGW_BUILDDIR_SUFFIX \
%{?mingw32_cmake "$@"} \ %{?mingw32_cmake "$@"} \
popd \ popd \
%endif \ %endif \
%if 0%{?mingw_build_win64} == 1 \ %if 0%{?mingw_build_win64} == 1 \
mkdir build_win64$MINGW_BUILDDIR_SUFFIX \ mkdir -p build_win64$MINGW_BUILDDIR_SUFFIX \
pushd build_win64$MINGW_BUILDDIR_SUFFIX \ pushd build_win64$MINGW_BUILDDIR_SUFFIX \
%{?mingw64_cmake "$@"} \ %{?mingw64_cmake "$@"} \
popd \ popd \
%endif \ %endif \
%if 0%{?mingw_build_ucrt64} == 1 \
mkdir -p build_ucrt64$MINGW_BUILDDIR_SUFFIX \
pushd build_ucrt64$MINGW_BUILDDIR_SUFFIX \
%{?ucrt64_cmake "$@"} \
popd \
%endif \
} \ } \
run_mingw_cmake run_mingw_cmake
@ -92,53 +104,47 @@ run_mingw_cmake
run_mingw_cmake_kde4() \ run_mingw_cmake_kde4() \
{ \ { \
%if 0%{?mingw_build_win32} == 1 \ %if 0%{?mingw_build_win32} == 1 \
mkdir build_win32$MINGW_BUILDDIR_SUFFIX \ mkdir -p build_win32$MINGW_BUILDDIR_SUFFIX \
pushd build_win32$MINGW_BUILDDIR_SUFFIX \ pushd build_win32$MINGW_BUILDDIR_SUFFIX \
%{?mingw32_cmake_kde4 "$@"} \ %{?mingw32_cmake_kde4 "$@"} \
popd \ popd \
%endif \ %endif \
%if 0%{?mingw_build_win64} == 1 \ %if 0%{?mingw_build_win64} == 1 \
mkdir build_win64$MINGW_BUILDDIR_SUFFIX \ mkdir -p build_win64$MINGW_BUILDDIR_SUFFIX \
pushd build_win64$MINGW_BUILDDIR_SUFFIX \ pushd build_win64$MINGW_BUILDDIR_SUFFIX \
%{?mingw64_cmake_kde4 "$@"} \ %{?mingw64_cmake_kde4 "$@"} \
popd \ popd \
%endif \ %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 run_mingw_cmake_kde4
%mingw_qmake_qt4 \
run_mingw_qmake_qt4() \
{ \
%if 0%{?mingw_build_win32} == 1 \
mkdir build_win32$MINGW_BUILDDIR_SUFFIX \
pushd build_win32$MINGW_BUILDDIR_SUFFIX \
%{?mingw32_qmake_qt4} "$@" \
popd \
%endif \
%if 0%{?mingw_build_win64} == 1 \
mkdir build_win64$MINGW_BUILDDIR_SUFFIX \
pushd build_win64$MINGW_BUILDDIR_SUFFIX \
%{?mingw64_qmake_qt4} "$@" \
popd \
%endif \
} \
run_mingw_qmake_qt4
%mingw_qmake_qt5 \ %mingw_qmake_qt5 \
run_mingw_qmake_qt5() \ run_mingw_qmake_qt5() \
{ \ { \
%if 0%{?mingw_build_win32} == 1 \ %if 0%{?mingw_build_win32} == 1 \
mkdir build_win32$MINGW_BUILDDIR_SUFFIX \ mkdir -p build_win32$MINGW_BUILDDIR_SUFFIX \
pushd build_win32$MINGW_BUILDDIR_SUFFIX \ pushd build_win32$MINGW_BUILDDIR_SUFFIX \
%{?mingw32_qmake_qt5} "$@" \ %{?mingw32_qmake_qt5} "$@" \
popd \ popd \
%endif \ %endif \
%if 0%{?mingw_build_win64} == 1 \ %if 0%{?mingw_build_win64} == 1 \
mkdir build_win64$MINGW_BUILDDIR_SUFFIX \ mkdir -p build_win64$MINGW_BUILDDIR_SUFFIX \
pushd build_win64$MINGW_BUILDDIR_SUFFIX \ pushd build_win64$MINGW_BUILDDIR_SUFFIX \
%{?mingw64_qmake_qt5} "$@" \ %{?mingw64_qmake_qt5} "$@" \
popd \ popd \
%endif \ %endif \
%if 0%{?mingw_build_ucrt64} == 1 \
mkdir -p build_ucrt64$MINGW_BUILDDIR_SUFFIX \
pushd build_ucrt64$MINGW_BUILDDIR_SUFFIX \
%{?ucrt64_qmake_qt5} "$@" \
popd \
%endif \
} \ } \
run_mingw_qmake_qt5 run_mingw_qmake_qt5
@ -146,17 +152,23 @@ run_mingw_qmake_qt5
run_mingw_meson() \ run_mingw_meson() \
{ \ { \
%if 0%{?mingw_build_win32} == 1 \ %if 0%{?mingw_build_win32} == 1 \
mkdir build_win32$MINGW_BUILDDIR_SUFFIX \ mkdir -p build_win32$MINGW_BUILDDIR_SUFFIX \
pushd build_win32$MINGW_BUILDDIR_SUFFIX \ pushd build_win32$MINGW_BUILDDIR_SUFFIX \
%{?mingw32_meson "$@"} \ %{?mingw32_meson "$@"} \
popd \ popd \
%endif \ %endif \
%if 0%{?mingw_build_win64} == 1 \ %if 0%{?mingw_build_win64} == 1 \
mkdir build_win64$MINGW_BUILDDIR_SUFFIX \ mkdir -p build_win64$MINGW_BUILDDIR_SUFFIX \
pushd build_win64$MINGW_BUILDDIR_SUFFIX \ pushd build_win64$MINGW_BUILDDIR_SUFFIX \
%{?mingw64_meson "$@"} \ %{?mingw64_meson "$@"} \
popd \ popd \
%endif \ %endif \
%if 0%{?mingw_build_ucrt64} == 1 \
mkdir -p build_ucrt64$MINGW_BUILDDIR_SUFFIX \
pushd build_ucrt64$MINGW_BUILDDIR_SUFFIX \
%{?ucrt64_meson "$@"} \
popd \
%endif \
} \ } \
run_mingw_meson run_mingw_meson
@ -169,6 +181,9 @@ ninja -C build_win32$MINGW_BUILDDIR_SUFFIX "$@" $MINGW32_NINJA_ARGS \
%if 0%{?mingw_build_win64} == 1 \ %if 0%{?mingw_build_win64} == 1 \
ninja -C build_win64$MINGW_BUILDDIR_SUFFIX "$@" $MINGW64_NINJA_ARGS \ ninja -C build_win64$MINGW_BUILDDIR_SUFFIX "$@" $MINGW64_NINJA_ARGS \
%endif \ %endif \
%if 0%{?mingw_build_ucrt64} == 1 \
ninja -C build_ucrt64$MINGW_BUILDDIR_SUFFIX "$@" $UCRT64_NINJA_ARGS \
%endif \
} \ } \
run_mingw_ninja run_mingw_ninja
@ -181,6 +196,9 @@ DESTDIR=%{buildroot} ninja -C build_win32$MINGW_BUILDDIR_SUFFIX install \
%if 0%{?mingw_build_win64} == 1 \ %if 0%{?mingw_build_win64} == 1 \
DESTDIR=%{buildroot} ninja -C build_win64$MINGW_BUILDDIR_SUFFIX install \ DESTDIR=%{buildroot} ninja -C build_win64$MINGW_BUILDDIR_SUFFIX install \
%endif \ %endif \
%if 0%{?mingw_build_ucrt64} == 1 \
DESTDIR=%{buildroot} ninja -C build_ucrt64$MINGW_BUILDDIR_SUFFIX install \
%endif \
} \ } \
run_mingw_ninja_install run_mingw_ninja_install

View File

@ -1,6 +1,6 @@
# RPM macros for Fedora MinGW. # RPM macros for Fedora MinGW.
%mingw32_pkg_name %(echo %{name} | sed 's/^mingw-/mingw32-/') %mingw32_pkg_name %(echo %{name} | sed -E 's/^(mingw-|)/mingw32-/')
%mingw32_target i686-w64-mingw32 %mingw32_target i686-w64-mingw32
# Paths. # Paths.
@ -25,6 +25,7 @@
%mingw32_cflags %{mingw32_cppflags} -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 %mingw32_cflags %{mingw32_cppflags} -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4
%mingw32_cppflags %{nil} %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_ldflags -fstack-protector -lssp
%mingw32_cc %{mingw32_target}-gcc %mingw32_cc %{mingw32_target}-gcc
@ -73,6 +74,8 @@
ac_cv_prog_CXX=no; export ac_cv_prog_CXX; \ ac_cv_prog_CXX=no; export ac_cv_prog_CXX; \
CXXFLAGS=; export CXXFLAGS; \ CXXFLAGS=; export CXXFLAGS; \
fi; \ fi; \
FFLAGS="${MINGW32_FFLAGS-%mingw32_fflags}"; export FFLAGS; \
FCFLAGS="${MINGW32_FCFLAGS-%mingw32_fflags}"; export FCFLAGS; \
LDFLAGS="${MINGW32_LDFLAGS:-%mingw32_ldflags}"; export LDFLAGS; \ LDFLAGS="${MINGW32_LDFLAGS:-%mingw32_ldflags}"; export LDFLAGS; \
for i in `ls %{mingw32_bindir}/*|grep -- "-config\$"` ; do \ for i in `ls %{mingw32_bindir}/*|grep -- "-config\$"` ; do \
x=`basename $i|tr "a-z+-." "A-ZX_"`; \ x=`basename $i|tr "a-z+-." "A-ZX_"`; \
@ -80,7 +83,7 @@
done; \ done; \
unset x i unset x i
%mingw32_pkg_config %{mingw32_target}-pkg-config %mingw32_pkg_config %{mingw32_target}-pkg-config "$@"
%mingw32_pkgconfig_personalitydir %{mingw32_datadir}/pkgconfig/personality.d %mingw32_pkgconfig_personalitydir %{mingw32_datadir}/pkgconfig/personality.d
%mingw32_configure %{mingw32_env} ; \ %mingw32_configure %{mingw32_env} ; \
@ -103,7 +106,7 @@
--mandir=%{mingw32_mandir} \\\ --mandir=%{mingw32_mandir} \\\
--infodir=%{mingw32_infodir} \\\ --infodir=%{mingw32_infodir} \\\
${MINGW_CONFIGURE_ARGS} \\\ ${MINGW_CONFIGURE_ARGS} \\\
${MINGW32_CONFIGURE_ARGS} ${MINGW32_CONFIGURE_ARGS} "$@"
%mingw32_make %{mingw32_env} ; \ %mingw32_make %{mingw32_env} ; \
make \\\ make \\\
@ -119,7 +122,7 @@
localstatedir=%{mingw32_localstatedir} \\\ localstatedir=%{mingw32_localstatedir} \\\
sharedstatedir=%{mingw32_sharedstatedir} \\\ sharedstatedir=%{mingw32_sharedstatedir} \\\
mandir=%{mingw32_mandir} \\\ mandir=%{mingw32_mandir} \\\
infodir=%{mingw32_infodir} infodir=%{mingw32_infodir} "$@"
%mingw32_cmake_generic %{mingw32_env} ; \ %mingw32_cmake_generic %{mingw32_env} ; \
PKG_CONFIG_LIBDIR="%{mingw32_libdir}/pkgconfig:%{mingw32_datadir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \ PKG_CONFIG_LIBDIR="%{mingw32_libdir}/pkgconfig:%{mingw32_datadir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \
@ -141,20 +144,21 @@
"$@" $__mingw32_topdir "$@" $__mingw32_topdir
%mingw32_cmake \ %mingw32_cmake \
MINGW32_CMAKE_ARGS="${MINGW32_CMAKE_ARGS} -DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir}" \ MINGW32_CMAKE_ARGS="-DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir} ${MINGW32_CMAKE_ARGS}" \
%mingw32_cmake_generic %mingw32_cmake_generic
%mingw32_cmake_kde4 \ %mingw32_cmake_kde4 \
MINGW32_CMAKE_ARGS="${MINGW32_CMAKE_ARGS} -DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir}/kde4" \ MINGW32_CMAKE_ARGS="-DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir}/kde4 ${MINGW32_CMAKE_ARGS}" \
%mingw32_cmake_generic %mingw32_cmake_generic
%mingw32_qmake_qt4 /usr/bin/mingw32-qmake-qt4
%mingw32_qmake_qt5 /usr/bin/mingw32-qmake-qt5 %mingw32_qmake_qt5 /usr/bin/mingw32-qmake-qt5
%mingw32_meson %{mingw32_env} ; \ %mingw32_meson %{mingw32_env} ; \
unset CC CFLAGS CPPFLAGS CXX CXXFLAGS LD LDFLAGS; \\\ unset CC CFLAGS CPPFLAGS CXX CXXFLAGS LD LDFLAGS; \\\
CFLAGS="${MINGW32_CFLAGS-%mingw32_cflags}"; export CFLAGS; \\\ CFLAGS="${MINGW32_CFLAGS-%mingw32_cflags}"; export CFLAGS; \\\
CPPFLAGS="${MINGW32_CPPFLAGS-%mingw32_cppflags}"; export CPPFLAGS; \\\ CPPFLAGS="${MINGW32_CPPFLAGS-%mingw32_cppflags}"; export CPPFLAGS; \\\
FFLAGS="${MINGW32_FFLAGS-%mingw32_fflags}"; export FFLAGS; \
FCFLAGS="${MINGW32_FCFLAGS-%mingw32_fflags}"; export FCFLAGS; \
LDFLAGS="${MINGW32_LDFLAGS:-%mingw32_ldflags}"; export LDFLAGS; \\\ LDFLAGS="${MINGW32_LDFLAGS:-%mingw32_ldflags}"; export LDFLAGS; \\\
if test -f meson.build; then __mingw32_topdir=.; \\\ if test -f meson.build; then __mingw32_topdir=.; \\\
elif test -f ../meson.build; then __mingw32_topdir=..; \\\ elif test -f ../meson.build; then __mingw32_topdir=..; \\\

View File

@ -1,6 +1,6 @@
# RPM macros for Fedora MinGW. # RPM macros for Fedora MinGW.
%mingw64_pkg_name %(echo %{name} | sed 's/^mingw-/mingw64-/') %mingw64_pkg_name %(echo %{name} | sed -E 's/^(mingw-|)/mingw64-/')
%mingw64_target x86_64-w64-mingw32 %mingw64_target x86_64-w64-mingw32
# Paths. # Paths.
@ -25,6 +25,7 @@
%mingw64_cflags %{mingw64_cppflags} -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 %mingw64_cflags %{mingw64_cppflags} -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4
%mingw64_cppflags %{nil} %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_ldflags -fstack-protector -lssp
%mingw64_cc %{mingw64_target}-gcc %mingw64_cc %{mingw64_target}-gcc
@ -73,6 +74,8 @@
ac_cv_prog_CXX=no; export ac_cv_prog_CXX; \ ac_cv_prog_CXX=no; export ac_cv_prog_CXX; \
CXXFLAGS=; export CXXFLAGS; \ CXXFLAGS=; export CXXFLAGS; \
fi; \ fi; \
FFLAGS="${MINGW64_FFLAGS-%mingw64_fflags}"; export FFLAGS; \
FCFLAGS="${MINGW64_FCFLAGS-%mingw64_fflags}"; export FCFLAGS; \
LDFLAGS="${MINGW64_LDFLAGS:-%mingw64_ldflags}"; export LDFLAGS; \ LDFLAGS="${MINGW64_LDFLAGS:-%mingw64_ldflags}"; export LDFLAGS; \
for i in `ls %{mingw64_bindir}/*|grep -- "-config\$"` ; do \ for i in `ls %{mingw64_bindir}/*|grep -- "-config\$"` ; do \
x=`basename $i|tr "a-z+-." "A-ZX_"`; \ x=`basename $i|tr "a-z+-." "A-ZX_"`; \
@ -80,7 +83,7 @@
done; \ done; \
unset x i unset x i
%mingw64_pkg_config %{mingw64_target}-pkg-config %mingw64_pkg_config %{mingw64_target}-pkg-config "$@"
%mingw64_pkgconfig_personalitydir %{mingw32_datadir}/pkgconfig/personality.d %mingw64_pkgconfig_personalitydir %{mingw32_datadir}/pkgconfig/personality.d
%mingw64_configure %{mingw64_env} ; \ %mingw64_configure %{mingw64_env} ; \
@ -103,7 +106,7 @@
--mandir=%{mingw64_mandir} \\\ --mandir=%{mingw64_mandir} \\\
--infodir=%{mingw64_infodir} \\\ --infodir=%{mingw64_infodir} \\\
${MINGW_CONFIGURE_ARGS} \\\ ${MINGW_CONFIGURE_ARGS} \\\
${MINGW64_CONFIGURE_ARGS} ${MINGW64_CONFIGURE_ARGS} "$@"
%mingw64_make %{mingw64_env} ; \ %mingw64_make %{mingw64_env} ; \
make \\\ make \\\
@ -119,7 +122,7 @@
localstatedir=%{mingw64_localstatedir} \\\ localstatedir=%{mingw64_localstatedir} \\\
sharedstatedir=%{mingw64_sharedstatedir} \\\ sharedstatedir=%{mingw64_sharedstatedir} \\\
mandir=%{mingw64_mandir} \\\ mandir=%{mingw64_mandir} \\\
infodir=%{mingw64_infodir} infodir=%{mingw64_infodir} "$@"
%mingw64_cmake_generic %{mingw64_env} ; \ %mingw64_cmake_generic %{mingw64_env} ; \
PKG_CONFIG_LIBDIR="%{mingw64_libdir}/pkgconfig:%{mingw64_datadir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \ PKG_CONFIG_LIBDIR="%{mingw64_libdir}/pkgconfig:%{mingw64_datadir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \
@ -141,20 +144,21 @@
"$@" $__mingw64_topdir "$@" $__mingw64_topdir
%mingw64_cmake \ %mingw64_cmake \
MINGW64_CMAKE_ARGS="${MINGW64_CMAKE_ARGS} -DINCLUDE_INSTALL_DIR:PATH=%{mingw64_includedir}" \ MINGW64_CMAKE_ARGS="-DINCLUDE_INSTALL_DIR:PATH=%{mingw64_includedir} ${MINGW64_CMAKE_ARGS}" \
%mingw64_cmake_generic %mingw64_cmake_generic
%mingw64_cmake_kde4 \ %mingw64_cmake_kde4 \
MINGW64_CMAKE_ARGS="${MINGW64_CMAKE_ARGS} -DINCLUDE_INSTALL_DIR:PATH=%{mingw64_includedir}/kde4" \ MINGW64_CMAKE_ARGS="-DINCLUDE_INSTALL_DIR:PATH=%{mingw64_includedir}/kde4 ${MINGW64_CMAKE_ARGS}" \
%mingw64_cmake_generic %mingw64_cmake_generic
%mingw64_qmake_qt4 /usr/bin/mingw64-qmake-qt4
%mingw64_qmake_qt5 /usr/bin/mingw64-qmake-qt5 %mingw64_qmake_qt5 /usr/bin/mingw64-qmake-qt5
%mingw64_meson %{mingw64_env} ; \ %mingw64_meson %{mingw64_env} ; \
unset CC CFLAGS CPPFLAGS CXX CXXFLAGS LD LDFLAGS; \\\ unset CC CFLAGS CPPFLAGS CXX CXXFLAGS LD LDFLAGS; \\\
CFLAGS="${MINGW64_CFLAGS-%mingw64_cflags}"; export CFLAGS; \\\ CFLAGS="${MINGW64_CFLAGS-%mingw64_cflags}"; export CFLAGS; \\\
CPPFLAGS="${MINGW64_CPPFLAGS-%mingw64_cppflags}"; export CPPFLAGS; \\\ CPPFLAGS="${MINGW64_CPPFLAGS-%mingw64_cppflags}"; export CPPFLAGS; \\\
FFLAGS="${MINGW64_FFLAGS-%mingw64_fflags}"; export FFLAGS; \
FCFLAGS="${MINGW64_FCFLAGS-%mingw64_fflags}"; export FCFLAGS; \
LDFLAGS="${MINGW64_LDFLAGS:-%mingw64_ldflags}"; export LDFLAGS; \\\ LDFLAGS="${MINGW64_LDFLAGS:-%mingw64_ldflags}"; export LDFLAGS; \\\
if test -f meson.build; then __mingw64_topdir=.; \\\ if test -f meson.build; then __mingw64_topdir=.; \\\
elif test -f ../meson.build; then __mingw64_topdir=..; \\\ elif test -f ../meson.build; then __mingw64_topdir=..; \\\

195
macros.ucrt64 Normal file
View File

@ -0,0 +1,195 @@
# RPM macros for Fedora MinGW UCRT64.
%ucrt64_pkg_name %(echo %{name} | sed 's/^mingw-/ucrt64-/')
%ucrt64_target x86_64-w64-mingw32ucrt
# Paths.
%ucrt64_sysroot %{_prefix}/%{ucrt64_target}/sys-root
%ucrt64_prefix %{ucrt64_sysroot}/mingw
%ucrt64_exec_prefix %{ucrt64_prefix}
%ucrt64_bindir %{ucrt64_exec_prefix}/bin
%ucrt64_sbindir %{ucrt64_exec_prefix}/sbin
%ucrt64_libexecdir %{ucrt64_exec_prefix}/libexec
%ucrt64_libdir %{ucrt64_exec_prefix}/lib
%ucrt64_datadir %{ucrt64_prefix}/share
%ucrt64_docdir %{ucrt64_prefix}/share/doc
%ucrt64_infodir %{ucrt64_prefix}/share/info
%ucrt64_mandir %{ucrt64_prefix}/share/man
%ucrt64_sysconfdir %{ucrt64_prefix}/etc
%ucrt64_sharedstatedir %{ucrt64_prefix}/com
%ucrt64_localstatedir %{ucrt64_prefix}/var
%ucrt64_includedir %{ucrt64_prefix}/include
# Build macros.
%ucrt64_host %{ucrt64_target}
%ucrt64_cflags %{ucrt64_cppflags} -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4
%ucrt64_cppflags %{nil}
%ucrt64_ldflags -fstack-protector -lssp
%ucrt64_cc %{ucrt64_target}-gcc
%ucrt64_cxx %{ucrt64_target}-g++
%ucrt64_cpp %{ucrt64_target}-gcc -E
%ucrt64_addr2line %{ucrt64_target}-addr2line
%ucrt64_ar %{ucrt64_target}-ar
%ucrt64_as %{ucrt64_target}-as
%ucrt64_dlltool %{ucrt64_target}-dlltool
%ucrt64_dllwrap %{ucrt64_target}-dllwrap
%ucrt64_gcov %{ucrt64_target}-gcov
%ucrt64_gprof %{ucrt64_target}-gprof
%ucrt64_ld %{ucrt64_target}-ld
%ucrt64_nm %{ucrt64_target}-nm
%ucrt64_objcopy %{ucrt64_target}-objcopy
%ucrt64_objdump %{ucrt64_target}-objdump
%ucrt64_ranlib %{ucrt64_target}-ranlib
%ucrt64_readelf %{ucrt64_target}-readelf
%ucrt64_size %{ucrt64_target}-size
%ucrt64_strings %{ucrt64_target}-strings
%ucrt64_strip %{ucrt64_target}-strip
%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); \
if test -z "$PATH_ORIG" ; then \
PATH_ORIG="$PATH"; export PATH_ORIG; \
fi; \
PATH="%{ucrt64_bindir}:$PATH_ORIG"; export PATH; \
HOST_CC=gcc; export HOST_CC; \
unset PKG_CONFIG_PATH; \
_PREFIX="%{_bindir}/%{ucrt64_target}-"; \
for i in `ls -1 ${_PREFIX}* | grep -v 'gcc-'`; do \
x=`echo $i|sed "s,${_PREFIX},,"|tr "a-z+-." "A-ZX__"`; \
declare -x $x="$i" ; export $x; \
done; \
unset _PREFIX; \
CC="${UCRT64_CC:-%ucrt64_cc}"; export CC; \
CFLAGS="${UCRT64_CFLAGS-%ucrt64_cflags}"; export CFLAGS; \
CPPFLAGS="${UCRT64_CPPFLAGS-%ucrt64_cppflags}"; export CPPFLAGS; \
if [ -x "%{_bindir}/%{ucrt64_cxx}" ]; then \
CXX="${UCRT64_CXX:-%ucrt64_cxx}"; export CXX; \
CXXFLAGS="${UCRT64_CXXFLAGS-%ucrt64_cflags}"; export CXXFLAGS; \
else \
CXX=; export CXX; \
ac_cv_prog_CXX=no; export ac_cv_prog_CXX; \
CXXFLAGS=; export CXXFLAGS; \
fi; \
LDFLAGS="${UCRT64_LDFLAGS:-%ucrt64_ldflags}"; export LDFLAGS; \
for i in `ls %{ucrt64_bindir}/*|grep -- "-config\$"` ; do \
x=`basename $i|tr "a-z+-." "A-ZX_"`; \
declare -x $x="$i" ; export $x; \
done; \
unset x i
%ucrt64_pkg_config %{ucrt64_target}-pkg-config "$@"
%ucrt64_pkgconfig_personalitydir %{mingw32_datadir}/pkgconfig/personality.d
%ucrt64_configure %{ucrt64_env} ; \
__ucrt64_topdir=.; if ! test -x configure; then __ucrt64_topdir=..; fi; \\\
$__ucrt64_topdir/configure \\\
--host=%{ucrt64_host} \\\
--build=%_build \\\
--target=%{ucrt64_target} \\\
--prefix=%{ucrt64_prefix} \\\
--exec-prefix=%{ucrt64_exec_prefix} \\\
--bindir=%{ucrt64_bindir} \\\
--sbindir=%{ucrt64_sbindir} \\\
--sysconfdir=%{ucrt64_sysconfdir} \\\
--datadir=%{ucrt64_datadir} \\\
--includedir=%{ucrt64_includedir} \\\
--libdir=%{ucrt64_libdir} \\\
--libexecdir=%{ucrt64_libexecdir} \\\
--localstatedir=%{ucrt64_localstatedir} \\\
--sharedstatedir=%{ucrt64_sharedstatedir} \\\
--mandir=%{ucrt64_mandir} \\\
--infodir=%{ucrt64_infodir} \\\
${MINGW_CONFIGURE_ARGS} \\\
${UCRT64_CONFIGURE_ARGS} "$@"
%ucrt64_make %{ucrt64_env} ; \
make \\\
prefix=%{ucrt64_prefix} \\\
exec_prefix=%{ucrt64_exec_prefix} \\\
bindir=%{ucrt64_bindir} \\\
sbindir=%{ucrt64_sbindir} \\\
sysconfdir=%{ucrt64_sysconfdir} \\\
datadir=%{ucrt64_datadir} \\\
includedir=%{ucrt64_includedir} \\\
libdir=%{ucrt64_libdir} \\\
libexecdir=%{ucrt64_libexecdir} \\\
localstatedir=%{ucrt64_localstatedir} \\\
sharedstatedir=%{ucrt64_sharedstatedir} \\\
mandir=%{ucrt64_mandir} \\\
infodir=%{ucrt64_infodir} "$@"
%ucrt64_cmake_generic %{ucrt64_env} ; \
PKG_CONFIG_LIBDIR="%{ucrt64_libdir}/pkgconfig:%{ucrt64_datadir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \
if test -f CMakeLists.txt; then __ucrt64_topdir=.; \\\
elif test -f ../CMakeLists.txt; then __ucrt64_topdir=..; \\\
else __ucrt64_topdir=""; fi; \\\
if test "${MINGW_CMAKE_NO_VERBOSE}" == "" ; then \
UCRT64_CMAKE_ARGS="${UCRT64_CMAKE_ARGS} -DCMAKE_VERBOSE_MAKEFILE=ON" \
fi \
PATH=%{_prefix}/%{ucrt64_target}/bin:$PATH %__cmake \\\
-DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-ucrt64.cmake \\\
-DBUILD_SHARED_LIBS:BOOL=ON \\\
-DSYSCONF_INSTALL_DIR:PATH=%{ucrt64_sysconfdir} \\\
-DSHARE_INSTALL_PREFIX:PATH=%{ucrt64_datadir} \\\
-DCMAKE_INSTALL_PREFIX:PATH=%{ucrt64_prefix} \\\
-DCMAKE_INSTALL_LIBDIR:PATH=%{ucrt64_libdir} \\\
${MINGW_CMAKE_ARGS} \\\
${UCRT64_CMAKE_ARGS} \\\
"$@" $__ucrt64_topdir
%ucrt64_cmake \
UCRT64_CMAKE_ARGS="-DINCLUDE_INSTALL_DIR:PATH=%{ucrt64_includedir} ${UCRT64_CMAKE_ARGS}" \
%ucrt64_cmake_generic
%ucrt64_cmake_kde4 \
UCRT64_CMAKE_ARGS="-DINCLUDE_INSTALL_DIR:PATH=%{ucrt64_includedir}/kde4 ${UCRT64_CMAKE_ARGS}" \
%ucrt64_cmake_generic
%ucrt64_qmake_qt5 /usr/bin/ucrt64-qmake-qt5
%ucrt64_meson %{ucrt64_env} ; \
unset CC CFLAGS CPPFLAGS CXX CXXFLAGS LD LDFLAGS; \\\
CFLAGS="${UCRT64_CFLAGS-%ucrt64_cflags}"; export CFLAGS; \\\
CPPFLAGS="${UCRT64_CPPFLAGS-%ucrt64_cppflags}"; export CPPFLAGS; \\\
LDFLAGS="${UCRT64_LDFLAGS:-%ucrt64_ldflags}"; export LDFLAGS; \\\
if test -f meson.build; then __ucrt64_topdir=.; \\\
elif test -f ../meson.build; then __ucrt64_topdir=..; \\\
else __ucrt64_topdir=""; fi; \\\
%__meson \\\
--cross-file /usr/share/mingw/toolchain-ucrt64.meson \\\
--default-library shared \\\
--prefix %{ucrt64_prefix} \\\
--bindir %{ucrt64_bindir} \\\
--sbindir %{ucrt64_sbindir} \\\
--sysconfdir %{ucrt64_sysconfdir} \\\
--datadir %{ucrt64_datadir} \\\
--includedir %{ucrt64_includedir} \\\
--libdir %{ucrt64_libdir} \\\
--libexecdir %{ucrt64_libexecdir} \\\
--localstatedir %{ucrt64_localstatedir} \\\
--sharedstatedir %{ucrt64_sharedstatedir} \\\
--mandir %{ucrt64_mandir} \\\
--infodir %{ucrt64_infodir} \\\
${MINGW_MESON_ARGS} \\\
${UCRT64_MESON_ARGS} \\\
"$@" $__ucrt64_topdir
%ucrt64_description This is the cross-compiled version of this library / tool.\
You should only install this package if you want to cross-compile programs for \
Win64 (64 bit Windows).
%ucrt64_debug_package \
%package -n %{ucrt64_pkg_name}-debuginfo \
Summary: Debug information for package %{ucrt64_pkg_name} \
Group: Development/Debug \
BuildArch: noarch \
%description -n %{ucrt64_pkg_name}-debuginfo \
This package provides debug information for package %{ucrt64_pkg_name}. \
Debug information is useful when developing applications that use this \
package or when debugging this package. \
%files -n %{ucrt64_pkg_name}-debuginfo -f ucrt64-debugfiles.list \
%defattr(-,root,root,-) \
%{nil}

View File

@ -6,8 +6,8 @@
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
Name: mingw-filesystem Name: mingw-filesystem
Version: 119 Version: 136
Release: 3%{?dist} Release: 1%{?dist}
Summary: MinGW cross compiler base filesystem and environment Summary: MinGW cross compiler base filesystem and environment
License: GPLv2+ License: GPLv2+
@ -18,27 +18,30 @@ Source0: COPYING
Source1: macros.mingw Source1: macros.mingw
Source2: macros.mingw32 Source2: macros.mingw32
Source3: macros.mingw64 Source3: macros.mingw64
Source4: mingw32.sh Source4: macros.ucrt64
Source5: mingw64.sh Source5: mingw32.sh
Source6: mingw-find-debuginfo.sh Source6: mingw64.sh
Source7: mingw-find-requires.sh Source7: ucrt64.sh
Source8: mingw-find-provides.sh Source8: mingw-find-debuginfo.sh
Source9: mingw-scripts.sh Source9: mingw.req
Source10: mingw-rpmlint.config Source10: mingw.prov
Source11: toolchain-mingw32.cmake Source11: mingw-scripts.sh
Source12: toolchain-mingw64.cmake Source12: mingw-rpmlint.config
Source13: mingw-find-lang.sh Source13: toolchain-mingw32.cmake
Source14: mingw32.attr Source14: toolchain-mingw64.cmake
Source15: mingw64.attr Source15: toolchain-ucrt64.cmake
# generated with: Source16: mingw-find-lang.sh
# (rpm -ql mingw32-crt | grep '\.a$' | while read f ; do i686-w64-mingw32-dlltool -I $f 2>/dev/null ; done) | sort | uniq | tr A-Z a-z > standard-dlls-mingw32 Source17: mingw32.attr
Source16: standard-dlls-mingw32 Source18: mingw64.attr
# (rpm -ql mingw64-crt | grep '\.a$' | while read f ; do x86_64-w64-mingw32-dlltool -I $f 2>/dev/null ; done) | sort | uniq | tr A-Z a-z > standard-dlls-mingw64 Source19: ucrt64.attr
Source17: standard-dlls-mingw64 Source20: toolchain-mingw32.meson
Source18: toolchain-mingw32.meson Source21: toolchain-mingw64.meson
Source19: toolchain-mingw64.meson Source22: toolchain-ucrt64.meson
Source20: pkgconf-personality-mingw32 Source23: pkgconf-personality-mingw32
Source21: pkgconf-personality-mingw64 Source24: pkgconf-personality-mingw64
Source25: pkgconf-personality-ucrt64
Source26: mingw32-hostlib.conf
Source27: mingw64-hostlib.conf
# Taken from the Fedora filesystem package # Taken from the Fedora filesystem package
Source101: https://fedorahosted.org/filesystem/browser/lang-exceptions Source101: https://fedorahosted.org/filesystem/browser/lang-exceptions
@ -60,7 +63,7 @@ This environment is maintained by the Fedora MinGW SIG at:
%package base %package base
Summary: Generic files which are needed for both mingw32-filesystem and mingw64-filesystem Summary: Generic files which are needed for {mingw32,mingw64,ucrt64}-filesystem
Requires: redhat-rpm-config Requires: redhat-rpm-config
# Obsolete the packages from the test repo # Obsolete the packages from the test repo
@ -88,23 +91,6 @@ Conflicts: mingw32-pkg-config < 0.28-18
Obsoletes: mingw32-pkg-config < 0.28-18 Obsoletes: mingw32-pkg-config < 0.28-18
Provides: mingw32-pkg-config = 0.28-18 Provides: mingw32-pkg-config = 0.28-18
# Note about 'Provides: mingw32(foo.dll)'
# ------------------------------------------------------------
#
# We want to be able to build & install mingw32 libraries without
# necessarily needing to install wine. (And certainly not needing to
# install Windows!) There is no requirement to have wine installed in
# order to use the mingw toolchain to develop software (ie. to
# compile more stuff on top of it), so why require that?
#
# So for expediency, this base package provides the "missing" DLLs
# from Windows. Another way to do it would be to exclude these
# proprietary DLLs in our find-requires checking script - essentially
# it comes out the same either way.
#
Provides: %(sed "s/\(.*\)/mingw32(\1) /g" %{SOURCE16} | tr "\n" " ")
Provides: mingw32(mscoree.dll)
%description -n mingw32-filesystem %description -n mingw32-filesystem
This package contains the base filesystem layout, RPM macros and This package contains the base filesystem layout, RPM macros and
environment for all Fedora MinGW packages. environment for all Fedora MinGW packages.
@ -122,13 +108,28 @@ Conflicts: mingw64-pkg-config < 0.28-18
Obsoletes: mingw64-pkg-config < 0.28-18 Obsoletes: mingw64-pkg-config < 0.28-18
Provides: mingw64-pkg-config = 0.28-18 Provides: mingw64-pkg-config = 0.28-18
Provides: %(sed "s/\(.*\)/mingw64(\1) /g" %{SOURCE17} | tr "\n" " ")
Provides: mingw64(mscoree.dll)
%description -n mingw64-filesystem %description -n mingw64-filesystem
This package contains the base filesystem layout, RPM macros and This package contains the base filesystem layout, RPM macros and
environment for all Fedora MinGW packages. environment for all Fedora MinGW packages.
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}
# Replace ucrt64-pkg-config
Conflicts: ucrt64-pkg-config < 0.28-17
Obsoletes: ucrt64-pkg-config < 0.28-17
Provides: ucrt64-pkg-config = 0.28-17
%description -n ucrt64-filesystem
This package contains the base filesystem layout, RPM macros and
environment for all Fedora MinGW packages.
This environment is maintained by the Fedora MinGW SIG at: This environment is maintained by the Fedora MinGW SIG at:
http://fedoraproject.org/wiki/SIGs/MinGW http://fedoraproject.org/wiki/SIGs/MinGW
@ -144,96 +145,72 @@ cp %{SOURCE0} COPYING
%install %install
mkdir -p %{buildroot}
mkdir -p %{buildroot}%{_libexecdir} mkdir -p %{buildroot}%{_libexecdir}
install -m 755 %{SOURCE9} %{buildroot}%{_libexecdir}/mingw-scripts install -m 755 %{SOURCE11} %{buildroot}%{_libexecdir}/mingw-scripts
mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_bindir}
pushd %{buildroot}%{_bindir} pushd %{buildroot}%{_bindir}
for i in mingw32-configure mingw32-cmake mingw32-make mingw32-meson mingw32-pkg-config \ for i in mingw32-configure mingw32-cmake mingw32-make mingw32-meson mingw32-pkg-config \
mingw64-configure mingw64-cmake mingw64-make mingw64-meson mingw64-pkg-config ; do mingw64-configure mingw64-cmake mingw64-make mingw64-meson mingw64-pkg-config \
ucrt64-configure ucrt64-cmake ucrt64-make ucrt64-meson ucrt64-pkg-config ; do
ln -s %{_libexecdir}/mingw-scripts $i ln -s %{_libexecdir}/mingw-scripts $i
done done
for i in i686-w64-mingw32-pkg-config \ for i in i686-w64-mingw32-pkg-config \
x86_64-w64-mingw32-pkg-config ; do x86_64-w64-mingw32-pkg-config \
x86_64-w64-mingw32ucrt-pkg-config ; do
ln -s %{_bindir}/pkgconf $i ln -s %{_bindir}/pkgconf $i
done done
popd popd
mkdir -p %{buildroot}%{_sysconfdir}/profile.d mkdir -p %{buildroot}%{_sysconfdir}/profile.d
install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/profile.d/
install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/profile.d/ install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/profile.d/
install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/profile.d/
install -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/profile.d/
mkdir -p %{buildroot}%{macrosdir} mkdir -p %{buildroot}%{macrosdir}
install -m 644 %{SOURCE1} %{buildroot}%{macrosdir}/macros.mingw install -m 644 %{SOURCE1} %{buildroot}%{macrosdir}/macros.mingw
install -m 644 %{SOURCE2} %{buildroot}%{macrosdir}/macros.mingw32 install -m 644 %{SOURCE2} %{buildroot}%{macrosdir}/macros.mingw32
install -m 644 %{SOURCE3} %{buildroot}%{macrosdir}/macros.mingw64 install -m 644 %{SOURCE3} %{buildroot}%{macrosdir}/macros.mingw64
install -m 644 %{SOURCE4} %{buildroot}%{macrosdir}/macros.ucrt64
mkdir -p %{buildroot}%{_sysconfdir}/rpmlint mkdir -p %{buildroot}%{_sysconfdir}/rpmlint
install -m 644 %{SOURCE10} %{buildroot}%{_sysconfdir}/rpmlint/ install -m 644 %{SOURCE12} %{buildroot}%{_sysconfdir}/rpmlint/
# Create the folders required for gcc and binutils for target in i686-w64-mingw32 x86_64-w64-mingw32 x86_64-w64-mingw32ucrt; do
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32 # Create the folders required for gcc and binutils
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/bin mkdir -p %{buildroot}%{_prefix}/$target
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/lib mkdir -p %{buildroot}%{_prefix}/$target/bin
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32 mkdir -p %{buildroot}%{_prefix}/$target/lib
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/bin
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/lib
# The MinGW system root which will contain Windows native binaries # The MinGW system root which will contain Windows native binaries
# and Windows-specific header files, pkgconfig, etc. # and Windows-specific header files, pkgconfig, etc.
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/bin mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/bin
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/etc mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/etc
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/include mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/include
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/include/sys mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/include/sys
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/lib mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/lib
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/lib/pkgconfig
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/lib/cmake mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/lib/cmake
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/sbin mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/sbin
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw # We don't normally package manual pages and info files, except
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/bin # where those are not supplied by a Fedora native package. So we
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/etc # need to create the directories.
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/include mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/share
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/include mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/share/doc
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/lib mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/share/info
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/share/man
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/lib/cmake mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/share/man/man{1,2,3,4,5,6,7,8,l,n}
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/sbin mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/share/aclocal
mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/share/themes
mkdir -p %{buildroot}%{_prefix}/$target/sys-root/mingw/share/cmake
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
# We don't normally package manual pages and info files, except mkdir -p %{buildroot}%{_prefix}/lib/debug/%{_prefix}/$target
# where those are not supplied by a Fedora native package. So we done
# need to create the directories.
#
# Note that some packages try to install stuff in
# /usr/x86_64-pc-mingw32/sys-root/man and
# /usr/x86_64-pc-mingw32/sys-root/doc
# but those are both packaging bugs.
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/share
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/doc
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/info
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/man
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/man/man{1,2,3,4,5,6,7,8,l,n}
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/aclocal
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/themes
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/cmake
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/locale
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/pkgconfig
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/sys-root/mingw/share/xml
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/doc
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/info
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/man
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/man/man{1,2,3,4,5,6,7,8,l,n}
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/aclocal
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/themes
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/cmake
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/locale
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/pkgconfig
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/xml
# Own folders for all locales # Own folders for all locales
# Snippet taken from the Fedora filesystem package # Snippet taken from the Fedora filesystem package
@ -250,6 +227,7 @@ grep -v "^$" %{buildroot}/iso_639.tab | grep -v "^#" | while read a b c d ; do
fi fi
echo "%lang(${locale}) %{_prefix}/i686-w64-mingw32/sys-root/mingw/share/locale/${locale}" >> filelist_mingw32 echo "%lang(${locale}) %{_prefix}/i686-w64-mingw32/sys-root/mingw/share/locale/${locale}" >> filelist_mingw32
echo "%lang(${locale}) %{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/locale/${locale}" >> filelist_mingw64 echo "%lang(${locale}) %{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/locale/${locale}" >> filelist_mingw64
echo "%lang(${locale}) %{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/share/locale/${locale}" >> filelist_ucrt
done done
cat %{SOURCE101} | grep -v "^#" | grep -v "^$" | while read loc ; do cat %{SOURCE101} | grep -v "^#" | grep -v "^$" | while read loc ; do
@ -271,40 +249,50 @@ cat %{SOURCE101} | grep -v "^#" | grep -v "^$" | while read loc ; do
fi fi
echo "%lang(${locale}) %{_prefix}/i686-w64-mingw32/sys-root/mingw/share/locale/${loc}" >> filelist_mingw32 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 echo "%lang(${locale}) %{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/locale/${loc}" >> filelist_mingw64
echo "%lang(${locale}) %{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/share/locale/${loc}" >> filelist_ucrt
done done
rm -f %{buildroot}/iso_639.tab rm -f %{buildroot}/iso_639.tab
rm -f %{buildroot}/iso_3166.tab rm -f %{buildroot}/iso_3166.tab
cat filelist_mingw32 filelist_mingw64 | grep "locale" | while read a b ; do cat filelist_mingw32 filelist_mingw64 filelist_ucrt | grep "locale" | while read a b ; do
mkdir -p -m 755 %{buildroot}/$b/LC_MESSAGES mkdir -p -m 755 %{buildroot}/$b/LC_MESSAGES
done done
# NB. NOT _libdir # NB. NOT _libdir
mkdir -p %{buildroot}/usr/lib/rpm mkdir -p %{buildroot}/usr/lib/rpm
install -m 0755 %{SOURCE6} %{buildroot}%{_rpmconfigdir}
install -m 0755 %{SOURCE7} %{buildroot}%{_rpmconfigdir}
install -m 0755 %{SOURCE8} %{buildroot}%{_rpmconfigdir} install -m 0755 %{SOURCE8} %{buildroot}%{_rpmconfigdir}
install -m 0755 %{SOURCE13} %{buildroot}%{_rpmconfigdir} install -m 0755 %{SOURCE9} %{buildroot}%{_rpmconfigdir}
install -m 0755 %{SOURCE10} %{buildroot}%{_rpmconfigdir}
install -m 0755 %{SOURCE16} %{buildroot}%{_rpmconfigdir}
mkdir -p %{buildroot}/usr/lib/rpm/fileattrs mkdir -p %{buildroot}/usr/lib/rpm/fileattrs
install -m 0644 %{SOURCE14} %{buildroot}%{_rpmconfigdir}/fileattrs/ install -m 0644 %{SOURCE17} %{buildroot}%{_rpmconfigdir}/fileattrs/
install -m 0644 %{SOURCE15} %{buildroot}%{_rpmconfigdir}/fileattrs/ install -m 0644 %{SOURCE18} %{buildroot}%{_rpmconfigdir}/fileattrs/
install -m 0644 %{SOURCE19} %{buildroot}%{_rpmconfigdir}/fileattrs/
mkdir -p %{buildroot}%{_datadir}/mingw mkdir -p %{buildroot}%{_datadir}/mingw
install -m 0644 %{SOURCE11} %{buildroot}%{_datadir}/mingw/ install -m 0644 %{SOURCE13} %{buildroot}%{_datadir}/mingw/
install -m 0644 %{SOURCE12} %{buildroot}%{_datadir}/mingw/ install -m 0644 %{SOURCE14} %{buildroot}%{_datadir}/mingw/
install -m 0644 %{SOURCE18} %{buildroot}%{_datadir}/mingw/ install -m 0644 %{SOURCE15} %{buildroot}%{_datadir}/mingw/
install -m 0644 %{SOURCE19} %{buildroot}%{_datadir}/mingw/ install -m 0644 %{SOURCE20} %{buildroot}%{_datadir}/mingw/
install -m 0644 %{SOURCE21} %{buildroot}%{_datadir}/mingw/
install -m 0644 %{SOURCE22} %{buildroot}%{_datadir}/mingw/
mkdir -p %{buildroot}%{pkgconfig_personalitydir} mkdir -p %{buildroot}%{pkgconfig_personalitydir}
install -m 0644 %{SOURCE20} %{buildroot}%{pkgconfig_personalitydir}/i686-w64-mingw32.personality install -m 0644 %{SOURCE23} %{buildroot}%{pkgconfig_personalitydir}/i686-w64-mingw32.personality
install -m 0644 %{SOURCE21} %{buildroot}%{pkgconfig_personalitydir}/x86_64-w64-mingw32.personality install -m 0644 %{SOURCE24} %{buildroot}%{pkgconfig_personalitydir}/x86_64-w64-mingw32.personality
install -m 0644 %{SOURCE25} %{buildroot}%{pkgconfig_personalitydir}/x86_64-w64-mingw32ucrt.personality
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
install -m 0644 %{SOURCE26} %{buildroot}%{_sysconfdir}/ld.so.conf.d/mingw32-hostlib.conf
install -m 0644 %{SOURCE27} %{buildroot}%{_sysconfdir}/ld.so.conf.d/mingw64-hostlib.conf
# Link mingw-pkg-config man pages to pkgconf(1) # Link mingw-pkg-config man pages to pkgconf(1)
mkdir -p %{buildroot}%{_mandir}/man1/ mkdir -p %{buildroot}%{_mandir}/man1/
echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/i686-w64-mingw32-pkg-config.1 echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/i686-w64-mingw32-pkg-config.1
echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/x86_64-w64-mingw32-pkg-config.1 echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/x86_64-w64-mingw32-pkg-config.1
echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/x86_64-w64-mingw32ucrt-pkg-config.1
%files base %files base
@ -325,13 +313,15 @@ echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/x86_64-w64-mingw32-pkg-c
%{_bindir}/mingw32-meson %{_bindir}/mingw32-meson
%{_bindir}/mingw32-pkg-config %{_bindir}/mingw32-pkg-config
%{_bindir}/i686-w64-mingw32-pkg-config %{_bindir}/i686-w64-mingw32-pkg-config
%{_mandir}/man1/i686-w64-mingw32-pkg-config.1*
%{_prefix}/i686-w64-mingw32 %{_prefix}/i686-w64-mingw32
%{_rpmconfigdir}/fileattrs/mingw32.attr %{_rpmconfigdir}/fileattrs/mingw32.attr
%{_datadir}/mingw/toolchain-mingw32.cmake %{_datadir}/mingw/toolchain-mingw32.cmake
%{_datadir}/mingw/toolchain-mingw32.meson %{_datadir}/mingw/toolchain-mingw32.meson
%{pkgconfig_personalitydir}/i686-w64-mingw32.personality %{pkgconfig_personalitydir}/i686-w64-mingw32.personality
%{_mandir}/man1/i686-w64-mingw32-pkg-config.1* %{_mandir}/man1/i686-w64-mingw32-pkg-config.1*
%{_sysconfdir}/ld.so.conf.d/mingw32-hostlib.conf
%dir %{_prefix}/lib/debug/%{_prefix}
%dir %{_prefix}/lib/debug/%{_prefix}/i686-w64-mingw32
%files -n mingw64-filesystem %files -n mingw64-filesystem
@ -343,16 +333,40 @@ echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/x86_64-w64-mingw32-pkg-c
%{_bindir}/mingw64-meson %{_bindir}/mingw64-meson
%{_bindir}/mingw64-pkg-config %{_bindir}/mingw64-pkg-config
%{_bindir}/x86_64-w64-mingw32-pkg-config %{_bindir}/x86_64-w64-mingw32-pkg-config
%{_mandir}/man1/x86_64-w64-mingw32-pkg-config.1*
%{_prefix}/x86_64-w64-mingw32 %{_prefix}/x86_64-w64-mingw32
%{_rpmconfigdir}/fileattrs/mingw64.attr %{_rpmconfigdir}/fileattrs/mingw64.attr
%{_datadir}/mingw/toolchain-mingw64.cmake %{_datadir}/mingw/toolchain-mingw64.cmake
%{_datadir}/mingw/toolchain-mingw64.meson %{_datadir}/mingw/toolchain-mingw64.meson
%{pkgconfig_personalitydir}/x86_64-w64-mingw32.personality %{pkgconfig_personalitydir}/x86_64-w64-mingw32.personality
%{_mandir}/man1/x86_64-w64-mingw32-pkg-config.1* %{_mandir}/man1/x86_64-w64-mingw32-pkg-config.1*
%{_sysconfdir}/ld.so.conf.d/mingw64-hostlib.conf
%dir %{_prefix}/lib/debug/%{_prefix}
%dir %{_prefix}/lib/debug/%{_prefix}/x86_64-w64-mingw32
%files -n ucrt64-filesystem
%{macrosdir}/macros.ucrt64
%config(noreplace) %{_sysconfdir}/profile.d/ucrt64.sh
%{_bindir}/ucrt64-configure
%{_bindir}/ucrt64-cmake
%{_bindir}/ucrt64-make
%{_bindir}/ucrt64-meson
%{_bindir}/ucrt64-pkg-config
%{_bindir}/x86_64-w64-mingw32ucrt-pkg-config
%{_prefix}/x86_64-w64-mingw32ucrt
%{_rpmconfigdir}/fileattrs/ucrt64.attr
%{_datadir}/mingw/toolchain-ucrt64.cmake
%{_datadir}/mingw/toolchain-ucrt64.meson
%{pkgconfig_personalitydir}/x86_64-w64-mingw32ucrt.personality
%{_mandir}/man1/x86_64-w64-mingw32ucrt-pkg-config.1*
%dir %{_prefix}/lib/debug/%{_prefix}
%dir %{_prefix}/lib/debug/%{_prefix}/x86_64-w64-mingw32ucrt
%changelog %changelog
* Fri May 10 2022 Richard W.M. Jones <rjones@redhat.com> - 136-1
- Rebase to Fedora Rawhide
resolves: rhbz#2080168
* Sat Apr 23 2022 Konstantin Kostiuk <kkostiuk@redhat.com> * Sat Apr 23 2022 Konstantin Kostiuk <kkostiuk@redhat.com>
- Fix file conflicts with mingw-pkg-config - Fix file conflicts with mingw-pkg-config
Related: rhbz#2031784 Related: rhbz#2031784

View File

@ -23,20 +23,24 @@ do
esac esac
echo extracting debug info from $f echo extracting debug info from $f
mingw-objcopy --only-keep-debug $f $f.debug || : dest=${RPM_BUILD_ROOT}/usr/lib/debug${f/$RPM_BUILD_ROOT/}.debug
pushd `dirname $f` mkdir -p `dirname $dest`
mingw-objcopy --only-keep-debug $f $dest || :
pushd `dirname $dest`
keep_symbols=`mktemp` keep_symbols=`mktemp`
mingw-nm $f.debug --format=sysv --defined-only | awk -F \| '{ if ($4 ~ "Function") print $1 }' | sort > "$keep_symbols" mingw-nm $dest --format=sysv --defined-only | awk -F \| '{ if ($4 ~ "Function") print $1 }' | sort > "$keep_symbols"
mingw-objcopy --add-gnu-debuglink=`basename $f.debug` --strip-unneeded `basename $f` --keep-symbols="$keep_symbols" || : mingw-objcopy --add-gnu-debuglink=`basename $dest` --strip-unneeded $f --keep-symbols="$keep_symbols" || :
rm -f "$keep_symbols" rm -f "$keep_symbols"
popd popd
done done
for target in $@; do for target in $@; do
prefix=`rpm --eval "%{_prefix}/%{${target}_target}"` prefix=`rpm --eval "%{_prefix}/%{${target}_target}"`
if [ ! -d $RPM_BUILD_ROOT$prefix ] ; then if [ ! -d ${RPM_BUILD_ROOT}/usr/lib/debug/$prefix ] ; then
continue continue
fi fi
find $RPM_BUILD_ROOT$prefix -type f -name "*.exe.debug" -or -name "*.dll.debug" -or -name "*.pyd.debug" | find ${RPM_BUILD_ROOT}/usr/lib/debug/$prefix -type f -name "*.exe.debug" -or -name "*.dll.debug" -or -name "*.pyd.debug" |
sed -n -e "s#^$RPM_BUILD_ROOT##p" > $BUILDDIR/${target}-debugfiles.list sed -n -e "s#^$RPM_BUILD_ROOT##p" > $BUILDDIR/${target}-debugfiles.list
find ${RPM_BUILD_ROOT}/usr/lib/debug/$prefix/* -type d |
sed -n -e "s#^$RPM_BUILD_ROOT#%dir #p" >> $BUILDDIR/${target}-debugfiles.list
done done

View File

@ -26,6 +26,8 @@ if [ "`basename $0`" = "i686-w64-mingw32-pkg-config" ] ; then
NAME="mingw32_pkg_config" NAME="mingw32_pkg_config"
elif [ "`basename $0`" = "x86_64-w64-mingw32-pkg-config" ] ; then elif [ "`basename $0`" = "x86_64-w64-mingw32-pkg-config" ] ; then
NAME="mingw64_pkg_config" NAME="mingw64_pkg_config"
elif [ "`basename $0`" = "x86_64-w64-mingw32ucrt-pkg-config" ] ; then
NAME="ucrt64_pkg_config"
else else
NAME="`basename $0|tr -- - _`" NAME="`basename $0|tr -- - _`"
fi fi
@ -37,9 +39,12 @@ if [[ $NAME == *cmake* ]] ; then
MINGW32_CXXFLAGS=${MINGW32_CXXFLAGS:-""} MINGW32_CXXFLAGS=${MINGW32_CXXFLAGS:-""}
MINGW64_CFLAGS=${MINGW64_CFLAGS:-""} MINGW64_CFLAGS=${MINGW64_CFLAGS:-""}
MINGW64_CXXFLAGS=${MINGW64_CXXFLAGS:-""} MINGW64_CXXFLAGS=${MINGW64_CXXFLAGS:-""}
UCRT64_CFLAGS=${UCRT64_CFLAGS:-""}
UCRT64_CXXFLAGS=${UCRT64_CXXFLAGS:-""}
fi fi
# NOTE: The use of 'eval' in combination with '$@' is a potential security risk # NOTE: The use of 'eval' in combination with '$@' in the evaluated rpm macro is
# a potential security risk.
# We should find a more safe replacement for this command # We should find a more safe replacement for this command
# Suggestions are welcome at the Fedora MinGW mailing list # Suggestions are welcome at the Fedora MinGW mailing list
eval "MINGW_CMAKE_NO_VERBOSE=1 `rpm --eval "%{$NAME}"`" '"$@"' eval "MINGW_CMAKE_NO_VERBOSE=1 `rpm --eval "%{$NAME}"`"

24
mingw.prov Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
# This script reads filenames from STDIN and outputs any relevant provides
# information that needs to be included in the package.
targets=$@
if [ -z "$targets" ] ; then
echo "Usage: $0 [ mingw32 ] [ mingw64 ] [ ucrt64 ]"
exit 1
fi
filelist=`sed "s/['\"]/\\\&/g"`
dlls=$(echo $filelist | tr '[:blank:]' '\n' | grep '\.dll$')
for f in $dlls; do
basename=`basename $f | tr '[:upper:]' '[:lower:]'`
for target in $targets; do
host_triplet=`rpm --eval "%{${target}_target}"`
[[ $f =~ .*$host_triplet.* ]] && echo "$target($basename)"
done
done
exit 0

53
mingw.req Executable file
View File

@ -0,0 +1,53 @@
#!/bin/bash
# This script reads filenames from STDIN and outputs any relevant provides
# information that needs to be included in the package.
[ -z "$OBJDUMP" ] && OBJDUMP=mingw-objdump
targets=$@
if [ -z "$targets" ] ; then
echo "Usage: $0 [ mingw32 ] [ mingw64 ] [ ucrt64 ]"
exit 1
fi
# Get the list of files.
filelist=`sed "s/['\"]/\\\&/g"`
dlls=$(echo $filelist | tr '[:blank:]' '\n' | grep -Ei '\.(dll|exe|pyd)$')
pkgconfig_files=$(echo $filelist | tr '[:blank:]' '\n' | grep -Ei '\.(pc)$')
for target in $targets; do
dll_found=false
host_triplet=`rpm --eval "%{${target}_target}"`
libdir=`rpm --eval "%{${target}_libdir}"`
for f in $dlls; do
if [[ $f =~ .*$host_triplet.* ]]; then
$OBJDUMP -p $f | grep 'DLL Name' | grep -Eio '[-._\+[:alnum:]]+\.dll' |
tr '[:upper:]' '[:lower:]' |
sed "s/\(.*\)/$target(\1)/"
dll_found=true
fi
done
# Add a dependency on filesystem and crt if necessary
if [ $dll_found = true ]; then
echo "${target}-filesystem >= 95"
echo "${target}-crt"
fi
# Add a dependency on $target-pkg-config if necessary
pkgconfig_files_found=false
for f in $pkgconfig_files; do
if [[ $f =~ .*$host_triplet.* ]]; then
pkgconfig_files_found=true
break
fi
done
if [ $pkgconfig_files_found = true ]; then
echo "${target}-pkg-config"
fi
done | sort -u

1
mingw32-hostlib.conf Normal file
View File

@ -0,0 +1 @@
/usr/i686-w64-mingw32/lib/

View File

@ -1,3 +1,3 @@
%__mingw32_provides %{_rpmconfigdir}/mingw-find-provides.sh mingw32 %__mingw32_provides %{_rpmconfigdir}/mingw.prov mingw32
%__mingw32_requires %{_rpmconfigdir}/mingw-find-requires.sh mingw32 %__mingw32_requires %{_rpmconfigdir}/mingw.req mingw32
%__mingw32_path ^%{mingw32_prefix}/.*\.([Dd][Ll][Ll]|[Ee][Xx][Ee])$ %__mingw32_path ^%{mingw32_prefix}/.*\.([Dd][Ll][Ll]|[Ee][Xx][Ee]|[Pp][Yy][Dd]?|[Pp][Cc])$

1
mingw64-hostlib.conf Normal file
View File

@ -0,0 +1 @@
/usr/x86_64-w64-mingw32/lib/

View File

@ -1,3 +1,3 @@
%__mingw64_provides %{_rpmconfigdir}/mingw-find-provides.sh mingw64 %__mingw64_provides %{_rpmconfigdir}/mingw.prov mingw64
%__mingw64_requires %{_rpmconfigdir}/mingw-find-requires.sh mingw64 %__mingw64_requires %{_rpmconfigdir}/mingw.req mingw64
%__mingw64_path ^%{mingw64_prefix}/.*\.([Dd][Ll][Ll]|[Ee][Xx][Ee])$ %__mingw64_path ^%{mingw64_prefix}/.*\.([Dd][Ll][Ll]|[Ee][Xx][Ee]|[Pp][Yy][Dd]?|[Pp][Cc])$

View File

@ -0,0 +1,6 @@
# MinGW UCRT 64-bit x86 Windows target
Triplet: x86_64-w64-mingw32ucrt
SysrootDir: /usr/x86_64-w64-mingw32ucrt/sys-root/mingw
DefaultSearchPaths: /usr/x86_64-w64-mingw32ucrt/sys-root/mingw/lib/pkgconfig:/usr/x86_64-w64-mingw32ucrt/sys-root/mingw/share/pkgconfig
SystemIncludePaths: /usr/x86_64-w64-mingw32ucrt/sys-root/mingw/include
SystemLibraryPaths: /usr/x86_64-w64-mingw32ucrt/sys-root/mingw/lib

View File

@ -2,8 +2,15 @@ SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_PROCESSOR x86) SET(CMAKE_SYSTEM_PROCESSOR x86)
# specify the cross compiler # specify the cross compiler
SET(CMAKE_C_COMPILER /usr/bin/i686-w64-mingw32-gcc) IF(NOT DEFINED ENV{CC})
SET(CMAKE_CXX_COMPILER /usr/bin/i686-w64-mingw32-g++) SET(CMAKE_C_COMPILER /usr/bin/i686-w64-mingw32-gcc)
ENDIF()
IF(NOT DEFINED ENV{CXX})
SET(CMAKE_CXX_COMPILER /usr/bin/i686-w64-mingw32-g++)
ENDIF()
IF(NOT DEFINED ENV{FC})
SET(CMAKE_Fortran_COMPILER /usr/bin/i686-w64-mingw32-gfortran)
ENDIF()
# where is the target environment # where is the target environment
SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32/sys-root/mingw) SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32/sys-root/mingw)
@ -18,10 +25,13 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(QT_BINARY_DIR /usr/i686-w64-mingw32/bin /usr/bin) SET(QT_BINARY_DIR /usr/i686-w64-mingw32/bin /usr/bin)
# set the resource compiler (RHBZ #652435) # set the resource compiler (RHBZ #652435)
SET(CMAKE_RC_COMPILER /usr/bin/i686-w64-mingw32-windres) IF(NOT $ENV{RC})
SET(CMAKE_RC_COMPILER /usr/bin/i686-w64-mingw32-windres)
ENDIF()
# These are needed for compiling lapack (RHBZ #753906) # These are needed for compiling lapack (RHBZ #753906)
SET(CMAKE_Fortran_COMPILER /usr/bin/i686-w64-mingw32-gfortran)
SET(CMAKE_AR:FILEPATH /usr/bin/i686-w64-mingw32-ar) SET(CMAKE_AR:FILEPATH /usr/bin/i686-w64-mingw32-ar)
SET(CMAKE_RANLIB:FILEPATH /usr/bin/i686-w64-mingw32-ranlib) SET(CMAKE_RANLIB:FILEPATH /usr/bin/i686-w64-mingw32-ranlib)
# Workaround failure to detect boost (see #2037724)
SET(Boost_ARCHITECTURE "-x32")

View File

@ -1,7 +1,7 @@
[binaries] [binaries]
c = '/usr/bin/i686-w64-mingw32-gcc' c = 'i686-w64-mingw32-gcc'
cpp = '/usr/bin/i686-w64-mingw32-g++' cpp = 'i686-w64-mingw32-g++'
fortran = '/usr/bin/i686-w64-mingw32-gfortran' fortran = 'i686-w64-mingw32-gfortran'
rust = ['rustc', '--target', 'i686-pc-windows-msvc', '-C', 'linker=/usr/bin/i686-w64-mingw32-gcc'] rust = ['rustc', '--target', 'i686-pc-windows-msvc', '-C', 'linker=/usr/bin/i686-w64-mingw32-gcc']
ar = '/usr/bin/i686-w64-mingw32-ar' ar = '/usr/bin/i686-w64-mingw32-ar'
pkgconfig = '/usr/bin/i686-w64-mingw32-pkg-config' pkgconfig = '/usr/bin/i686-w64-mingw32-pkg-config'

View File

@ -2,8 +2,15 @@ SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_PROCESSOR x86_64) SET(CMAKE_SYSTEM_PROCESSOR x86_64)
# specify the cross compiler # specify the cross compiler
SET(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc) IF(NOT DEFINED ENV{CC})
SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++) SET(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc)
ENDIF()
IF(NOT DEFINED ENV{CXX})
SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++)
ENDIF()
IF(NOT DEFINED ENV{FC})
SET(CMAKE_Fortran_COMPILER /usr/bin/x86_64-w64-mingw32-gfortran)
ENDIF()
# where is the target environment # where is the target environment
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32/sys-root/mingw) SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32/sys-root/mingw)
@ -18,10 +25,13 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(QT_BINARY_DIR /usr/x86_64-w64-mingw32/bin /usr/bin) SET(QT_BINARY_DIR /usr/x86_64-w64-mingw32/bin /usr/bin)
# set the resource compiler (RHBZ #652435) # set the resource compiler (RHBZ #652435)
SET(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32-windres) IF(NOT $ENV{RC})
SET(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32-windres)
ENDIF()
# These are needed for compiling lapack (RHBZ #753906) # These are needed for compiling lapack (RHBZ #753906)
SET(CMAKE_Fortran_COMPILER /usr/bin/x86_64-w64-mingw32-gfortran)
SET(CMAKE_AR:FILEPATH /usr/bin/x86_64-w64-mingw32-ar) SET(CMAKE_AR:FILEPATH /usr/bin/x86_64-w64-mingw32-ar)
SET(CMAKE_RANLIB:FILEPATH /usr/bin/x86_64-w64-mingw32-ranlib) SET(CMAKE_RANLIB:FILEPATH /usr/bin/x86_64-w64-mingw32-ranlib)
# Workaround failure to detect boost (see #2037724)
SET(Boost_ARCHITECTURE "-x64")

View File

@ -1,7 +1,7 @@
[binaries] [binaries]
c = '/usr/bin/x86_64-w64-mingw32-gcc' c = 'x86_64-w64-mingw32-gcc'
cpp = '/usr/bin/x86_64-w64-mingw32-g++' cpp = 'x86_64-w64-mingw32-g++'
fortran = '/usr/bin/x86_64-w64-mingw32-gfortran' fortran = 'x86_64-w64-mingw32-gfortran'
rust = ['rustc', '--target', 'x86_64-pc-windows-msvc', '-C', 'linker=/usr/bin/x86_64-w64-mingw32-gcc'] rust = ['rustc', '--target', 'x86_64-pc-windows-msvc', '-C', 'linker=/usr/bin/x86_64-w64-mingw32-gcc']
ar = '/usr/bin/x86_64-w64-mingw32-ar' ar = '/usr/bin/x86_64-w64-mingw32-ar'
pkgconfig = '/usr/bin/x86_64-w64-mingw32-pkg-config' pkgconfig = '/usr/bin/x86_64-w64-mingw32-pkg-config'

37
toolchain-ucrt64.cmake Normal file
View File

@ -0,0 +1,37 @@
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_PROCESSOR x86_64)
# specify the cross compiler
IF(NOT DEFINED ENV{CC})
SET(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32ucrt-gcc)
ENDIF()
IF(NOT DEFINED ENV{CXX})
SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32ucrt-g++)
ENDIF()
IF(NOT DEFINED ENV{FC})
SET(CMAKE_Fortran_COMPILER /usr/bin/x86_64-w64-mingw32ucrt-gfortran)
ENDIF()
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32ucrt/sys-root/mingw)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# Make sure Qt can be detected by CMake
SET(QT_BINARY_DIR /usr/x86_64-w64-mingw32ucrt/bin /usr/bin)
# set the resource compiler (RHBZ #652435)
IF(NOT $ENV{RC})
SET(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32ucrt-windres)
ENDIF()
# These are needed for compiling lapack (RHBZ #753906)
SET(CMAKE_AR:FILEPATH /usr/bin/x86_64-w64-mingw32ucrt-ar)
SET(CMAKE_RANLIB:FILEPATH /usr/bin/x86_64-w64-mingw32ucrt-ranlib)
# Workaround failure to detect boost (see #2037724)
SET(Boost_ARCHITECTURE "-x64")

22
toolchain-ucrt64.meson Normal file
View File

@ -0,0 +1,22 @@
[binaries]
c = 'x86_64-w64-mingw32ucrt-gcc'
cpp = 'x86_64-w64-mingw32ucrt-g++'
fortran = 'x86_64-w64-mingw32ucrt-gfortran'
rust = ['rustc', '--target', 'x86_64-pc-windows-msvc', '-C', 'linker=/usr/bin/x86_64-w64-mingw32ucrt-gcc']
ar = '/usr/bin/x86_64-w64-mingw32ucrt-ar'
pkgconfig = '/usr/bin/x86_64-w64-mingw32ucrt-pkg-config'
ranlib = '/usr/bin/x86_64-w64-mingw32ucrt-ranlib'
strip = '/usr/bin/x86_64-w64-mingw32ucrt-strip'
windres = '/usr/bin/x86_64-w64-mingw32ucrt-windres'
dlltool = '/usr/bin/x86_64-w64-mingw32ucrt-dlltool'
libgcrypt-config = '/usr/x86_64-w64-mingw32ucrt/sys-root/mingw/bin/libgcrypt-config'
[properties]
root = '/usr/x86_64-w64-mingw32ucrt/sys-root/mingw'
needs_exe_wrapper = true
[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'

3
ucrt64.attr Normal file
View File

@ -0,0 +1,3 @@
%__ucrt64_provides %{_rpmconfigdir}/mingw.prov ucrt64
%__ucrt64_requires %{_rpmconfigdir}/mingw.req ucrt64
%__ucrt64_path ^%{ucrt64_prefix}/.*\.([Dd][Ll][Ll]|[Ee][Xx][Ee]|[Pp][Yy][Dd]?|[Pp][Cc])$

3
ucrt64.sh Normal file
View File

@ -0,0 +1,3 @@
# Environment variables for cross compilers.
alias ucrt64-env='eval `rpm --eval %{ucrt64_env}`'