Meson is an open source build system designed to be both extremely fast and as user friendly as possible.
Compile Meson with the following command:
pip3 wheel -w dist --no-cache-dir --no-build-isolation --no-deps $PWD
The test suite requires some packages outside the scope of LFS.
Install the package:
pip3 install --no-index --find-links dist meson install -vDm644 data/shell-completions/bash/meson /usr/share/bash-completion/completions/meson install -vDm644 data/shell-completions/zsh/_meson /usr/share/zsh/site-functions/_meson
The meaning of the install parameters:
-w
dist
Puts the created wheels into the dist directory.
--find-links
dist
Installs wheels from the dist
directory.
When targetting the x32-bit architecture on 64-bit, some packages using Meson-based build systems will sometimes use wrong architecture-specific settings, bit sizes, and pull in libraries not meant for the architecture being targeted. This doesn't happen often but requires complex solutions to solve without cross or native files. Errors can range from linking and out-of-bounds, to other various cryptic output.
Cross and native files specify architecture specific information which either honestly and slyly tells Meson what the target or host is so it uses correct information and libraries. Create those files now:
mkdir -pv /usr/share/meson/cross
mkdir -pv /usr/share/meson/native
for i in {cross/libx32,native/x32}; do
cat > /usr/share/meson/$i << "EOF"
[binaries]
c = ['gcc', '-mx32']
cpp = ['g++', '-mx32']
rust = ['rustc', '--target', 'x86_64-unknown-linux-gnux32']
pkg-config = 'x86_64-pc-linux-gnux32-pkg-config'
ar = '/usr/bin/ar'
strip = '/usr/bin/strip'
cups-config = 'cups-config'
llvm-config = 'llvm-config'
exe_wrapper = ''
[built-in options]
libdir = 'libx32'
[properties]
sizeof_void* = 4
sizeof_long = 4
[host_machine]
system = 'linux'
subsystem = 'linux'
kernel = 'linux'
cpu_family = 'x86'
cpu = 'x86_64'
endian = 'little'
EOF
done
These files will be used by default in packages that will use Meson-based build systems to reduce any architecture and upgrading issues.