[PATCH v2 wayland-build-tools] Add helper script to setup and use an uninstalled environment
Bryce Harrington
bryce at osg.samsung.com
Thu Sep 8 06:04:48 UTC 2016
On Wed, Sep 07, 2016 at 01:26:03PM -0500, Derek Foreman wrote:
> From: "Reynaldo H. Verdejo Pinochet" <reynaldo at osg.samsung.com>
>
> This is an alternative to developing with a --prefixed
> installation, and is a familiar workflow for developers
> coming from some projects (such as gstreamer). Compared to
> a prefixed installation it saves a small amount of time
> (primarily due to relinking during make install) and
> space.
>
> 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). You can also set the WLD
> environment variable before calling the script and leave
> the file untouched. 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>
Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
Thanks, landed:
5e57af4..b6926c0 master -> master
> ---
> Changes since v1:
> Allow setting the WLD variable before running the script
> Some changes to the text in the commit log
>
> README | 35 ++++++++++++++-
> wl_uninstalled | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 167 insertions(+), 1 deletion(-)
> create mode 100755 wl_uninstalled
>
> diff --git a/README b/README
> index b7eea61..c65fe4f 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). You can
> + also set the WLD environment variable to a path of your choice and leave
> + the script untouched. 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
> + weston &
> diff --git a/wl_uninstalled b/wl_uninstalled
> new file mode 100755
> index 0000000..63ff907
> --- /dev/null
> +++ b/wl_uninstalled
> @@ -0,0 +1,133 @@
> +#!/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.
> + Instead of setting this variable here, you can also export it
> + before the script is executed and leave the latter 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
> +
> +if [ -z "$WLD" ]; then
> + WLD=$HOME/devel/wayland/git
> + echo Wayland uninstalled root not set \(WLD\). Using script default \
> + \'$WLD\'
> +fi
> +
> +# 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
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list