From d7c2caf96bbc6c74864020df9db6d759089a17b1 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Sun, 9 Jul 2023 11:32:36 +0200 Subject: [PATCH] - merged 2.025 from PLD --- macros.arch | 3 +++ macros.java | 22 ++++++++++++++++++++++ macros.rust | 8 ++++++-- macros.tld | 11 +++++++++++ rpm-tld-macros.spec | 4 ++-- 5 files changed, 44 insertions(+), 4 deletions(-) diff --git a/macros.arch b/macros.arch index 2718e3c..88e6f46 100644 --- a/macros.arch +++ b/macros.arch @@ -19,3 +19,6 @@ %arch32 %{ix86} %{arm32} ppc sparc sparcv9 %arch64 %{x8664} %{arm64} ppc64 sparc64 + +# architectures with support for 8-byte (64 bits) atomics +%arch_with_atomics64 i586 i686 athlon pentium2 pentium3 pentium4 %{x8664} x32 %{armv7} %{armv8} aarch64 mips64 ppc64 sparcv9 sparc64 diff --git a/macros.java b/macros.java index ee32a92..9af46e4 100644 --- a/macros.java +++ b/macros.java @@ -43,6 +43,28 @@ # insead of the system default #%use_jdk icedtea6 +# Lower bound for JDK version. +# In case of `%use_default_jdk %{expr:%min_jdk_version-1}` use %min_jdk_version +%min_jdk_version 8 + +# Default JDK provider and version +%default_jdk_provider openjdk +%default_jdk_version %min_jdk_version + +# Name of default JDK, takes requested minimum version as argument or if not +# given defaults to %default_jdk_version. Result is is either: +# - %{expand:%%default_jdk} +# - %{expand:%%default_jdk_provider} +# +# Examples for overriding: +# - specific JDK: --define 'default_jdk8 oracle8' +# - JDK provider: --define 'default_jdk_provider oracle' +# - JDK version: --define 'default_jdk_version 11' +%default_jdk() %{expand:%%define __jdk_v %{?1}%{!?1:%default_jdk_version}}%{expand:%%define __jdk_vf %{expr:%__jdk_v < %min_jdk_version ? %min_jdk_version : %__jdk_v}}%{expand:%%{?default_jdk%{__jdk_vf}}}%{expand:%%{!?default_jdk%{__jdk_vf}:%default_jdk_provider%{__jdk_vf}}}%{expand:%%undefine __jdk_vf}%{expand:%%undefine __jdk_v} + +# Use default JDK in spec, optionally takes requested minimum version as argument +%use_default_jdk() %{expand:%%global use_jdk %{default_jdk %{?*}}} + # expands to the value with right jdk for BuildRequires header # 'jdk' if %%use_jdk is not defined, jdk(%%use_jdk) otherwise # The requirement will not replace current 'default' JDK diff --git a/macros.rust b/macros.rust index 51f8fe4..7996c4f 100644 --- a/macros.rust +++ b/macros.rust @@ -33,6 +33,7 @@ thumbv7neon-unknown-linux-gnueabihf\\\ %cargo_targetdir target %cargo_objdir %{?buildsubdir:%{_builddir}/%{buildsubdir}/}%{cargo_targetdir}/%{rust_target}/%{!?debug:release}%{?debug:debug} +%__rustc /usr/bin/rustc %__cargo /usr/bin/cargo %__cargo_common_opts -v --offline %cargo_build \\\ @@ -42,11 +43,12 @@ thumbv7neon-unknown-linux-gnueabihf\\\ CXXFLAGS="%{rpmcppflags} %{rpmcxxflags}" \\\ LDFLAGS="%{rpmldflags}" \\\ PKG_CONFIG_ALLOW_CROSS=1 \\\ + RUSTC="${RUSTC:-%__rustc}" \\\ %{?rustc_wrapper:RUSTC_WRAPPER="${RUSTC_WRAPPER:-%rustc_wrapper}"} \\\ RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\ %{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\ %{__cargo} %{__cargo_common_opts} build %{!?debug:--release} \\\ - --target %{rust_target} \\\ + --target %rust_target \\\ --target-dir %{cargo_targetdir} \\\ %{nil} @@ -57,9 +59,11 @@ thumbv7neon-unknown-linux-gnueabihf\\\ CXXFLAGS="%{rpmcppflags} %{rpmcxxflags}" \\\ LDFLAGS="%{rpmldflags}" \\\ PKG_CONFIG_ALLOW_CROSS=1 \\\ + RUSTC="${RUSTC:-%__rustc}" \\\ + %{?rustc_wrapper:RUSTC_WRAPPER="${RUSTC_WRAPPER:-%rustc_wrapper}"} \\\ RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \\\ %{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \\\ %{__cargo} %{__cargo_common_opts} install \\\ - --target %{rust_target} \\\ + --target %rust_target \\\ --target-dir %{cargo_targetdir} \\\ %{nil} diff --git a/macros.tld b/macros.tld index f12b3d5..06111e3 100644 --- a/macros.tld +++ b/macros.tld @@ -27,6 +27,8 @@ %_lispdir %{_datadir}/emacs/site-lisp %_initddir %{_sysconfdir}/rc.d/init.d +%_metainfodir %{_datadir}/metainfo + %_defaultdocdir %{_usr}/share/doc %_fmoddir %{_libdir}/gfortran/modules @@ -486,6 +488,13 @@ CPPFLAGS="${CPPFLAGS:-%{rpmcppflags}}" \\\ %{__cmake} \\\ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\ -DCMAKE_BUILD_TYPE=%{!?debug:TLD}%{?debug:Debug} \\\ + -DCMAKE_SYSTEM_NAME=Linux \\\ + -DCMAKE_CROSSCOMPILING:BOOL=FALSE \\\ +%ifarch x32\ + -DCMAKE_SYSTEM_PROCESSOR=x86_64 \\\ +%else\ + -DCMAKE_SYSTEM_PROCESSOR=%{_target_cpu} \\\ +%endif\ -DCMAKE_INSTALL_BINDIR:PATH=%{_bindir} \\\ -DCMAKE_INSTALL_SBINDIR:PATH=%{_sbindir} \\\ -DCMAKE_INSTALL_LIBEXECDIR:PATH=%{_libexecdir} \\\ @@ -550,6 +559,8 @@ CFLAGS="${CFLAGS:-%{rpmcflags}}" \ CPPFLAGS="${CPPFLAGS:-%{rpmcppflags}}" \ CXXFLAGS="${CXXFLAGS:-%{rpmcxxflags}}" \ LDFLAGS="${LDFLAGS:-%{rpmldflags}}" \ +RUSTC="${RUSTC:-%{__rustc}}" \ +RUSTFLAGS="${RUSTFLAGS:-%{rpmrustflags} --target %rust_target}" \ LC_ALL=C.UTF-8 %{__meson} \ --buildtype=plain \ --bindir=%{_bindir} \ diff --git a/rpm-tld-macros.spec b/rpm-tld-macros.spec index 97feaee..394ca29 100644 --- a/rpm-tld-macros.spec +++ b/rpm-tld-macros.spec @@ -1,4 +1,4 @@ -%define rpm_macros_rev 2.019 +%define rpm_macros_rev 2.025 %define find_lang_rev 1.41 # split into individual X_prov_ver if there is a reason to desync %define prov_ver 4.15 @@ -6,7 +6,7 @@ Summary: TLD Linux RPM macros Summary(pl.UTF-8): Makra RPM dla Linuksa TLD Name: rpm-tld-macros Version: %{rpm_macros_rev} -Release: 5 +Release: 1 License: GPL v2+ Group: Development/Building Source0: macros.tld -- 2.46.0