summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/lib/ptxd_make_world_common.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/lib/ptxd_make_world_common.sh b/scripts/lib/ptxd_make_world_common.sh
index 90f1c70b3..85471ce22 100644
--- a/scripts/lib/ptxd_make_world_common.sh
+++ b/scripts/lib/ptxd_make_world_common.sh
@@ -315,7 +315,19 @@ ptxd_make_world_init() {
pkg_conf_opt="${pkg_conf_opt:-${!conf_opt_ptr}}"
pkg_conf_env="PTXDIST_ICECC= ${pkg_conf_env}"
- pkg_env="${pkg_env} LC_ALL='C.UTF-8'"
+
+ # Try to find a suitable UTF-8 locale on all distros
+ local c_locale
+ if c_locale=$(locale -a | grep -i -m 1 "^C\.utf[-]\?8$") || \
+ c_locale=$(locale -a | grep -i -m 1 "^en_US\.utf[-]\?8$") || \
+ c_locale=$(locale -a | grep -i -m 1 "^en_.*\.utf[-]\?8$"); then
+ pkg_env="${pkg_env} LC_ALL='${c_locale}'"
+ else
+ ptxd_warning "Failed to find a good UTF-8 locale for meson."
+ pkg_env="${pkg_env} LC_ALL='$(locale -a | grep -i -m 1 "\.utf[-]\?8")'"
+ fi
+ unset c_locale
+
if [ "${PTXDIST_VERBOSE}" = "1" ]; then
pkg_make_opt="-v ${pkg_make_opt}"
pkg_install_opt="-v ${pkg_install_opt}"