[PATCH wayland-build-tools] Add helper script to setup and use an uninstalled environment

Derek Foreman derekf at osg.samsung.com
Tue Aug 30 18:56:54 UTC 2016


From: "Reynaldo H. Verdejo Pinochet" <reynaldo at osg.samsung.com>

The wl_uninstalled script provides a shell environment to
build and use an uninstalled Wayland/Weston setup.

For example, this script and a fresh checkout of Wayland,
libinput, wayland-protocols and Weston is all you need to
run Weston from the uninstalled environment created by
building every module. No installation required.

Quick instructions:

Lets use Weston as an example altough other Wayland-based
software should work as well.

Edit a local copy of the script to make $WLD point to the
base directory where your repositories are (make sure to
use the absolute paths), then, after executing the script,
issue the following commands to have everything built and
Weston runing from the uninstalled environment.

cd <basedir>
for i in wayland wayland-protocols libinput weston; do
cd $i && ./autogen.sh && make && cd ..; done
cd weston
weston &

Signed-off-by: Reynaldo H. Verdejo Pinochet <reynaldo at osg.samsung.com>
Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
---

Right now this script requires a couple of wayland/weston patches currently
on the mailing list to fix or add pkg-config -uninstalled files.


 README         |  35 +++++++++++++++-
 wl_uninstalled | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 161 insertions(+), 1 deletion(-)
 create mode 100755 wl_uninstalled

diff --git a/README b/README
index b7eea61..88128b3 100644
--- a/README
+++ b/README
@@ -1,4 +1,5 @@
 Wayland Build Tools
+-------------------
 
 These are scripts that automate the standard Wayland build and installation
 directions (http://wayland.freedesktop.org/building.html), and take care of
@@ -48,6 +49,38 @@ Step 6: Run Weston
         source ~/.config/wayland-build-tools/wl_defines.sh
         weston
 
-
 Build scripts and configuration for other distros are welcome. For more
 details, see https://blogs.s-osg.org/kick-waylands-tires-wayland-build-tools.
+
+
+Wayland Uninstalled
+-------------------
+
+We now also include a helper script, wl_uninstalled, to build and work with an
+uninstalled wayland/weston environment comprised of the following repositories:
+
+wayland
+wayland-protocols
+libinput
+weston
+
+
+The wl_uninstalled script provides a shell environment in which all build and
+run run-time dependencies are resolved in such a way that the uninstalled
+versions of the above projects take precedence.
+
+Quick instructions:
+
+Let's use Weston as an example although other wayland-based projects should work
+as well.
+
+* Edit a local copy of the script to make $WLD point to the base directory
+  where your repositories are (make sure to use the absolute paths), then,
+  after executing the script, issue the following commands to have everything
+  built and weston running from the uninstalled environment.
+
+    cd $WLD
+    for i in wayland wayland-protocols libinput weston; do
+    cd $i && ./autogen.sh && make && cd ..; done
+    cd weston
+    weston &
diff --git a/wl_uninstalled b/wl_uninstalled
new file mode 100755
index 0000000..be92aaf
--- /dev/null
+++ b/wl_uninstalled
@@ -0,0 +1,127 @@
+#!/bin/bash -i
+#
+# Copyright (C) 2016 Samsung Electronics. All rights reserved.
+#
+#   Author: Reynaldo H. Verdejo Pinochet <reynaldo at osg.samsung.com>
+#           Derek Foreman <derekf at osg.samsung.com>
+#
+# Based on GStreamer's gst-uninstalled (http://gstreamer.freedesktop.org/)
+#
+# This script provides a shell environment to build and use an uninstalled
+# wayland/weston setup, consisting mostly of checked out and built (no
+# "make install" required) Wayland repositories.
+#
+# Here is the list of required repositories:
+#
+# wayland           git://anongit.freedesktop.org/wayland/wayland
+# wayland-protocols git://anongit.freedesktop.org/wayland/wayland-protocols
+# libinput          git://anongit.freedesktop.org/wayland/libinput
+# weston            git://anongit.freedesktop.org/wayland/weston
+#
+
+if [ "$1"yes != "yes" ]; then
+  cat << EOF
+
+This script uses no arguments. Aborting execution.
+
+The following parameter was not understood:
+
+"$@"
+
+Quick instructions:
+
+1.- Clone the required repositories:
+
+    wayland           git://anongit.freedesktop.org/wayland/wayland
+    wayland-protocols git://anongit.freedesktop.org/wayland/wayland-protocols
+    libinput          git://anongit.freedesktop.org/wayland/libinput
+    weston            git://anongit.freedesktop.org/wayland/weston
+
+2.- Set the WLD variable here to point to the directory you
+    put your Wayland repositories at. Rest should remain untouched.
+
+3.- Execute the script. If everything goes OK, you should start
+    seeing a "[WAYLAND UNINSTALLED]" line being printed before each
+    shell prompt to remind you that you are on a wayland uninstalled
+    environment.
+
+4.- Configure and build the above projects in the order they are listed
+    in this document.
+
+5.- Run something wayland-ish, like weston, and it will use the same
+    Wayland uninstalled environment used to build.
+
+6.- To exit the Wayland uninstalled shell just use the 'exit' command.
+
+EOF
+  exit -1
+fi
+
+WLD=$HOME/devel/wayland/git
+
+# Set up PATHs
+
+LD_LIBRARY_PATH="\
+$WLD/wayland/.libs\
+:$WLD/libinput/src/.libs\
+:$WLD/weston/.libs/\
+${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
+
+WESTON_BUILD_DIR="\
+$WLD/weston/\
+${WESTON_BUILD_DIR:+:$WESTON_BUILD_DIR}"
+
+PKG_CONFIG_PATH="\
+$WLD/wayland/src/\
+:$WLD/wayland/cursor/\
+:$WLD/wayland-protocols/\
+:$WLD/libinput/src/\
+:$WLD/lib/pkgconfig/\
+:$WLD/share/pkgconfig/\
+:$WESTON_BUILD_DIR/compositor/\
+:$WESTON_BUILD_DIR/libweston/\
+:$WESTON_BUILD_DIR/libweston-desktop/\
+${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
+
+PATH="\
+$WLD/wayland/\
+:$WLD/weston/\
+:$PATH"
+
+# Export new environment
+
+export WLD
+export LD_LIBRARY_PATH
+export PKG_CONFIG_PATH
+export WESTON_BUILD_DIR
+export PATH
+
+cat << EOF
+
+The following environment has been exported:
+
+WLD=$WLD
+LD_LIBRARY_PATH=$LD_LIBRARY_PATH
+PKG_CONFIG_PATH=$PKG_CONFIG_PATH
+WESTON_BUILD_DIR=$WESTON_BUILD_DIR
+PATH=$PATH
+
+----------------------
+
+EOF
+
+cd $WLD
+shell=$SHELL
+
+# Do not load local startup files
+if test "x$SHELL" = "x/bin/bash"
+then
+  shell="$SHELL --noprofile"
+fi
+
+# Launch shell. Remember the user this is a Wayland uninstalled
+# before each prompt.
+
+PROMPT_COMMAND="echo [WAYLAND UNINSTALLED]" $shell
+
+
-- 
2.9.3



More information about the wayland-devel mailing list