wf-install/update_build.sh
Ilia Bozhinov e74718ad16 check whether sudo is required
Otherwise, we can just install without it.

Fixes #1
2020-03-22 13:46:32 +01:00

36 lines
701 B
Bash
Executable File

#!/bin/sh
set -e
set -o xtrace
BUILDROOT=$(realpath $1)
STREAM=$2
if [ "$STREAM" = "" ]; then
STREAM=master
fi
# First argument is the name of the component
build_component() {
SUDO=sudo
if [ ! -d $BUILDROOT/$1 ]; then
echo "Component $1 not found, skipping ..."
return
else
PREFIX=$(meson configure ./build | grep "Installation prefix" | awk '{print $2}')
if [ -w $PREFIX ]; then
SUDO=
fi
fi
cd $BUILDROOT/$1
git fetch origin
git checkout origin/${STREAM}
git submodule update --init
ninja -C build
$SUDO ninja -C build install
}
build_component wayfire
build_component wf-shell
build_component wcm