summaryrefslogtreecommitdiff
path: root/lib/Debian/Debhelper/Buildsystem/meson.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Debian/Debhelper/Buildsystem/meson.pm')
-rw-r--r--lib/Debian/Debhelper/Buildsystem/meson.pm38
1 files changed, 28 insertions, 10 deletions
diff --git a/lib/Debian/Debhelper/Buildsystem/meson.pm b/lib/Debian/Debhelper/Buildsystem/meson.pm
index dcad89f9..890112bd 100644
--- a/lib/Debian/Debhelper/Buildsystem/meson.pm
+++ b/lib/Debian/Debhelper/Buildsystem/meson.pm
@@ -8,12 +8,21 @@ package Debian::Debhelper::Buildsystem::meson;
use strict;
use warnings;
use Debian::Debhelper::Dh_Lib qw(dpkg_architecture_value is_cross_compiling doit warning error generated_file);
-use parent qw(Debian::Debhelper::Buildsystem::ninja);
+use parent qw(Debian::Debhelper::Buildsystem);
sub DESCRIPTION {
"Meson (meson.build)"
}
+sub IS_GENERATOR_BUILD_SYSTEM {
+ return 1;
+}
+
+sub SUPPORTED_TARGET_BUILD_SYSTEMS {
+ return qw(ninja);
+}
+
+
sub check_auto_buildable {
my $this=shift;
my ($step)=@_;
@@ -22,7 +31,14 @@ sub check_auto_buildable {
# Handle configure explicitly; inherit the rest
return 1 if $step eq "configure";
- return $this->SUPER::check_auto_buildable(@_);
+ my $ret = $this->get_targetbuildsystem->check_auto_buildable(@_);
+ if ($ret == 0 and $this->check_auto_buildable_clean_oos_buildir(@_)) {
+ # Assume that the package can be cleaned (i.e. the build directory can
+ # be removed) as long as it is built out-of-source tree and can be
+ # configured.
+ $ret++;
+ }
+ return $ret;
}
sub new {
@@ -45,7 +61,7 @@ sub configure {
push @opts, "--localstatedir=/var";
my $multiarch=dpkg_architecture_value("DEB_HOST_MULTIARCH");
push @opts, "--libdir=lib/$multiarch";
- push @opts, "--libexecdir=lib/$multiarch";
+ push(@opts, "--libexecdir=lib/$multiarch") if not compat(11);
if (is_cross_compiling()) {
# http://mesonbuild.com/Cross-compilation.html
@@ -57,7 +73,11 @@ sub configure {
error("Cannot cross-compile: Please use meson (>= 0.42.1) or provide a cross file via DH_MESON_CROSS_FILE");
}
my $filename = generated_file('_source', 'meson-cross-file.conf');
- doit({ stdout => '/dev/null' }, $debcrossgen, "-o${filename}");
+ my %options = (
+ stdout => '/dev/null',
+ update_env => { LC_ALL => 'C.UTF-8'},
+ );
+ doit(\%options, $debcrossgen, "-o${filename}");
$cross_file = $filename;
}
if ($cross_file !~ m{^/}) {
@@ -71,7 +91,10 @@ sub configure {
$this->mkdir_builddir();
eval {
- $this->doit_in_builddir("meson", $this->get_source_rel2builddir(), @opts, @_);
+ my %options = (
+ update_env => { LC_ALL => 'C.UTF-8'},
+ );
+ $this->doit_in_builddir(\%options, "meson", $this->get_source_rel2builddir(), @opts, @_);
};
if ($@) {
if (-e $this->get_buildpath("meson-logs/meson-log.txt")) {
@@ -81,9 +104,4 @@ sub configure {
}
}
-sub test {
- my $this=shift;
- return $this->SUPER::test(@_);
-}
-
1