94 lines
2.9 KiB
Bash
Executable File
94 lines
2.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# exit when any command fails
|
|
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
|
|
GNOME_DIR=$ROOT_DIR/gnome
|
|
GNOME_BUILD_DIR=$GNOME_DIR/build
|
|
BUILD_FILE_NAME=breezyGNOME-$ARCH.tar.gz
|
|
|
|
mkdir -p $GNOME_BUILD_DIR
|
|
if [ -e "$GNOME_BUILD_DIR/$BUILD_FILE_NAME" ]; then
|
|
rm $GNOME_BUILD_DIR/$BUILD_FILE_NAME
|
|
fi
|
|
|
|
PACKAGE_DIR=$GNOME_BUILD_DIR/breezy_gnome
|
|
rm -rf $PACKAGE_DIR
|
|
mkdir -p $PACKAGE_DIR
|
|
|
|
XREAL_DRIVER_DIR=$ROOT_DIR/modules/XRLinuxDriver
|
|
source $XREAL_DRIVER_DIR/bin/inject_ua
|
|
|
|
# if a custom_banner image exists, copy it over the sombrero one
|
|
if [ -e "$VULKAN_DIR/custom_banner.png" ]; then
|
|
cp $VULKAN_DIR/custom_banner.png $PACKAGE_DIR
|
|
fi
|
|
|
|
# copy vulkan setup scripts and configs
|
|
mkdir -p $PACKAGE_DIR/bin
|
|
copy_and_inject_ua "$XREAL_DRIVER_DIR/bin/ua.sh" "$PACKAGE_DIR/bin" "$GNOME_DIR/bin/setup" "$GNOME_DIR/bin/breezy_gnome_verify" "$GNOME_DIR/bin/breezy_gnome_uninstall"
|
|
|
|
XREAL_BINARY=$XREAL_DRIVER_DIR/out/xrealAirLinuxDriver-$ARCH.tar.gz
|
|
pushd $XREAL_DRIVER_DIR
|
|
|
|
if [ ! -e "$XREAL_BINARY" ] || [ "$1" == "--rebuild-driver" ]; then
|
|
# if a file exists at custom_banner_config.yml, copy it to the xrealAirLinuxDriver directory
|
|
if [ -e "$VULKAN_DIR/custom_banner_config.yml" ]; then
|
|
cp $VULKAN_DIR/custom_banner_config.yml $XREAL_DRIVER_DIR
|
|
fi
|
|
|
|
# strange issue where the base library produces a .so file if the build is not cleaned
|
|
rm -rf build/
|
|
|
|
docker-build/init.sh
|
|
BREEZY_DESKTOP=1 docker-build/run-build.sh $ARCH
|
|
fi
|
|
popd
|
|
|
|
TMP_DIR=$(mktemp -d -t breezy-gnome-XXXXXXXXXX)
|
|
pushd $TMP_DIR
|
|
cp $XREAL_BINARY $TMP_DIR/xrealAirLinuxDriver.tar.gz
|
|
tar -xf $TMP_DIR/xrealAirLinuxDriver.tar.gz
|
|
|
|
XREAL_MANIFEST_LINE=$(sha256sum driver_air_glasses/manifest)
|
|
popd
|
|
rm -rf $TMP_DIR
|
|
|
|
cp $XREAL_BINARY $PACKAGE_DIR/xrealAirLinuxDriver.tar.gz
|
|
cp $XREAL_DRIVER_DIR/bin/xreal_driver_setup $PACKAGE_DIR/bin
|
|
|
|
gnome/bin/package_extension
|
|
cp gnome/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
|
|
GNOME_MANIFEST_LINE=$(find -L . -type f ! -name "*.compiled" -exec sha256sum {} \; | sort | sha256sum | sed 's/ .*//')
|
|
popd
|
|
|
|
ui/bin/package $ARCH
|
|
cp ui/out/com.xronlinux.BreezyDesktop-$ARCH.flatpak $PACKAGE_DIR/com.xronlinux.BreezyDesktop.flatpak
|
|
|
|
# create manifest file for verifying installed file checksums against the originally packaged versions
|
|
# include any file that doesn't get modified during setup (e.g. vkBasalt.json files)
|
|
pushd $PACKAGE_DIR
|
|
echo $XREAL_MANIFEST_LINE > manifest
|
|
echo -e "$GNOME_MANIFEST_LINE breezydesktop@xronlinux.com" >> manifest
|
|
popd
|
|
|
|
# bundle everything up
|
|
pushd $GNOME_BUILD_DIR
|
|
tar -zcvf $BUILD_FILE_NAME breezy_gnome
|
|
popd
|
|
|
|
mkdir -p out
|
|
if [ -e "out/$BUILD_FILE_NAME" ]; then
|
|
rm out/$BUILD_FILE_NAME
|
|
fi
|
|
cp $GNOME_BUILD_DIR/$BUILD_FILE_NAME out |