]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: add runutf8 env vars and meson-python.sh script
authorPavel Hrdina <phrdina@redhat.com>
Tue, 30 Jun 2020 18:18:18 +0000 (20:18 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Mon, 3 Aug 2020 07:27:00 +0000 (09:27 +0200)
With meson we have to use both env vars and wrapper script to run python
with correct LANG settings.

run_command() and test() have 'env' attribute so we can use it, but
custom_target() doesn't support that attribute. Environment variables
cannot by configured using 'command' because meson checks if the first
item in the list is executable so we have to use a wrapper.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
configure.ac
meson.build
scripts/meson-python.sh [new file with mode: 0755]
scripts/meson.build

index d5f84f075f926a5ebcba8bbf06863e26aea117e1..5cdb028239b11f2ba5de1ccc54d2f1c2071fbb98 100644 (file)
@@ -90,13 +90,6 @@ dnl Need to test if pkg-config exists
 PKG_PROG_PKG_CONFIG
 
 
-dnl Python3 < 3.7 treats the C locale as 7-bit only.
-dnl We must force env vars so it treats it as UTF-8
-dnl regardless of the user's locale.
-RUNUTF8="LC_ALL= LANG=C LC_CTYPE=en_US.UTF-8"
-AC_SUBST(RUNUTF8)
-
-
 dnl MinGW checks
 LIBVIRT_WIN_CHECK_SYMBOLS
 LIBVIRT_WIN_CHECK_WINDRES
index f4b0d25373aacdb2b12c96da042dfea6d548b0a6..c785b12f6c09e953e3311541e19beb8947cb5c4a 100644 (file)
@@ -2202,6 +2202,13 @@ endif
 conf.set_quoted('TLS_PRIORITY', get_option('tls_priority'))
 
 
+# Various definitions
+
+# Python3 < 3.7 treats the C locale as 7-bit only. We must force env vars so
+# it treats it as UTF-8 regardless of the user's locale.
+runutf8 = [ 'LC_ALL=', 'LANG=C', 'LC_CTYPE=en_US.UTF-8' ]
+
+
 # define top include directory
 
 top_inc_dir = include_directories('.')
diff --git a/scripts/meson-python.sh b/scripts/meson-python.sh
new file mode 100755 (executable)
index 0000000..9ba670f
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+LC_ALL= LANG=C LC_CTYPE=en_US.UTF-8 "$@"
index 941e40a0917a9aef6fa39d5d70fb8d7232ac51ec..5d3f0af4793f4d54a3e6383352bd0b71c81a84fc 100644 (file)
@@ -18,6 +18,7 @@ scripts = [
   'header-ifdef.py',
   'hvsupport.py',
   'hyperv_wmi_generator.py',
+  'meson-python.sh',
   'mock-noinline.py',
   'prohibit-duplicate-header.py',
   'test-wrap-argv.py',