From 599b16834d8056cbd193c686617bb9a4a59182ff Mon Sep 17 00:00:00 2001 From: Scott Moreau Date: Mon, 23 Mar 2020 21:41:19 -0600 Subject: [PATCH 1/4] install.sh: Don't use sudo if sudo isn't available This might be the case on systems like debian. --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 0c6b4c3..e862cf6 100755 --- a/install.sh +++ b/install.sh @@ -80,7 +80,7 @@ function ask_confirmation { # Usually we use sudo, but if prefix is somewhere in ~/, we don't need sudo SUDO=sudo -if [ -w $PREFIX ]; then +if [ -w $PREFIX ] || ! which sudo > /dev/null; then SUDO= fi From 06f8a6d2ea25861d67be317aeadeef918e6af7b4 Mon Sep 17 00:00:00 2001 From: Scott Moreau Date: Mon, 23 Mar 2020 21:52:52 -0600 Subject: [PATCH 2/4] install.sh: Set CAP_SYS_ADMIN if neither systemd nor elogind is found --- install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install.sh b/install.sh index e862cf6..fbcc710 100755 --- a/install.sh +++ b/install.sh @@ -121,6 +121,10 @@ PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX}/${DEST_LIBDIR}/pkgconfig meson build ninja -C build $SUDO ninja -C build install +if ! pkg-config --exists libsystemd && ! pkg-config --exists libelogind && pkg-config --exists libcap; then + $SUDO setcap cap_sys_admin=eip "$PREFIX/bin/wayfire" +fi + # Install a minimalistic, but still usable configuration # First argument is the name of the file # Second argument is the name of the template From af11c9c62c7fc7e0f8338e183a75a792523a1b99 Mon Sep 17 00:00:00 2001 From: Scott Moreau Date: Tue, 24 Mar 2020 03:21:42 -0600 Subject: [PATCH 3/4] install.sh: Use path where the script lives as the build root Using /home/scott/src/wayland/wayfire/wf-install assumes the script is being run from the repo directory. Instead we should get the path by changing into dirname $0 directory first and then using pwd -P. --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index fbcc710..ed2835f 100755 --- a/install.sh +++ b/install.sh @@ -66,7 +66,7 @@ fi echo "Building Wayfire $STREAM" echo "Installation prefix: $PREFIX" -BUILDROOT=$(pwd) +BUILDROOT="$(cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)" function ask_confirmation { while true; do read -p "$1" yn From dfbd3744a8bbc5294358889691c2753197af3d00 Mon Sep 17 00:00:00 2001 From: Scott Moreau Date: Mon, 23 Mar 2020 22:51:54 -0600 Subject: [PATCH 4/4] install.sh: Install start_wayfire.sh as /bin/startwayfire --- install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index ed2835f..12f8355 100755 --- a/install.sh +++ b/install.sh @@ -158,8 +158,9 @@ if [ ${PREFIX} != '/usr' ]; then sed -i "s@^PATH.*@export PATH=\$PATH:${PREFIX}/bin@g" $BUILDROOT/start_wayfire.sh fi chmod 755 $BUILDROOT/start_wayfire.sh +$SUDO cp $BUILDROOT/start_wayfire.sh $PREFIX/bin/startwayfire -echo "Installation done. You can put start_wayfire.sh in your PATH and use it to start Wayfire." +echo "Installation done. Run $PREFIX/bin/startwayfire to start wayfire." ask_confirmation "Do you want to install WCM, a graphical configuration tool for Wayfire [y/n]? " if [ $yn = Y ]; then