Compare commits

...
Sign in to create a new pull request.

21 commits

Author SHA1 Message Date
Miro Hrončok
aaa289ec8e Declarative %generate_buildrequires: Keep the BRs stable
Make the rpm-macros implementation add new BuildRequires, but not removing some.
This makes the individual rounds of %generate_buildrequires behave more predictably.

Nothing says the previous approach is wrong, but is might blow up unexpectedly.
2025-12-12 22:48:14 +01:00
Neal Gompa
fef4fab786 macros: Enable support for RPM 4.20+ declarative buildsystem feature
The new cmake-srpm-macros package definition is required for supporting
Koji and COPR's two-stage build process where the SRPM isn't made
in the full build environment.
2025-12-11 17:08:07 -05:00
Neal Gompa
3445533b75 macros: Add section comment explaining cmakeX macros 2025-12-11 17:04:46 -05:00
Adam Williamson
063d6e7fc9 cmake-testsuite-sanity: fix for RPM 4.19.90 build dir change
See https://github.com/rpm-software-management/rpm/issues/3147
for the background. RPM 4.19.90 changed RPM's build directory
behavior; the tl;dr is that everything's one level deeper now.
This code was expecting something like:

/tmp/tmp.dheZFHDA0M/BUILD/cmake-3.31.10

but now we actually get something like:

/tmp/tmp.dheZFHDA0M/BUILD/cmake-3.31.10-build/cmake-3.31.10

this uses the trick from
https://github.com/rpm-software-management/rpm/issues/3147#issuecomment-2154192419
to figure out the base build directory and then go from there,
which *should* make this work on both older and newer RPM.

Without this fix, the tests are failing like this:

:: [ 21:03:33 ] :: [  BEGIN   ] :: Running 'CMakeDir='
:: [ 21:03:33 ] :: [   PASS   ] :: Command 'CMakeDir=' (Expected 0, got 0)
:: [ 21:03:33 ] :: [  BEGIN   ] :: Running 'cd /tmp/tmp.dheZFHDA0M/BUILD/'
:: [ 21:03:33 ] :: [   PASS   ] :: Command 'cd /tmp/tmp.dheZFHDA0M/BUILD/' (Expected 0, got 0)
:: [ 21:03:33 ] :: [  BEGIN   ] :: Running 'su -c './bootstrap &>/tmp/tmp.dheZFHDA0M/bootstrap.log' cmkbld'
:: [ 21:03:33 ] :: [   FAIL   ] :: Command 'su -c './bootstrap &>/tmp/tmp.dheZFHDA0M/bootstrap.log' cmkbld' (Expected 0, got 127)

you can see it doesn't get the directory right - it's trying
to run `./bootstrap` in `/tmp/tmp.dheZFHDA0M/BUILD/`, because
the attempt to discover `CMakeDir` failed and returned an
empty string. That's never going to work. See:
https://artifacts.dev.testing-farm.io/974c2a93-5d4c-4896-a48a-b2a54d2dd01d/

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2025-12-11 12:19:12 -08:00
Yaakov Selkowitz
e615fbe997 Update to 3.31.10 2025-12-02 16:38:10 -05:00
Fedora Release Engineering
864529c3fb Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-23 18:26:49 +00:00
Python Maint
851a4c373d Rebuilt for Python 3.14 2025-06-03 11:00:58 +02:00
Yaakov Selkowitz
b3bf0e8abc Revert to 3.31.6
Rebuild (jsoncpp)
Fix build with latest curl

https://pagure.io/fesco/issue/3377
2025-03-18 18:41:41 -04:00
Björn Esser
4a9c46f936
Exclude RunCMake.ParseImplicitLinkInfo from tests 2025-03-12 18:55:02 +01:00
Björn Esser
696e959fd5
cmake-4.0.0-rc4 2025-03-12 11:14:26 +01:00
Björn Esser
ff50d850d5
macros: Set CMAKE_POLICY_VERSION_MINIMUM as environment variable 2025-03-12 11:07:02 +01:00
Yaakov Selkowitz
8d9eeb10df Set CMAKE_POLICY_VERSION_MINIMUM as environment variable
While passing this as a cmake argument works for top-level projects, it
does not carry over automatically to subprojects.  Setting this in the
environment works for both.
2025-03-11 08:26:52 -04:00
Yaakov Selkowitz
66fb93f976 Define CMAKE_POLICY_VERSION_MINIMUM in %cmake
cmake 4.0 drops compatibility with CMake < 3.5, meaning that any packages
with an earlier CMAKE_MINIMUM_REQUIRED will fail.  In many cases though,
no further modification is required to build with newer versions, includes 4.0.
As such, overriding this by policy will avoid the need for patching a lot
of packages to fix their builds.

