summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2023-03-17 10:32:33 +0100
committerMarge Bot <marge-bot@gnome.org>2023-05-16 18:20:42 +0000
commitd9c627cf277eb6ad7ada7112027ce13c80a68c18 (patch)
treeeacb766f649c52631fc0b6df43a3a129aa15ac17
parent241011313a07fc168f3a98eb711776cf511c6408 (diff)
downloadgnome-shell-d9c627cf277eb6ad7ada7112027ce13c80a68c18.tar.gz
tools/create-toolbox: Optionally create Builder config
It is possible to run gnome-shell nested from gnome-builder, but the setup is fairly tedious. Add another option to the script to generate a suitable .buildconfig file. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2713>
-rwxr-xr-xtools/toolbox/create-toolbox.sh31
1 files changed, 30 insertions, 1 deletions
diff --git a/tools/toolbox/create-toolbox.sh b/tools/toolbox/create-toolbox.sh
index 9f9eee070..400290103 100755
--- a/tools/toolbox/create-toolbox.sh
+++ b/tools/toolbox/create-toolbox.sh
@@ -18,6 +18,7 @@ usage() {
-v, --version=VERSION Create container for stable version VERSION
(like 44) instead of the main branch
-r, --replace Replace an existing container
+ -b, --builder Set up GNOME Builder configuration
--skip-mutter Do not build mutter
-h, --help Display this help
@@ -33,12 +34,33 @@ toolbox_run() {
toolbox run --container $NAME "$@"
}
+create_builder_config() {
+ local container_id=$(podman container inspect --format='{{.Id}}' $NAME)
+ local top_srcdir=$(realpath $(dirname $0)/../..)
+ local wayland_display=builder-wayland-0
+
+ cat >> $top_srcdir/.buildconfig <<-EOF
+
+ [toolbox-$NAME]
+ name=$NAME Toolbox
+ runtime=podman:$container_id
+ prefix=/usr
+ run-command=dbus-run-session gnome-shell --nested --wayland-display=$wayland_display
+
+ [toolbox-$NAME.runtime_environment]
+ WAYLAND_DISPLAY=$wayland_display
+ G_MESSAGES_DEBUG=GNOME Shell
+ XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/local/share:/usr/share}
+ EOF
+}
+
TEMP=$(getopt \
--name $(basename $0) \
- --options 'n:v:rh' \
+ --options 'n:v:rbh' \
--longoptions 'name:' \
--longoptions 'version:' \
--longoptions 'replace' \
+ --longoptions 'builder' \
--longoptions 'skip-mutter' \
--longoptions 'help' \
-- "$@")
@@ -65,6 +87,11 @@ while true; do
shift
;;
+ -b|--builder)
+ SETUP_BUILDER=1
+ shift
+ ;;
+
--skip-mutter)
SKIP_MUTTER=1
shift
@@ -94,3 +121,5 @@ podman pull $TOOLBOX_IMAGE:$TAG
toolbox create --image $TOOLBOX_IMAGE:$TAG $NAME
[[ $SKIP_MUTTER ]] || toolbox_run update-mutter
+
+[[ $SETUP_BUILDER ]] && create_builder_config