summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Iooss2017-08-14 15:02:27 +0200
committerNicolas Iooss2018-01-17 19:27:05 +0100
commitcfc3ea039d121304c3770733cd2771fbdbd70d3d (patch)
treeecee00878a8373d131aaaab5e12b3503041eaac0
parentaa6622c164c0d3e14c52236492651aad00f0bd31 (diff)
downloadaur-cfc3ea039d121304c3770733cd2771fbdbd70d3d.tar.gz
systemd-selinux: build with an UTF-8 locale
-rw-r--r--PKGBUILD14
1 files changed, 13 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 9f16f38e1459..0b2edfbc1684 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -140,8 +140,20 @@ build() {
-Dsysvrcnd-path=
)
- arch-meson "${pkgbase/-selinux}-stable" build "${meson_options[@]}"
+ # meson needs a UTF-8 locale. Otherwise it displays the following error message:
+ # WARNING: You are using 'ANSI_X3.4-1968' which is not a a Unicode-compatible locale.
+ # WARNING: You might see errors if you use UTF-8 strings as filenames, as strings, or as file contents.
+ # WARNING: Please switch to a UTF-8 locale for your platform.
+ # c.f. https://github.com/mesonbuild/meson/blob/0.42.0/meson.py#L21
+ if ! (echo "$LANG" | grep -i '\.utf-\?8' > /dev/null) ; then
+ export LANG="$(locale -a | grep -i '\.utf-\?8' | head -n1)"
+ if [ -z "$LANG" ] ; then
+ echo >&2 "Unable to find a UTF-8 locale on the system"
+ return 1
+ fi
+ fi
+ arch-meson "${pkgbase/-selinux}-stable" build "${meson_options[@]}"
ninja -C build
}