https://cmake.org/cmake/help/latest/variable/CMAKE_POLICY_VERSION_MINIMUM.html
https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html#policy-version
2025-03-07 15:24:54 -05:00
Cristian Le
ae4f1fd869 Drop non-standard *_INSTALL options
Signed-off-by: Cristian Le <git@lecris.dev>
2025-03-07 12:09:41 +01:00
Björn Esser
d8fe77bab9
cmake-4.0.0-rc3 2025-03-06 10:18:06 +01:00
Björn Esser
90810d6226
Provide cmake3 for legacy 2025-02-27 10:53:35 +01:00
Björn Esser
a3a0079a12
Disable bootstrap build 2025-02-27 09:33:03 +01:00
Björn Esser
1f2cca05f1
Rebuild (jsoncpp) 2025-02-27 09:19:57 +01:00
Björn Esser
c45037a52e
macros.cmake: Restore compatibility with cmake3 macros 2025-02-27 08:58:41 +01:00
Björn Esser
3604f33f87
tests/cmake-testsuite-sanity: Adapt for new builddir layout 2025-02-26 23:36:55 +01:00
Björn Esser
f304eb1c7d
cmake-4.0.0-rc2 2025-02-26 21:16:42 +01:00
5 changed files with 76 additions and 18 deletions

View file

@ -58,9 +58,6 @@
%global build_fflags %(echo '%{build_fflags}' | sed -e 's!-ffat-lto-objects!-fno-fat-lto-objects!g')
%global build_fcflags %(echo '%{build_fflags}' | sed -e 's!-ffat-lto-objects!-fno-fat-lto-objects!g')
# Place rpm-macros into proper location
%global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
# Setup _pkgdocdir if not defined already
%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}}
@ -69,10 +66,10 @@
%global major_version 3
%global minor_version 31
%global patch_version 6
%global patch_version 10
# For handling bump release by rpmdev-bumpspec and mass rebuild
%global baserelease 1
%global baserelease 3
# Set to RC version if building RC, else comment out.
#%%global rcsuf rc3
@ -104,10 +101,11 @@ URL: http://www.cmake.org
Source0: http://www.cmake.org/files/v%{major_version}.%{minor_version}/%{orig_name}-%{tar_version}.tar.gz
Source1: %{name}-init.el
Source2: macros.%{name}.in
Source3: macros.aaa-%{name}-srpm
# See https://bugzilla.redhat.com/show_bug.cgi?id=1202899
Source3: %{name}.attr
Source4: %{name}.prov
Source5: %{name}.req
Source4: %{name}.attr
Source5: %{name}.prov
Source6: %{name}.req
# Always start regular patches with numbers >= 100.
# We need lower numbers for patches in compat package.
@ -288,6 +286,16 @@ BuildArch: noarch
This package contains common RPM macros for %{name}.
%package srpm-macros
Summary: Common SRPM macros for %{name}
Requires: rpm
BuildArch: noarch
%description srpm-macros
This package contains common SRPM macros for %{name}.
%package -n python3-cmake
Summary: Python metadata for packages depending on %{name}
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
@ -310,8 +318,8 @@ echo '#!%{__python3}' > %{name}.req
echo '#!%{__python2}' > %{name}.prov
echo '#!%{__python2}' > %{name}.req
%endif
tail -n +2 %{SOURCE4} >> %{name}.prov
tail -n +2 %{SOURCE5} >> %{name}.req
tail -n +2 %{SOURCE5} >> %{name}.prov
tail -n +2 %{SOURCE6} >> %{name}.req
%endif
@ -387,12 +395,13 @@ install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir}
rm -f %{buildroot}%{_emacs_sitelispdir}
%endif
# RPM macros
install -p -m0644 -D %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.%{name}
sed -i -e "s|@@CMAKE_VERSION@@|%{version}|" -e "s|@@CMAKE_MAJOR_VERSION@@|%{major_version}|" %{buildroot}%{rpm_macros_dir}/macros.%{name}
touch -r %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.%{name}
install -p -m0644 -D %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name}
install -p -m0644 -D %{SOURCE3} %{buildroot}%{_rpmmacrodir}/macros.aaa-%{name}-srpm
sed -i -e "s|@@CMAKE_VERSION@@|%{version}|" -e "s|@@CMAKE_MAJOR_VERSION@@|%{major_version}|" %{buildroot}%{_rpmmacrodir}/macros.%{name}
touch -r %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name}
%if %{with rpm} && 0%{?_rpmconfigdir:1}
# RPM auto provides
install -p -m0644 -D %{SOURCE3} %{buildroot}%{_prefix}/lib/rpm/fileattrs/%{name}.attr
install -p -m0644 -D %{SOURCE4} %{buildroot}%{_prefix}/lib/rpm/fileattrs/%{name}.attr
install -p -m0755 -D %{name}.prov %{buildroot}%{_prefix}/lib/rpm/%{name}.prov
install -p -m0755 -D %{name}.req %{buildroot}%{_prefix}/lib/rpm/%{name}.req
%endif
@ -575,19 +584,42 @@ popd
%files rpm-macros
%{rpm_macros_dir}/macros.%{name}
%{_rpmmacrodir}/macros.%{name}
%if %{with rpm} && 0%{?_rpmconfigdir:1}
%{_rpmconfigdir}/fileattrs/%{name}.attr
%{_rpmconfigdir}/%{name}.prov
%{_rpmconfigdir}/%{name}.req
%endif
%files srpm-macros
%{_rpmmacrodir}/macros.aaa-%{name}-srpm
%files -n python3-cmake
%{python3_sitelib}/%{cmake_distinfo}
%changelog
* Fri Dec 12 2025 Miro Hrončok <mhroncok@redhat.com> - 3.31.10-3
- Declarative %%generate_buildrequires: Keep the BRs stable
* Thu Dec 11 2025 Neal Gompa <ngompa@fedoraproject.org> - 3.31.10-2
- macros: Enable support for RPM 4.20+ declarative buildsystem feature
* Tue Dec 02 2025 Yaakov Selkowitz <yselkowi@redhat.com> - 3.31.10-1
- Update to 3.31.10
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 3.31.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Tue Jun 03 2025 Python Maint <python-maint@redhat.com> - 3.31.6-3
- Rebuilt for Python 3.14
* Tue Mar 18 2025 Yaakov Selkowitz <yselkowi@redhat.com> - 3.31.6-2
- Revert to 3.31.6
- Rebuild (jsoncpp)
- Fix build with latest curl
* Mon Feb 24 2025 Björn Esser <besser82@fedoraproject.org> - 3.31.6-1
- cmake-3.31.6
Fixes rhbz#2347346

