[vala/wip/meson: 10/11] WIP meson: Add bootstrap subproject and adjust meson-bootstrap.sh




commit 3b6573ad5ccd280f7e89e23cb072ef7e0471c7cc
Author: Lorenz Wildberg <lorenz wild-fisch de>
Date:   Tue Nov 23 23:26:20 2021 +0000

    WIP meson: Add bootstrap subproject and adjust meson-bootstrap.sh

 meson-bootstrap.sh              | 27 ++++++++++++++++++++-------
 subprojects/vala-bootstrap.wrap |  5 +++++
 2 files changed, 25 insertions(+), 7 deletions(-)
---
diff --git a/meson-bootstrap.sh b/meson-bootstrap.sh
index ddeac3fdf..35aecd346 100755
--- a/meson-bootstrap.sh
+++ b/meson-bootstrap.sh
@@ -1,13 +1,26 @@
 #!/bin/sh
 
 API=`grep -e "^vala_api_version = '\([0-9]\.[0-9]*\)'$" meson.build | sed -r "s/vala_api_version = '([^ 
]+)'/\1/"`
+CUR_DIR=`pwd`
 
-PWD=$(pwd)
-rm -rf _bootstrap _bootstrap_install _build
+rm -rf subprojects/vala-bootstrap/_build _bootstrap _build
 
-meson _bootstrap -Dvaladoc=false -Dprefix=$PWD/_bootstrap_install || exit 1
-ninja -C _bootstrap || exit 1
+echo ">>> Building vala-bootstrap <<<"
+meson subprojects download || exit 1
+cd subprojects/vala-bootstrap
+meson _build -Ddefault_library=static || exit 1
+meson compile -C _build || exit 1
 
-LD_LIBRARY_PATH="$PWD/_bootstrap/vala:$PWD/_bootstrap/codegen" VALAC="$PWD/_bootstrap/compiler/valac-$API 
--vapidir $PWD/vapi" meson _build -Dprefix=/usr || exit 1
-LD_LIBRARY_PATH="$PWD/_bootstrap/vala:$PWD/_bootstrap/codegen" ninja -C _build || exit 1
-LD_LIBRARY_PATH="$PWD/_bootstrap/vala:$PWD/_bootstrap/codegen" ninja -C _build test || exit 1
+echo ">>> Building vala (stage 1) <<<"
+cd "$CUR_DIR"
+VALAC="$CUR_DIR/subprojects/vala-bootstrap/_build/compiler/valac --vapidir=$CUR_DIR/vapi" \
+       meson _bootstrap -Dvaladoc=false -Ddefault_library=static || exit 1
+meson compile -C _bootstrap || exit 1
+meson test -C _bootstrap || exit 1
+
+echo ">>> Building vala (stage 2) <<<"
+cd "$CUR_DIR"
+VALAC="$CUR_DIR/_bootstrap/compiler/valac-$API --vapidir=$CUR_DIR/vapi" \
+       meson _build -Dprefix=/usr || exit 1
+meson compile -C _build || exit 1
+meson test -C _build || exit 1
diff --git a/subprojects/vala-bootstrap.wrap b/subprojects/vala-bootstrap.wrap
new file mode 100644
index 000000000..547caf5bc
--- /dev/null
+++ b/subprojects/vala-bootstrap.wrap
@@ -0,0 +1,5 @@
+[wrap-git]
+directory = vala-bootstrap
+url = https://gitlab.gnome.org/ricotz/vala-bootstrap.git
+revision = master
+depth = 1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]