From b9a401a17a185442af45e3ae0a9e3e1c3043976d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Mon, 27 Jul 2026 14:10:06 +0200 Subject: [PATCH] Replace Alien::cmake3 with Alien::cmake4 In order to use system CMake which nowadays is CMake 4, incompatible with CMake 3. Related: https://github.com/PerlAlien/Alien-Build/issues/432 --- corpus/cmake-libpalindrome/CMakeLists.txt | 2 +- dist.ini | 4 ++-- lib/Alien/Build/Interpolate/Default.pm | 2 +- lib/Alien/Build/Manual/FAQ.pod | 4 ++-- lib/Alien/Build/Plugin/Build/CMake.pm | 6 +++--- maint/cip-before-install | 2 -- t/00_diag.t | 2 +- t/alien_build_plugin_build_cmake.t | 12 ++++++------ 8 files changed, 16 insertions(+), 18 deletions(-) diff --git a/corpus/cmake-libpalindrome/CMakeLists.txt b/corpus/cmake-libpalindrome/CMakeLists.txt index 09527c30..da2c69ac 100644 --- a/corpus/cmake-libpalindrome/CMakeLists.txt +++ b/corpus/cmake-libpalindrome/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.0.0) +cmake_minimum_required (VERSION 3.5.0) project (libpalindrome C) add_subdirectory (libpalindrome) add_subdirectory (palx) diff --git a/dist.ini b/dist.ini index eb11143d..0e8a2b2b 100644 --- a/dist.ini +++ b/dist.ini @@ -78,7 +78,7 @@ diag = +Alien::gzip diag = +IO::Socket::SSL diag = +Net::SSLeay diag = +LWP::Protocol::https -diag = +Alien::cmake3 +diag = +Alien::cmake4 diag = +Readonly diag = +Env::ShellWords diag = +Mojo::DOM58 @@ -182,7 +182,7 @@ remove = URI::Escape remove = Archive::Tar remove = Archive::Zip remove = Alien::gmake -remove = Alien::cmake3 +remove = Alien::cmake4 remove = Devel::Hide remove = Net::SSLeay remove = IO::Socket::SSL diff --git a/lib/Alien/Build/Interpolate/Default.pm b/lib/Alien/Build/Interpolate/Default.pm index 8042d61c..c05d2507 100644 --- a/lib/Alien/Build/Interpolate/Default.pm +++ b/lib/Alien/Build/Interpolate/Default.pm @@ -100,7 +100,7 @@ The C Compiler used to build Perl Requires: L 0.07 if cmake is not already in C. Deprecated: Use the L plugin instead (which will replace -this helper with one that works with L that works better). +this helper with one that works with L that works better). =cut diff --git a/lib/Alien/Build/Manual/FAQ.pod b/lib/Alien/Build/Manual/FAQ.pod index 2059ecc2..de58edd0 100644 --- a/lib/Alien/Build/Manual/FAQ.pod +++ b/lib/Alien/Build/Manual/FAQ.pod @@ -124,9 +124,9 @@ MSYS plugin and use a command sequence to do the build like this: =head3 CMake -There is an alien L that provides C 3.x or better (It is preferred to the +There is an alien L that provides C 4.x or better (It is preferred to the older L). Though it is recommended that you use the C -(L) plugin instead of using L. +(L) plugin instead of using L. use alienfile; diff --git a/lib/Alien/Build/Plugin/Build/CMake.pm b/lib/Alien/Build/Plugin/Build/CMake.pm index cb20519b..231f66b7 100644 --- a/lib/Alien/Build/Plugin/Build/CMake.pm +++ b/lib/Alien/Build/Plugin/Build/CMake.pm @@ -59,7 +59,7 @@ Returns true if your Perls C appears to be C. =head2 cmake -This plugin replaces the default C helper with the one that comes from L. +This plugin replaces the default C helper with the one that comes from L. =head2 cmake_generator @@ -119,7 +119,7 @@ sub init $meta->prop->{destdir} = $^O eq 'MSWin32' ? 0 : 1; $meta->add_requires('configure' => 'Alien::Build::Plugin::Build::CMake' => '0.99'); - $meta->add_requires('share' => 'Alien::cmake3' => '0.02'); + $meta->add_requires('share' => 'Alien::cmake4' => '0'); if(is_dmake()) { @@ -147,7 +147,7 @@ sub init } } - $meta->interpolator->replace_helper('cmake' => sub { require Alien::cmake3; Alien::cmake3->exe }); + $meta->interpolator->replace_helper('cmake' => sub { require Alien::cmake4; Alien::cmake4->exe }); $meta->interpolator->add_helper('cmake_generator' => \&cmake_generator); my @args = ( diff --git a/maint/cip-before-install b/maint/cip-before-install index aa16e2be..3bc9d844 100755 --- a/maint/cip-before-install +++ b/maint/cip-before-install @@ -27,8 +27,6 @@ fi if [ "x$ALIEN_BUILD_INSTALL_EXTRA" == "x1" ]; then - cip exec env PERL_ALT_INSTALL=OVERWRITE cpanm -n Alt::Alien::cmake3::System - MODULES=" Test2::Harness File::Listing diff --git a/t/00_diag.t b/t/00_diag.t index 20574afb..ea0a6a23 100644 --- a/t/00_diag.t +++ b/t/00_diag.t @@ -13,7 +13,7 @@ $modules{$_} = $_ for qw( Acme::Alien::DontPanic Alien::Base::ModuleBuild Alien::Libbz2 - Alien::cmake3 + Alien::cmake4 Alien::gzip Alien::xz Archive::Tar diff --git a/t/alien_build_plugin_build_cmake.t b/t/alien_build_plugin_build_cmake.t index 4c2cfcb8..2df9cd73 100644 --- a/t/alien_build_plugin_build_cmake.t +++ b/t/alien_build_plugin_build_cmake.t @@ -5,8 +5,8 @@ use Test::Alien::Build; use Alien::Build::Plugin::Build::CMake; use Path::Tiny (); -eval { require Alien::cmake3 }; -skip_all 'test requires Alien::cmake3' if $@; +eval { require Alien::cmake4 }; +skip_all 'test requires Alien::cmake4' if $@; # To see the actual commands being executed $ENV{VERBOSE} = 1; @@ -15,11 +15,11 @@ $Alien::Build::Plugin::Fetch::LocalDir::VERSION ||= '0.99'; $Alien::Build::Plugin::Build::CMake::VERSION ||= '0.99'; $Alien::Build::Plugin::Gather::IsolateDynamic::VERSION ||= '0.99'; -diag "Alien::cmake3::VERSION = $Alien::cmake3::VERSION"; -diag "Alien::cmake3->bin_dir = ", my @bin_dir = Alien::cmake3->bin_dir; -diag "Alien::cmake3->exe = ", my $exe = Alien::cmake3->exe; +diag "Alien::cmake4::VERSION = $Alien::cmake4::VERSION"; +diag "Alien::cmake4->bin_dir = ", my @bin_dir = Alien::cmake4->bin_dir; +diag "Alien::cmake4->exe = ", my $exe = Alien::cmake4->exe; my $full_exe = @bin_dir ? Path::Tiny::path(@bin_dir)->child($exe) : $exe; -diag "Alien::cmake3 full exe = $full_exe"; +diag "Alien::cmake4 full exe = $full_exe"; diag "cmake --version:\n", `$full_exe --version`; my $xs = do { local $/; };