12
macros.aaa-cmake-srpm Normal file
View file

@ -0,0 +1,12 @@
# Declarative buildsystem macros (usable with rpm >= 4.20)
# https://rpm-software-management.github.io/rpm/manual/buildsystem.html
# When this file is installed but macros.cmake is not,
# this macro will just cause the real macros to get installed.
%cmake_generate_buildrequires(-) echo "cmake-rpm-macros"
%buildsystem_cmake_generate_buildrequires() %cmake_generate_buildrequires %{*}
%buildsystem_cmake_conf() %{nil}
%buildsystem_cmake_build() %{nil}
%buildsystem_cmake_install() %{nil}
%buildsystem_cmake_check() %{nil}

View file

@ -56,6 +56,19 @@
%{lua:print((string.gsub(rpm.expand('%{**}'),"%-%-%s","")))}
# Declarative buildsystem macros (usable with rpm >= 4.20)
# https://rpm-software-management.github.io/rpm/manual/buildsystem.html
%cmake_generate_buildrequires(-) echo "cmake-rpm-macros"; echo "cmake"
%buildsystem_cmake_generate_buildrequires() %cmake_generate_buildrequires %{*}
%buildsystem_cmake_conf() %cmake %{*}
%buildsystem_cmake_build() %cmake_build %{*}
%buildsystem_cmake_install() %cmake_install %{*}
%buildsystem_cmake_check() %{?with_ctest:%ctest %{*}} %{!?with_ctest:%{nil}}
# Legacy cmakeX macros for multiversioned CMake
%cmake@@CMAKE_MAJOR_VERSION@@ %cmake
%cmake@@CMAKE_MAJOR_VERSION@@_build %cmake_build
%cmake@@CMAKE_MAJOR_VERSION@@_install %cmake_install

View file

@ -1 +1 @@
SHA512 (cmake-3.31.6.tar.gz) = 839d06b6ebd0bf78cbe8f7ae3a7c00026e70d759a81ac51aa103f35ad985ac69be9e667aae7b5fe48c5e0c41baec791259279679dbdf2ddd8b63a48382a8a2a0
SHA512 (cmake-3.31.10.tar.gz) = ae1eed42c143b5afd70124853367dab130b3a668fd161a8fd794a44d2eb42f0a64367d152eb43edbf167ffa95612ffe10f8f18c6db9410ff473b97d4f04a978e

View file

@ -57,8 +57,9 @@ rlJournalStart
rlRun "dnf builddep -y $TmpDir/SPECS/*.spec"
rlRun "su -c 'rpmbuild -D \"_topdir $TmpDir\" -bp $TmpDir/SPECS/*.spec &>$TmpDir/rpmbuild.log' $BUILD_USER"
rlRun "rlFileSubmit $TmpDir/rpmbuild.log"
rlRun "CMakeDir=`ls $TmpDir/BUILD | grep -E '^cmake-[0-9]+(\.[0-9]+)+(-rc[0-9]+)?$' | tail -n 1`"
rlRun "cd $TmpDir/BUILD/$CMakeDir"
rlRun "BuildDir=`rpmbuild -D \"_topdir $TmpDir\" -bc --short-circuit --define '__spec_build_pre echo %{_builddir}; exit 0' $TmpDir/SPECS/*.spec | tail -1`"
rlRun "CMakeDir=`ls $BuildDir | grep -E '^cmake-[0-9]+(\.[0-9]+)+(-rc[0-9]+)?$' | tail -n 1`"
rlRun "cd $BuildDir/$CMakeDir"
rlRun "su -c './bootstrap &>$TmpDir/bootstrap.log' $BUILD_USER"
rlRun "rlFileSubmit $TmpDir/bootstrap.log"
rlRun "ln -fs /usr/bin/cmake bin/cmake"