diff --git a/macros.mingw64 b/macros.mingw64 index 02a742f..80db3a0 100644 --- a/macros.mingw64 +++ b/macros.mingw64 @@ -28,7 +28,7 @@ %_mingw64_cxxflags %{_mingw64_cflags} %_mingw64_ldflags_base -Wl,--exclude-libs=libintl.a -Wl,--exclude-libs=libiconv.a -Wl,--no-keep-memory -# used for bootstrap packages +# for bootstrap packages %_mingw64_ldflags_bootstrap %{_mingw64_ldflags_base} # for normal packages %_mingw64_ldflags %{_mingw64_ldflags_base} -fstack-protector @@ -61,7 +61,8 @@ %_mingw64_cache mingw64-config.cache -# setup rpmbuild hooks +# +# Experimental import library scanning support: # # To provide project wide import library scanning add this to project config # Macros: @@ -71,16 +72,23 @@ # %global _mingw64_find_requires_scan_implibs 1 # to the related spec file # + +# +# Support to exclude shared libraries from generating runtime dependencies +# # To exclude project wide shared library requirements add this to project config # Macros: -# %_mingw64_find_requires_exclude d3d12 ... [%{nil}] +# %_mingw64_find_requires_exclude d3d12 ... [%{nil}] # :Macros # for a single package add # %global _mingw64_find_requires_exclude d3d12 ... [%{nil}] # to the related spec file # -%_mingw64_findprovides /usr/lib/rpm/mingw64-find-provides.sh -%_mingw64_findrequires /usr/lib/rpm/mingw64-find-requires.sh %{?_mingw64_find_requires_exclude:--exclude "%_mingw64_find_requires_exclude"} %{?_mingw64_find_requires_scan_implibs:--scan-implibs} +# see mingw64_*.attr for details + +# +# setup rpmbuild hooks +# %_mingw64_install_post /usr/lib/rpm/mingw64-install-post.sh %_mingw64_find_lang /usr/lib/rpm/mingw64-find-lang.sh %{buildroot} @@ -88,7 +96,7 @@ /usr/lib/rpm/mingw64-find-debuginfo.sh %{_builddir} 1\ %{nil} -# Template for debug sub-package. +# Template for combined debuginfo and debugsource sub-package. %_mingw64_debug_package(n:) \ %package %{-n:-n %{-n*}-}debug \ Summary: Debug information for package %{name} \ @@ -148,9 +156,6 @@ package or when debugging this package.\ %_mingw64_package_header \ %global __strip %{_mingw64_strip} \ %global __objdump %{_mingw64_objdump} \ - %global _use_internal_dependency_generator 0 \ - %global __find_requires %{_mingw64_findrequires} \ - %global __find_provides %{_mingw64_findprovides} \ %global __os_install_post %{_mingw64_install_post} # this macro also disables the default debug package @@ -158,9 +163,6 @@ package or when debugging this package.\ %global debug_package %{nil} \ %global __strip %{_mingw64_strip} \ %global __objdump %{_mingw64_objdump} \ - %global _use_internal_dependency_generator 0 \ - %global __find_requires %{_mingw64_findrequires} \ - %global __find_provides %{_mingw64_findprovides} \ %global __os_install_post %{_mingw64_debug_install_post} \\\ %{_mingw64_install_post} @@ -218,8 +220,10 @@ package or when debugging this package.\ install # deprecated, use _mingw64_make_install (unix variant is named %make_install) -%_mingw64_makeinstall %_mingw64_make_install +%_mingw64_makeinstall \ + echo "Deprecated %%_mingw64_makeinstall macro used, please use %%_mingw64_make_install" \ + %_mingw64_make_install -# requires installed packaged wine and mingw64-gdb +# requires installed packages wine and mingw64-gdb %_mingw64_gdb %{_mingw64_env} ; \ wineconsole %{_mingw64_bindir}/gdb.exe diff --git a/macros.mingw64-cmake b/macros.mingw64-cmake index eff7fc1..348d7ef 100644 --- a/macros.mingw64-cmake +++ b/macros.mingw64-cmake @@ -1,6 +1,15 @@ -# internal macro used by related filesystem packages -%__mingw64_cmake %{_mingw64_env} ; \ - cmake \\\ +# +# Macros for cmake for mingw64 +# +# depends on macros.cmake +# +%__cmake_generator %{lua: if rpm.expand("%__builder") == rpm.expand("%__make") then print("-G'Unix Makefiles'") else print("-GNinja") end} + +%_mingw64_cmake %{_mingw64_env} ; \ + mkdir -p %__builddir \ + cd %__builddir \ + %__cmake $OLDPWD/%__sourcedir \\\ + %__cmake_generator \\\ -DCMAKE_SYSTEM_NAME="Windows" \\\ -DCMAKE_VERBOSE_MAKEFILE=ON \\\ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \\\ @@ -22,10 +31,17 @@ -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \\\ -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER -# cmake > 3.13.1 requires setting source dir -%_mingw64_cmake %{__mingw64_cmake} . +%__mingw64_cmake \ + echo "Deprecated %%__mingw64_cmake macro used, please use %%_mingw64_cmake" \ + %{_mingw64_cmake} %_mingw64_cmake_build %cmake_build -%_mingw64_cmake_install %{_mingw64_env} ; \ - make VERBOSE=1 DESTDIR=%{buildroot} install/fast +%_mingw64_cmake_install %{_mingw64_env}; \ + %cmake_install + +%_mingw64_ctest(:-:) \ + cd %__builddir \ + %__ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags} %** \ + cd $OLDPWD + \ No newline at end of file diff --git a/mingw64-cmake.attr b/mingw64-cmake.attr deleted file mode 100644 index a1f6b5b..0000000 --- a/mingw64-cmake.attr +++ /dev/null @@ -1,2 +0,0 @@ -%__mingw64_cmake_provides %{_rpmconfigdir}/mingw64-cmake.prov -%__mingw64_cmake_path ^/usr/x86_64-w64-mingw32/sys-root/mingw/lib/cmake/.*/.*(Config\.cmake|-config\.cmake)$ \ No newline at end of file diff --git a/mingw64-filesystem.changes b/mingw64-filesystem.changes index 2e8e3b5..cd0b9de 100644 --- a/mingw64-filesystem.changes +++ b/mingw64-filesystem.changes @@ -1,3 +1,23 @@ +------------------------------------------------------------------- +Thu Feb 16 12:31:06 UTC 2023 - Ralf Habacker + +- Update to version 20230309 + * Let cmake macros be based on associated macros from macros.cmake + * Add support to define a custom rpm macro when running mingw64 + related shell scripts, see mingw64-scripts.sh for details + * Drop using external dependency generator (boo#1175587) + * Add mingw64_*.attr files to support actual used dependency generator + * Fix bug that rpm does not use attribute file for cmake by renaming + to mingw64_cmake.attr (rpm does not like '-' in those file name + and keys inside) + * Extend mingw64_cmake.attr to find cmake support files in + share subdirectory as required for example by mingw64-dlfcn-win32 + * Print deprecated message when using %_mingw64_makeinstall or + %__mingw64_cmake + * Reduce some differences to mingw32 in changes and other files, + which are mostly indentions, hours, trailing '/', variable + definition rows - make it easier to compare + ------------------------------------------------------------------- Mon Nov 14 08:20:48 UTC 2022 - Ralf Habacker @@ -6,7 +26,7 @@ Mon Nov 14 08:20:48 UTC 2022 - Ralf Habacker * Change dependency to mingw64-cross-binutils-utils and mingw64-cross-pkgconf-utils to avoid cyclic dependencies (boo#1204985) ------------------------------------------------------------------- +------------------------------------------------------------------- Mon Aug 29 10:17:22 UTC 2022 - Ralf Habacker - Fix generating invalid source file path when scanning binaries @@ -32,14 +52,14 @@ Thu Jul 28 15:22:52 UTC 2022 - Ralf Habacker * Added the script 'mingw-objdump-srcfiles' to determine the source files used by the package in question. * The gawk script is based on a perl script from jengelh, which was - not adopted due to an additional runtime dependency. + not adopted due to an additional runtime dependency * With this change, *.sym files are no longer included in generated - debug packages. + debug packages * The now obsolete runtime dependency to mingw64-cross-breakpad-tools has been removed -- Exclude 'mlang.dll' from automatic runtime library detection required - for win_iconv package -- Fix spelling in *.changes +- Exclude 'mlang.dll' and other dll's from automatic runtime library + detection required for win_iconv and libqt5 packages +- Fix spelling in *.changes ------------------------------------------------------------------- Thu Jul 28 09:03:20 UTC 2022 - Ralf Habacker @@ -77,7 +97,7 @@ Sun Jun 5 05:03:17 UTC 2022 - Ralf Habacker - Add optional support for excluding runtime DLL dependencies to avoid rebuilding the whole project, see macro %_mingw64_find_requires_exclude in macros.mingw64 for details - + ------------------------------------------------------------------- Mon May 23 13:58:15 UTC 2022 - Ralf Habacker @@ -90,7 +110,7 @@ Mon May 23 13:58:15 UTC 2022 - Ralf Habacker when parsing xxx-config files ------------------------------------------------------------------- -Thu Dec 2 14:04:48 UTC 2021 - Dominique Leuenberger +Thu Dec 2 14:06:40 UTC 2021 - Dominique Leuenberger - Change all version comparisons for Tumbleweed to >= 1550 (instead of == 1550). Anything in Tumbleweed counts for current Tumbleweed @@ -115,7 +135,7 @@ Tue Sep 14 06:39:03 UTC 2021 - Fridrich Strba ------------------------------------------------------------------- Wed Jul 28 06:04:17 UTC 2021 - Ralf Habacker -- Add provides for bcrypt.dll required by mingw64-gdb 10.2 +- Add provides for bcrypt.dll required by mingw64-gdb 10.2 ------------------------------------------------------------------- Mon Jul 12 14:30:26 UTC 2021 - Ralf Habacker @@ -135,14 +155,9 @@ Thu Nov 5 10:38:47 UTC 2020 - Ralf Habacker - Update to 20201105 - Add macro _mingw64_create_macro_links - Add macro _mingw64_gdb and command line wrapper /usr/bin/mingw64-gdb -- In mingw64-scripts support rpm macro processing to +- In mingw64-scripts support rpm macro processing according to https://rpm.org/user_doc/macros.htm -------------------------------------------------------------------- -Sun Nov 1 10:38:47 UTC 2020 - Ralf Habacker - -- Add macro _mingw64_gdb and command line wrapper /usr/bin/mingw64-gdb - ------------------------------------------------------------------- Sat Oct 17 14:32:20 UTC 2020 - Ralf Habacker @@ -194,7 +209,7 @@ Sun Apr 19 17:39:26 UTC 2020 - Bernhard Wiedemann - Process debuginfo in a reproducible way (boo#1041090) ------------------------------------------------------------------- -Wed Dec 18 21:49:44 UTC 2019 - Martin Koegler +Wed Dec 18 21:49:04 UTC 2019 - Martin Koegler - Revert -lssp @@ -216,6 +231,11 @@ Mon Nov 25 05:05:10 UTC 2019 - Ismail Dönmez - Add -fstack-protector to LDFLAGS +------------------------------------------------------------------- +Sun Nov 24 21:36:08 UTC 2019 - Ralf Habacker + +- fix compile errors: undefined reference to `__memcpy_chk` + ------------------------------------------------------------------- Fri Nov 22 10:58:42 UTC 2019 - Ludwig Nussel diff --git a/mingw64-filesystem.spec b/mingw64-filesystem.spec index 797d8ef..95661c3 100644 --- a/mingw64-filesystem.spec +++ b/mingw64-filesystem.spec @@ -1,7 +1,7 @@ # # spec file for package mingw64-filesystem # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -31,7 +31,7 @@ %define _rpmmacrodir %{_sysconfdir}/rpm %endif Name: mingw64-filesystem -Version: 20221115 +Version: 20230309 Release: 0 Summary: MinGW base filesystem and environment License: GPL-2.0-or-later @@ -50,10 +50,15 @@ Source9: mingw64-find-lang.sh Source10: languages Source11: languages.man Source12: mingw64-cmake.prov -Source13: mingw64-cmake.attr +Source13: mingw64_cmake.attr Source14: macros.mingw64-cmake Source15: mingw64-filesystem-rpmlintrc Source16: mingw-objdump-srcfiles +Source17: mingw64_binaries.attr +Source18: mingw64_cmake.attr +Source19: mingw64_config.attr +Source20: mingw64_libs.attr +Source21: mingw64_pkgconfig.attr # add excluded system libraries to mingw64-find-requires.sh # TODO: The following provides could be removed after all packages has been rebuild Provides: mingw64(bcrypt.dll) @@ -114,13 +119,13 @@ install -m 755 %{SOURCE6} %{buildroot}%{_libexecdir}/mingw64-scripts # but including macros.mingw64 results into an unknown failure mkdir -p %{buildroot}%{_bindir} pushd %{buildroot}%{_bindir} -for i in mingw64-configure mingw64-make mingw64-cmake mingw64-gdb ; do +for i in mingw64-configure mingw64-make mingw64-cmake mingw64-gdb; do ln -s %{_libexecdir}/mingw64-scripts $i done popd mkdir -p %{buildroot}%{_distconfdir}/profile.d -install -m 644 %{SOURCE2} %{buildroot}%{_distconfdir}/profile.d +install -m 644 %{SOURCE2} %{buildroot}%{_distconfdir}/profile.d/ mkdir -p %{buildroot}%{_rpmmacrodir} install -m 644 %{SOURCE1} %{buildroot}%{_rpmmacrodir}/macros.mingw64 @@ -182,11 +187,16 @@ install -m 0755 %{SOURCE4} %{buildroot}%{_rpmconfigdir} install -m 0755 %{SOURCE5} %{buildroot}%{_rpmconfigdir} install -m 0755 %{SOURCE8} %{buildroot}%{_rpmconfigdir} install -m 0755 %{SOURCE9} %{buildroot}%{_rpmconfigdir} - # cmake support install -m 0755 %{SOURCE12} %{buildroot}%{_rpmconfigdir} mkdir -p %{buildroot}%{_fileattrsdir} install -m 0644 %{SOURCE13} %{buildroot}%{_fileattrsdir} +# dependency generator support +install -m 0644 %{SOURCE17} %{buildroot}%{_fileattrsdir} +install -m 0644 %{SOURCE18} %{buildroot}%{_fileattrsdir} +install -m 0644 %{SOURCE19} %{buildroot}%{_fileattrsdir} +install -m 0644 %{SOURCE20} %{buildroot}%{_fileattrsdir} +install -m 0644 %{SOURCE21} %{buildroot}%{_fileattrsdir} # Create the locale directories: while read LANG ; do @@ -217,8 +227,9 @@ install -m 0755 %{SOURCE16} %{buildroot}%{_bindir}/x86_64-w64-mingw32-objdump-sr %else %_rpmlintdir/mingw64-rpmlint.config %endif -%{_rpmconfigdir}/mingw64-cmake.prov -%{_fileattrsdir}/mingw64-cmake.attr + +%{_rpmconfigdir}/mingw64-*.prov +%{_fileattrsdir}/mingw64*.attr %{_bindir}/mingw64-* %{_bindir}/x86_64-w64-mingw32-* %{_libexecdir}/mingw64-scripts diff --git a/mingw64-find-debuginfo.sh b/mingw64-find-debuginfo.sh index c13f7d5..620e93a 100644 --- a/mingw64-find-debuginfo.sh +++ b/mingw64-find-debuginfo.sh @@ -1,18 +1,21 @@ #!/bin/sh #mingw64-find-debuginfo.sh - automagically generate debug info and file list #for inclusion in an rpm spec file for mingw64-* packages. +# +# $PWD package dir below $BUILDDIR + target="mingw64" host="x86_64-w64-mingw32" +# speed up running objdump, see bug https://bugzilla.opensuse.org/show_bug.cgi?id=1202431 +export MALLOC_CHECK_=0 +export MALLOC_PERTURB_=0 + BUILDDIR=. if [ -n "$1" ]; then BUILDDIR="$1" fi -# speed up running objdump, see bug https://bugzilla.opensuse.org/show_bug.cgi?id=1202431 -export MALLOC_CHECK_=0 -export MALLOC_PERTURB_=0 - # generate separate debuginfo and debugsource or single debug package combining both if [ -n "$2" ]; then SINGLE_DEBUG_PACKAGE=1 @@ -62,7 +65,7 @@ find $RPM_BUILD_ROOT -type f \ -or -name "*.exe.mdb" \ -or -name "*.dll.mdb" \ | sort \ -| sed -n -e "s#^$RPM_BUILD_ROOT##p" >"$BUILDDIR/$target-debugfiles.list" +| sed -n -e "s#^$RPM_BUILD_ROOT##p" > $BUILDDIR/$target-debugfiles.list echo creating debugsource file structure diff --git a/mingw64-rpmlintrc b/mingw64-rpmlintrc index 4a4f953..b8466fe 100644 --- a/mingw64-rpmlintrc +++ b/mingw64-rpmlintrc @@ -1,3 +1,5 @@ +# not used on Leap 15.x for linting mingw64-filesystem package + # Unconditionally remove devel-file-in-non-devel rpmlint warning. addFilter ("^mingw64-.*devel-file-in-non-devel") diff --git a/mingw64-scripts.sh b/mingw64-scripts.sh index ba9d42a..b33aa5b 100644 --- a/mingw64-scripts.sh +++ b/mingw64-scripts.sh @@ -3,6 +3,7 @@ # mingw64-scripts # Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones. # Copyright (C) 2008 Levente Farkas +# Copyright (C) 2023 Ralf Habacker # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,7 +21,16 @@ # MA 02110-1301 USA. # This is a useful command-line script through which one can use the -# macros from mingw64-macros.mingw64 cross-compilation. +# macros from mingw64-macros.mingw64 cross-compilation. +# +# It supports the environment variable MINGW64_MACROS= to be +# able to override individual rpm macros. With +# +# MINGW64_MACROS='__cmake ~/bin/cmake' mingw64-cmake +# +# for example, the specified cmake executable is used instead of +# the internal default. NAME="_`basename $0|tr -- - _`" -eval "`rpm --eval "%${NAME} $(printf " %q" "${@}")"`" +DEFINE=${MINGW64_MACROS:+--define="${MINGW64_MACROS}"} +eval "`rpm "${DEFINE}" --eval "%${NAME} $(printf " %q" "${@}")"`" diff --git a/mingw64_binaries.attr b/mingw64_binaries.attr new file mode 100644 index 0000000..7313409 --- /dev/null +++ b/mingw64_binaries.attr @@ -0,0 +1,3 @@ +%__mingw64_binaries_provides %{_rpmconfigdir}/mingw64-find-provides.sh +%__mingw64_binaries_requires %{_rpmconfigdir}/mingw64-find-requires.sh %{?_mingw64_find_requires_exclude:--exclude "%_mingw64_find_requires_exclude"} +%__mingw64_binaries_magic PE32[+] executable diff --git a/mingw64_cmake.attr b/mingw64_cmake.attr new file mode 100644 index 0000000..e352f37 --- /dev/null +++ b/mingw64_cmake.attr @@ -0,0 +1,2 @@ +%__mingw64_cmake_provides %{_rpmconfigdir}/mingw64-cmake.prov +%__mingw64_cmake_path ^(%{_mingw64_libdir}/cmake|%{_mingw64_datadir})/.*/.*(Config\.cmake|-config\.cmake)$ diff --git a/mingw64_config.attr b/mingw64_config.attr new file mode 100644 index 0000000..2f94b2a --- /dev/null +++ b/mingw64_config.attr @@ -0,0 +1,2 @@ +%__mingw64_config_requires %{_rpmconfigdir}/mingw64-find-requires.sh %{?_mingw64_find_requires_exclude:--exclude "%_mingw64_find_requires_exclude"} +%__mingw64_config_path ^%{_mingw64_bindir}/.*config$ diff --git a/mingw64_libs.attr b/mingw64_libs.attr new file mode 100644 index 0000000..00a0ad0 --- /dev/null +++ b/mingw64_libs.attr @@ -0,0 +1,3 @@ +%__mingw64_libs_provides %{_rpmconfigdir}/mingw64-find-provides.sh +%__mingw64_libs_requires %{_rpmconfigdir}/mingw64-find-requires.sh %{?_mingw64_find_requires_exclude:--exclude "%_mingw64_find_requires_exclude"} %{?_mingw64_find_requires_scan_implibs:--scan-implibs} +%__mingw64_libs_path ^(%{_mingw64_libdir}/.*\.a)$ diff --git a/mingw64_pkgconfig.attr b/mingw64_pkgconfig.attr new file mode 100644 index 0000000..dc07990 --- /dev/null +++ b/mingw64_pkgconfig.attr @@ -0,0 +1,3 @@ +%__mingw64_pkgconfig_provides %{_rpmconfigdir}/mingw64-find-provides.sh +%__mingw64_pkgconfig_requires %{_rpmconfigdir}/mingw64-find-requires.sh %{?_mingw64_find_requires_exclude:--exclude "%_mingw64_find_requires_exclude"} +%__mingw64_pkgconfig_path ^(%{_mingw64_datadir}|%{_mingw64_libdir})/pkgconfig/.*\.pc$