[debhelper-devel] [debhelper] 02/02: ninja.pm: Set LC_ALL=C.UTF-8 for meson builds

Niels Thykier nthykier at moszumanska.debian.org
Sat Jan 20 14:13:31 UTC 2018


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository debhelper.

commit 104e0e2c2ab0dc9e5e24568c51978936e7ffddf4
Author: Niels Thykier <niels at thykier.net>
Date:   Sat Jan 20 14:11:47 2018 +0000

    ninja.pm: Set LC_ALL=C.UTF-8 for meson builds
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog                          |  3 +++
 lib/Debian/Debhelper/Buildsystem/ninja.pm | 36 ++++++++++++++++++++++---------
 2 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b6821b3..4ef1247 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,9 @@ debhelper (11.1.3) UNRELEASED; urgency=medium
   * Dh_Lib.pm: When printing commands (e.g. for doit), also show
     changes to the environment (when done as a part of the
     command).
+  * ninja.pm: Set LC_ALL=C.UTF-8 when calling ninja to avoid
+    meson choking on UTF-8 characters when it embeds itself into
+    e.g. the build or install.  (Closes: #873831)
 
  -- Niels Thykier <niels at thykier.net>  Sun, 14 Jan 2018 09:54:57 +0000
 
diff --git a/lib/Debian/Debhelper/Buildsystem/ninja.pm b/lib/Debian/Debhelper/Buildsystem/ninja.pm
index 5d6c874..8ebc95c 100644
--- a/lib/Debian/Debhelper/Buildsystem/ninja.pm
+++ b/lib/Debian/Debhelper/Buildsystem/ninja.pm
@@ -44,38 +44,54 @@ sub check_auto_buildable {
 
 sub build {
 	my $this=shift;
-
+	my %options = (
+		update_env => {
+			'LC_ALL' => 'C.UTF-8',
+		}
+	);
 	if (!$dh{QUIET}) {
 		unshift @_, "-v";
 	}
 	if ($this->get_parallel() > 0) {
 		unshift @_, "-j" . $this->get_parallel();
 	}
-	$this->doit_in_builddir($this->{buildcmd}, @_);
+	$this->doit_in_builddir(\%options, $this->{buildcmd}, @_);
 }
 
 sub test {
 	my $this=shift;
-
+	my %options = (
+		update_env => {
+			'LC_ALL' => 'C.UTF-8',
+		}
+	);
 	if ($this->get_parallel() > 0) {
-		$ENV{MESON_TESTTHREADS}=$this->get_parallel();
+		$options{update_env}{MESON_TESTTHREADS} = $this->get_parallel();
 	}
-	$this->doit_in_builddir($this->{buildcmd}, "test", @_);
+	$this->doit_in_builddir(\%options, $this->{buildcmd}, "test", @_);
 }
 
 sub install {
 	my $this=shift;
 	my $destdir=shift;
-
-	$ENV{DESTDIR}=$destdir;
-	$this->doit_in_builddir($this->{buildcmd}, "install", @_);
+	my %options = (
+		update_env => {
+			'LC_ALL'  => 'C.UTF-8',
+			'DESTDIR' => $destdir,
+		}
+	);
+	$this->doit_in_builddir(\%options, $this->{buildcmd}, "install", @_);
 }
 
 sub clean {
 	my $this=shift;
-
 	if (!$this->rmdir_builddir()) {
-		$this->doit_in_builddir($this->{buildcmd}, "clean", @_);
+		my %options = (
+			update_env => {
+				'LC_ALL'  => 'C.UTF-8',
+			}
+		);
+		$this->doit_in_builddir(\%options, $this->{buildcmd}, "clean", @_);
 	}
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git




More information about the debhelper-devel mailing list