diff --git a/bin/breezy_gnome_setup b/bin/breezy_gnome_setup index 6ec8bb9..31fe60b 100755 --- a/bin/breezy_gnome_setup +++ b/bin/breezy_gnome_setup @@ -11,23 +11,40 @@ if [ "$(id -u)" == "0" ]; then exit 1 fi -start_dir=$(pwd) +check_command() { + if ! command -v "$1" &>/dev/null; then + echo "Please install \"$1\" and make sure it's available in your \$PATH, then rerun the setup." + exit 1 + fi +} + +check_command "gnome-shell" ARCH=$(uname -m) +FILE_NAME="breezyGNOME-$ARCH.tar.gz" +if [ "$(gnome-shell --version | cut -d' ' -f3 | cut -d'.' -f1)" -lt 45 ]; then + echo "Performing setup for GNOME 44 and below ($ARCH)" + FILE_NAME="breezyGNOME-44-max-$ARCH.tar.gz" +else + echo "Performing setup for GNOME 45 and up ($ARCH)" +fi + +start_dir=$(pwd) + # create temp directory tmp_dir=$(mktemp -d -t breezy-gnome-XXXXXXXXXX) pushd $tmp_dir > /dev/null echo "Created temp directory: ${tmp_dir}" -binary_download_url="https://github.com/wheaney/breezy-desktop/releases/latest/download/breezyGNOME-$ARCH.tar.gz" +binary_download_url="https://github.com/wheaney/breezy-desktop/releases/latest/download/$FILE_NAME" if [ "$1" = "-v" ] then metrics_version="$2" binary_path_arg="$3" elif [ "$1" = "--tag" ] && [ -n "$2" ] then - binary_download_url="https://github.com/wheaney/breezy-desktop/releases/download/$2/breezyGNOME-$ARCH.tar.gz" + binary_download_url="https://github.com/wheaney/breezy-desktop/releases/download/$2/$FILE_NAME" else binary_path_arg="$1" fi @@ -35,10 +52,10 @@ fi if [ -z "$binary_path_arg" ] then # download and unzip the binary - echo "Downloading to: ${tmp_dir}/breezyGNOME-$ARCH.tar.gz" + echo "Downloading to: ${tmp_dir}/$FILE_NAME" curl -L -O $binary_download_url - binary_path_arg="breezyGNOME-$ARCH.tar.gz" else + FILE_NAME=$(basename $binary_path_arg) if [[ "$binary_path_arg" = /* ]]; then abs_path="$binary_path_arg" else @@ -49,7 +66,7 @@ else fi echo "Extracting to: ${tmp_dir}/breezy_gnome" -tar -xf $(basename $binary_path_arg) +tar -xf $FILE_NAME pushd breezy_gnome > /dev/null diff --git a/bin/package_gnome b/bin/package_gnome index 9a5dd7f..b0e6c29 100755 --- a/bin/package_gnome +++ b/bin/package_gnome @@ -4,23 +4,26 @@ set -e ARCH=${ARCH:-$(uname -m)} -echo "Building Breezy GNOME for $ARCH" # https://stackoverflow.com/a/246128 SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) ROOT_DIR=$(realpath $SCRIPT_DIR/..) VULKAN_DIR=$ROOT_DIR/vulkan -# if GNOME_44_MAX is not set if [ -z "$GNOME_44_MAX" ]; then + # standard build for GNOME 45 and up + echo "Building Breezy GNOME for $ARCH, GNOME versions 45 and up" GNOME_DIR=$ROOT_DIR/gnome BUILD_FILE_NAME=breezyGNOME-$ARCH.tar.gz else + # special patched build for GNOME 44 and below + echo "Building Breezy GNOME for $ARCH, GNOME versions 44 and below" + # use a special directory for the GNOME 44 max build, ignored by git GNOME_DIR=$ROOT_DIR/gnome-44-max rm -rf $GNOME_DIR mkdir $GNOME_DIR - BUILD_FILE_NAME=breezyGNOME.44-max.$ARCH.tar.gz + BUILD_FILE_NAME=breezyGNOME-44-max-$ARCH.tar.gz # copy the GNOME extension source code to the new directory and apply # a patch that makes it compatible with GNOME 44 and below @@ -81,11 +84,11 @@ rm -rf $TMP_DIR cp $XR_DRIVER_BINARY $PACKAGE_DIR/xrDriver.tar.gz cp $XR_DRIVER_DIR/bin/xr_driver_setup $PACKAGE_DIR/bin -gnome/bin/package_extension -cp gnome/out/breezydesktop@xronlinux.com.shell-extension.zip $PACKAGE_DIR +$GNOME_DIR/bin/package_extension +cp $GNOME_DIR/out/breezydesktop@xronlinux.com.shell-extension.zip $PACKAGE_DIR # create a checksum that combines the checksums of all files in the directory -pushd gnome/src +pushd $GNOME_DIR/src GNOME_MANIFEST_LINE=$(find -L . -type f ! -name "*.compiled" -exec sha256sum {} \; | sort | sha256sum | sed 's/ .*//') popd