summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Pappacoda <andrea@pappacoda.it>2022-09-29 22:40:35 +0200
committerAndrea Pappacoda <andrea@pappacoda.it>2022-10-01 11:54:36 +0200
commit7990e7592852be8c4b2b83a348f663facc6aa7fd (patch)
tree220c7eddbc5fd63e81681904da1ba2d606f7118f
parenta6430c7916ecb6db28a6dd41fd1a52db90220cc3 (diff)
cmake.pm: use cmake --install in compat 14
Closes: #1020732
-rw-r--r--debhelper-compat-upgrade-checklist.pod8
-rw-r--r--lib/Debian/Debhelper/Buildsystem/cmake.pm23
2 files changed, 26 insertions, 5 deletions
diff --git a/debhelper-compat-upgrade-checklist.pod b/debhelper-compat-upgrade-checklist.pod
index 13f6d749..a4d16d5b 100644
--- a/debhelper-compat-upgrade-checklist.pod
+++ b/debhelper-compat-upgrade-checklist.pod
@@ -717,10 +717,10 @@ L<dh_installdeb(1)> to ensure the proper removal of previous PAM files.
=item -
-The B<meson+ninja> build system now uses B<meson install> instead of
-B<ninja install> in the L<dh_auto_install(1)> call. Any override of
-B<dh_auto_install> that passes extra parameters to the upstream build
-system should be reviewed.
+The B<meson+ninja> and B<cmake> build systems now use B<meson install> and
+B<cmake --install>, respectively, instead of B<ninja install> and B<make install>
+in the L<dh_auto_install(1)> call. Any override of B<dh_auto_install> that
+passes extra parameters to the upstream build system should be reviewed.
=back
diff --git a/lib/Debian/Debhelper/Buildsystem/cmake.pm b/lib/Debian/Debhelper/Buildsystem/cmake.pm
index 4c4d0353..c4a2ad9c 100644
--- a/lib/Debian/Debhelper/Buildsystem/cmake.pm
+++ b/lib/Debian/Debhelper/Buildsystem/cmake.pm
@@ -8,7 +8,7 @@ package Debian::Debhelper::Buildsystem::cmake;
use strict;
use warnings;
-use Debian::Debhelper::Dh_Lib qw(%dh compat dpkg_architecture_value error is_cross_compiling get_buildoption);
+use Debian::Debhelper::Dh_Lib qw(%dh compat dpkg_architecture_value error is_cross_compiling get_buildoption print_and_doit);
use parent qw(Debian::Debhelper::Buildsystem);
my @STANDARD_CMAKE_FLAGS = qw(
@@ -178,4 +178,25 @@ sub test {
return $this->SUPER::test(@_);
}
+sub install {
+ my $this = shift;
+ my $target = $this->get_targetbuildsystem;
+
+ if (compat(13)) {
+ $target->install(@_);
+ } else {
+ # In compat 14 `cmake --install` is preferred to `make install`,
+ # see https://bugs.debian.org/1020732
+ my $destdir = shift;
+ my %options = (
+ update_env => {
+ 'LC_ALL' => 'C.UTF-8',
+ 'DESTDIR' => $destdir,
+ }
+ );
+ print_and_doit(\%options, 'cmake', '--install', $this->get_buildpath, @_);
+ }
+ return 1;
+}
+
1