From b4f52d4ebbee953d2a551a167be69888e4559594 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Wed, 16 Apr 2025 18:43:38 +0200 Subject: [PATCH] - merged 2.047 from PLD --- macros.rust | 1 + macros.tld | 59 ++++++++++++++++++++++++++++----------------- rpm-tld-macros.spec | 4 ++- 3 files changed, 41 insertions(+), 23 deletions(-) diff --git a/macros.rust b/macros.rust index 7996c4f..fad5bca 100644 --- a/macros.rust +++ b/macros.rust @@ -66,4 +66,5 @@ thumbv7neon-unknown-linux-gnueabihf\\\ %{__cargo} %{__cargo_common_opts} install \\\ --target %rust_target \\\ --target-dir %{cargo_targetdir} \\\ + --no-track \\\ %{nil} diff --git a/macros.tld b/macros.tld index c7663f3..84ed96b 100644 --- a/macros.tld +++ b/macros.tld @@ -176,8 +176,8 @@ pakietu oraz przy odpluskwianiu samego pakietu.\ %debugcppflags %{nil} %debugldflags %{nil} -%optldflags -Wl,--as-needed -Wl,--no-copy-dt-needed-entries -Wl,-z,relro -Wl,-z,combreloc %{?use_ld:-Wl,-fuse-ld=%{use_ld}} -%optcppflags %{nil} +%optldflags -Wl,--as-needed -Wl,--no-copy-dt-needed-entries -Wl,-z,relro -Wl,-z,combreloc %{?use_ld:-Wl,-fuse-ld=%{use_ld}} +%optcppflags -DNDEBUG -DQT_NO_DEBUG # common compilation flags %_fortify_cflags -Wp,-D_FORTIFY_SOURCE=2 @@ -185,9 +185,12 @@ pakietu oraz przy odpluskwianiu samego pakietu.\ # cf http://wiki.mandriva.com/en/Development/Packaging/Problems#format_not_a_string_literal_and_no_format_arguments %Werror_cflags -Wformat -Werror=format-security +# silent line truncation causes errors hard to track +%Werror_fflags -Werror=line-truncation + # Use -Werror=trampolines to prevent GCC from generating code that require executable stack %_ssp_cflags -fstack-protector-strong --param=ssp-buffer-size=4 -Werror=trampolines -%__common_cflags -O2 -fwrapv -pipe %{Werror_cflags} %{debuginfocflags} %{?_fortify_cflags} %{!?nospecflags:%{?specflags}} +%__common_cflags -O2 -fwrapv -pipe %{debuginfocflags} %{?_fortify_cflags} %{!?nospecflags:%{?specflags}} %__common_cflags_with_ssp %{__common_cflags} %{?_ssp_cflags} # arch macros @@ -319,10 +322,11 @@ pakietu oraz przy odpluskwianiu samego pakietu.\ # BuildRequires: rpmbuild(macros) >= 1.315 # # Flags specified in %filterout_* are removed from %rpm*flags, exactly: -# %rpmcflags = %optflags - %filterout - %filterout_c - %filterout_ld -# %rpmcxxflags = %optflags - %filterout - %filterout_cxx - %filterout_ld -# %rpmcppflags = %optcppflags - %filterout - %filterout_cpp - %filterout_ld -# %rpmldflags = %optldflags - %filterout_ld +# %rpmcflags = %optflags|%debufcflags %Werror_cflags - %filterout - %filterout_c - %filterout_ld +# %rpmcxxflags = %optflags|%debufcflags %Werror_cflags - %filterout - %filterout_cxx - %filterout_ld +# %rpmfflags = %optflags|%debugcflags %Werror_fflags - %filterout - %filterout_f - %filterout_ld +# %rpmcppflags = %optcppflags|%debugcppflags - %filterout - %filterout_cpp - %filterout_ld +# %rpmldflags = %optldflags|%debugldflags - %filterout_ld # # Regular expressions are supported, but to avoid some character be treated # as regular expression it must be escaped twice. @@ -336,7 +340,7 @@ pakietu oraz przy odpluskwianiu samego pakietu.\ } %rpmcflags %(awk 'BEGIN { - split("%{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags}",I); + split("%{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags} %{Werror_cflags}",I); split("%{?filterout} %{?filterout_c} %{?filterout_ld}",F); %{filter_out} }') @@ -344,12 +348,19 @@ pakietu oraz przy odpluskwianiu samego pakietu.\ %build_fflags %{rpmcflags} %{?_fmoddir:-I%{_fmoddir}} %rpmcxxflags %(awk 'BEGIN { - split("%{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags}",I); + split("%{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags} %{Werror_cflags}",I); split("%{?filterout} %{?filterout_cxx} %{?filterout_ld}",F); %{filter_out} }') %build_cxxflags %{rpmcxxflags} +%rpmfflags %(awk 'BEGIN { + split("%{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags} %{Werror_fflags}",I); + split("%{?filterout} %{?filterout_f} %{?filterout_ld}",F); + %{filter_out} +}') +%build_fflags %{rpmfflags} + %rpmcppflags %(awk 'BEGIN { split("%{?debug:%debugcppflags}%{!?debug:%optcppflags}%{?debuginfocppflags}",I); split("%{?filterout} %{?filterout_cpp} %{?filterout_cpp}",F); @@ -385,8 +396,8 @@ pakietu oraz przy odpluskwianiu samego pakietu.\ %{?__cpp:CPP="%{__cpp}" ; export CPP ; } \ CFLAGS="${CFLAGS:-%rpmcflags}" ; export CFLAGS ; \ CXXFLAGS="${CXXFLAGS:-%rpmcxxflags}" ; export CXXFLAGS ; \ - FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \ - FCFLAGS="${FCFLAGS:-%rpmcflags}" ; export FCFLAGS ; \ + FFLAGS="${FFLAGS:-%rpmfflags}" ; export FFLAGS ; \ + FCFLAGS="${FCFLAGS:-%rpmfflags}" ; export FCFLAGS ; \ CPPFLAGS="${CPPFLAGS:-%rpmcppflags}" ; export CPPFLAGS ; \ LDFLAGS="${LDFLAGS:-%rpmldflags}" ; export LDFLAGS ; \ RUSTC="${RUSTC:-%__rustc}" ; export RUSTC ; \ @@ -509,7 +520,7 @@ pakietu oraz przy odpluskwianiu samego pakietu.\ -DCMAKE_BUILD_TYPE=%{!?debug:TLD}%{?debug:Debug} \\\ -DCMAKE_SYSTEM_NAME=Linux \\\ -DCMAKE_SYSTEM_VERSION="%(uname -r)" \\\ - -DCMAKE_CROSSCOMPILING:BOOL=FALSE \\\ + -DCMAKE_CROSSCOMPILING:BOOL=OFF \\\ %ifarch x32\ -DCMAKE_SYSTEM_PROCESSOR=x86_64 \\\ %else\ @@ -532,12 +543,12 @@ pakietu oraz przy odpluskwianiu samego pakietu.\ -DCMAKE_INSTALL_DOCDIR:PATH=%{_docdir} \\\ -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\ -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\ - -DCMAKE_CXX_FLAGS_TLD="${CXXFLAGS:-%{rpmcxxflags} -DNDEBUG -DQT_NO_DEBUG}" \\\ - -DCMAKE_C_FLAGS_TLD="${CFLAGS:-%{rpmcflags} -DNDEBUG -DQT_NO_DEBUG}" \\\ - -DCMAKE_Fortran_FLAGS_TLD="${CFLAGS:-%{rpmcflags} -DNDEBUG -DQT_NO_DEBUG}" \\\ - -DCMAKE_EXE_LINKER_FLAGS_TLD="${LDFLAGS:-%{rpmldflags}}" \\\ - -DCMAKE_SHARED_LINKER_FLAGS_TLD="${LDFLAGS:-%{rpmldflags}}" \\\ - -DCMAKE_MODULE_LINKER_FLAGS_TLD="${LDFLAGS:-%{rpmldflags}}" \\\ + -DCMAKE_CXX_FLAGS_TLD="${CXXFLAGS} ${CPPFLAGS}" \\\ + -DCMAKE_C_FLAGS_TLD="${CFLAGS} ${CPPFLAGS}" \\\ + -DCMAKE_Fortran_FLAGS_TLD="${FFLAGS} ${CPPFLAGS}" \\\ + -DCMAKE_EXE_LINKER_FLAGS_TLD="${LDFLAGS}" \\\ + -DCMAKE_SHARED_LINKER_FLAGS_TLD="${LDFLAGS}" \\\ + -DCMAKE_MODULE_LINKER_FLAGS_TLD="${LDFLAGS}" \\\ %if "%{_lib}" == "lib64" \ -DLIB_SUFFIX=64 \\\ %endif \ @@ -553,7 +564,7 @@ pakietu oraz przy odpluskwianiu samego pakietu.\ LDFLAGS="${LDFLAGS:-%rpmldflags}" \ CFLAGS="${CFLAGS:-%rpmcflags}" \ CXXFLAGS="${CXXFLAGS:-%rpmcxxflags}" \ - FFLAGS="${FFLAGS:-%rpmcflags}" \ + FFLAGS="${FFLAGS:-%rpmfflags}" \ CPPFLAGS="${CPPFLAGS:-%rpmcppflags}" \ %{?__cc:CC="%{__cc}"} \ %{?__cxx:CXX="%{__cxx}"} \ @@ -608,13 +619,17 @@ LINKFLAGS="%{rpmldflags}" \ %__true_false() %{expand:%%{?with_%{1}:true}%%{!?with_%{1}:false}} %__true_false_not() %{expand:%%{?with_%{1}:false}%%{!?with_%{1}:true}} -# expands to enabled or disabled based on bcond; for use with meson or cmake (since 2.000) +# expands to enabled or disabled based on bcond; for use with meson (since 2.000) %__enabled_disabled() %{expand:%%{?with_%{1}:enabled}%%{!?with_%{1}:disabled}} %__enabled_disabled_not() %{expand:%%{?with_%{1}:disabled}%%{!?with_%{1}:enabled}} -# for use with cmake: +# expands to enabled or disabled based on bcond; for use with cmake (since 2.047) +%__ON_OFF() %{expand:%%{?with_%{1}:ON}%%{!?with_%{1}:OFF}} +%__ON_OFF_not() %{expand:%%{?with_%{1}:OFF}%%{!?with_%{1}:ON}} + +# for use with cmake (since 1.742): # Usage: cmake_on_off BCOND_NAME [OPTION_NAME] -# BuildRequires: rpmbuild(macros) >= 1.742 +# Deprecated: use clearer -DOPTION_NAME=%{__ON_OFF BCOND_NAME} instead %cmake_on_off() -D%{?2}%{!?2:%{1}}:BOOL=%{expand:%%{?with_%{1}:ON}%%{!?with_%{1}:OFF}} #----------------------------------------------------------------- diff --git a/rpm-tld-macros.spec b/rpm-tld-macros.spec index a60ac7d..c696118 100644 --- a/rpm-tld-macros.spec +++ b/rpm-tld-macros.spec @@ -1,4 +1,4 @@ -%define rpm_macros_rev 2.045 +%define rpm_macros_rev 2.047 %define find_lang_rev 1.42 # split into individual X_prov_ver if there is a reason to desync %define prov_ver 4.15 @@ -90,6 +90,8 @@ Requires: findutils >= 1:4.2.26 Provides: rpmbuild(find_lang) = %{find_lang_rev} Provides: rpmbuild(macros) = %{rpm_macros_rev} Obsoletes: rpm-build-macros < 1.745 +# ensure cargo with install --no-track support +Conflicts: cargo < 1.41.0 Conflicts: gettext-devel < 0.11 # ensure not using meson without meson-related macros in package Conflicts: meson < 1.6.1-3 -- 2.49.0