From 6fa7fe26dc8704d9e5a82a5db79adc0663222c10 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Tue, 24 Jun 2025 23:10:21 +0300 Subject: [PATCH] ports: Add support for meson build systems --- ports/install.sh | 7 +++++++ toolchain/meson-cross-file.in | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 toolchain/meson-cross-file.in diff --git a/ports/install.sh b/ports/install.sh index 3dee2c5c7b..71a5992eeb 100755 --- a/ports/install.sh +++ b/ports/install.sh @@ -39,6 +39,13 @@ if [ "$BANAN_ARCH" = "i686" ]; then export LDFLAGS="-shared-libgcc" fi +export MESON_CROSS_FILE="$BANAN_PORT_DIR/$BANAN_ARCH-banan_os-meson.txt" +if [ ! -f "$MESON_CROSS_FILE" ] || [ "$MESON_CROSS_FILE" -ot "$BANAN_TOOLCHAIN_DIR/meson-cross-file.in" ]; then + cp "$BANAN_TOOLCHAIN_DIR/meson-cross-file.in" "$MESON_CROSS_FILE" + sed -i "s/ARCH/$BANAN_ARCH/" "$MESON_CROSS_FILE" + sed -i "s/SYSROOT/$BANAN_SYSROOT/" "$MESON_CROSS_FILE" +fi + clean() { find . -mindepth 1 -maxdepth 1 -not -name 'patches' -not -name 'build.sh' -exec rm -rf {} + } diff --git a/toolchain/meson-cross-file.in b/toolchain/meson-cross-file.in new file mode 100644 index 0000000000..683d6b5613 --- /dev/null +++ b/toolchain/meson-cross-file.in @@ -0,0 +1,17 @@ +[host_machine] +system = 'banan_os' +cpu_family = 'ARCH' +cpu = 'ARCH' +endian = 'little' + +[binaries] +c = 'ARCH-pc-banan_os-gcc' +cpp = 'ARCH-pc-banan_os-g++' +ar = 'ARCH-pc-banan_os-ar' +ld = 'ARCH-pc-banan_os-ld' +objcopy = 'ARCH-pc-banan_os-objcopy' +strip = 'ARCH-pc-banan_os-strip' +pkgconfig = 'pkg-config' + +[properties] +sys_root='SYSROOT'