libxcb: Set well-known locale for build (#45502)

* libxcb: Set well-known locale for build

Builds might fail if no valid locale is set. See https://www.linuxfromscratch.org/blfs/view/git/x/libxcb.html

* libxcb: fix style

* libxcb: change locale from en_US.UTF-8 to C.UTF-8

* libxcb: fix style

* Update var/spack/repos/builtin/packages/libxcb/package.py

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>

* [@spackbot] updating style on behalf of jgraciahlrs

---------

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
Co-authored-by: jgraciahlrs <jgraciahlrs@users.noreply.github.com>
This commit is contained in:
jgraciahlrs 2024-08-05 15:47:38 +02:00 committed by GitHub
parent d3bf1e04fc
commit 0257b2db4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -60,3 +60,13 @@ def configure_args(self):
def patch(self):
filter_file("typedef struct xcb_auth_info_t {", "typedef struct {", "src/xcb.h")
# libxcb fails to build with non-UTF-8 locales, see:
# https://www.linuxfromscratch.org/blfs/view/git/x/libxcb.html
# https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests/53 (merged in 1.17.0)
# https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests/60
# If a newer release can be verified to build with LC_ALL=en_US.ISO-8859-1,
# then we can limit the following function, e.g.
# when("@:1.17")
def setup_build_environment(self, env):
env.set("LC_ALL", "C.UTF-8")