From 9cb1725673abc215198ed310251f2c6ef70abe30 Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Thu, 7 Dec 2023 18:39:45 +0000 Subject: [PATCH 1/2] CI: Switch to Meson build --- ci_build.sh | 22 +++++++++++++++++++--- ci_setup_test.sh | 6 +++++- configure.meson | 12 +++++++++++- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/ci_build.sh b/ci_build.sh index 039597b3..c38fdea9 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -11,7 +11,23 @@ if [ "x${CI}" = "xtrue" ] ; then fi if [ -z "${DIR_INSTALLED_FDPP}" ] ; then - echo env var "DIR_INSTALLED_FDPP" is empty or missing - exit 1 + echo env var "DIR_INSTALLED_FDPP" is empty or missing + exit 1 +fi + +INST=$(pwd)/${DIR_INSTALLED_FDPP} + +if false ; then + # Old Makefile based build + make clean all PREFIX=${INST} +else + # Ubuntu 22.04 has too old a Meson, so pip install it + sudo apt install ninja-build pipx + pipx install meson + export PATH=${HOME}/.local/bin:${PATH} + + mkdir build + cd build || (echo "Could not switch into build dir" && exit 1) + PREFIX=${INST} ../configure.meson + meson compile --verbose fi -make clean all PREFIX=`pwd`/${DIR_INSTALLED_FDPP} diff --git a/ci_setup_test.sh b/ci_setup_test.sh index bf2b2713..810028e1 100755 --- a/ci_setup_test.sh +++ b/ci_setup_test.sh @@ -20,7 +20,11 @@ DIR_ROOT="$(pwd)" git clone --depth 1 --no-single-branch https://github.com/dosemu2/dosemu2.git ${DIR_TEST_DOSEMU} # Install fdpp into local directory -make install PREFIX="${DIR_ROOT}/${DIR_INSTALLED_FDPP}" +if false ; then + make install PREFIX="${DIR_ROOT}/${DIR_INSTALLED_FDPP}" +else + meson install -C ${DIR_ROOT}/build +fi ( cd ${DIR_TEST_DOSEMU} || exit 2 diff --git a/configure.meson b/configure.meson index 8785847c..ccb6230a 100755 --- a/configure.meson +++ b/configure.meson @@ -1,3 +1,7 @@ +#!/bin/sh + +# set -xv + if [ -f meson.build ]; then echo -e "Create a build dir first:" echo -e "\tmkdir build" @@ -8,7 +12,13 @@ if [ -f meson.build ]; then fi TOP=$(dirname "$0") -meson setup --native-file $TOP/fdpp/toolchain.ini \ + +if [ -z "${PREFIX}" ] ; then + PREFIX="/usr/local" +fi + +meson setup --prefix ${PREFIX} \ + --native-file $TOP/fdpp/toolchain.ini \ --cross-file $TOP/fdpp/toolchain.ini \ --cross-file $TOP/fdpp/kernel/toolchain.ini \ --native-file $TOP/fdpp/kernel/toolchain.ini . $TOP From 62211e3cbdf9497cc73e517f5aa182f3158b48d0 Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Fri, 8 Dec 2023 11:30:49 +0000 Subject: [PATCH 2/2] CI: Don't cd into build directory --- ci_build.sh | 6 ++---- configure.meson | 17 +++++++---------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/ci_build.sh b/ci_build.sh index c38fdea9..d4bfdce2 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -26,8 +26,6 @@ else pipx install meson export PATH=${HOME}/.local/bin:${PATH} - mkdir build - cd build || (echo "Could not switch into build dir" && exit 1) - PREFIX=${INST} ../configure.meson - meson compile --verbose + PREFIX=${INST} ./configure.meson build + meson compile --verbose -C build fi diff --git a/configure.meson b/configure.meson index ccb6230a..0400ca84 100755 --- a/configure.meson +++ b/configure.meson @@ -2,14 +2,11 @@ # set -xv -if [ -f meson.build ]; then - echo -e "Create a build dir first:" - echo -e "\tmkdir build" - echo -e "\tcd build" - echo -e "\t../$(basename $0)" - echo "Bye!" - exit 0 +if [ -z "$1" ] ; then + echo "Usage: ./$(basename $0) builddir" + exit 1 fi +BLD="$1" TOP=$(dirname "$0") @@ -21,10 +18,10 @@ meson setup --prefix ${PREFIX} \ --native-file $TOP/fdpp/toolchain.ini \ --cross-file $TOP/fdpp/toolchain.ini \ --cross-file $TOP/fdpp/kernel/toolchain.ini \ - --native-file $TOP/fdpp/kernel/toolchain.ini . $TOP + --native-file $TOP/fdpp/kernel/toolchain.ini $BLD $TOP [ "$?" = "0" ] || exit 1 echo echo "Done configure" -echo "Now run \"meson compile --verbose\" to build" -echo "After that you can do \"sudo meson install\" to install" +echo "Now run \"meson compile --verbose -C $BLD\" to build" +echo "After that you can do \"sudo meson install -C $BLD\" to install"