Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/build-appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,19 @@ jobs:

- name: Download appimagetool
run: |
wget https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage -O appimagetool
wget https://github.com/AppImage/appimagetool/releases/download/1.9.0/appimagetool-x86_64.AppImage -O appimagetool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is a tagged version, could we check this against a known good hash maybe? just to make sure the bin in the release isn't swapped out

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so they don't post a hash on their github. should i just set the result of a sha256 or something on the existing file?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like i could run the command right now, but that's just from me, and you might not trust me. how do we come up with a known good hash when the AppImage devs don't provide one already?

chmod +x appimagetool

- name: Build AppImage
run: |
chmod +x build_appimage.sh
./build_appimage.sh

- name: Build Nightly AppImage based on dev
run: |
chmod +x build_appimage.sh
./build_appimage_nightly.sh

- name: Upload AppDir
uses: actions/upload-artifact@v4
with:
Expand All @@ -78,3 +83,9 @@ jobs:
with:
name: Telescope-x86_64.AppImage
path: Telescope-x86_64.AppImage

- name: Upload Nightly AppImage
uses: actions/upload-artifact@v4
with:
name: Telescope-Nightly-x86_64.AppImage
path: Telescope-Nightly-x86_64.AppImage
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
result/
*.AppImage
Telescope*.AppDir
protostar
*.tar.gz
appimagetool
7 changes: 7 additions & 0 deletions AppDir/AppRun
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
export TELESCOPE_PATH="$APPDIR/usr/bin"
export OLD_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$APPDIR/usr/lib:$OLD_LD_LIBRARY_PATH"
export STARDUST_THEMES="$APPDIR/usr/share"

$TELESCOPE_PATH/stardust-xr-server -o 6 -e "$TELESCOPE_PATH/startup_script" "$@"
6 changes: 6 additions & 0 deletions AppDir/Telescope.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Desktop Entry]
Name=Telescope
Exec=AppRun
Icon=stardust
Type=Application
Categories=Utility;
Binary file added AppDir/stardust.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added AppDir/usr/bin/execs_go_here
Empty file.
8 changes: 8 additions & 0 deletions AppDir/usr/bin/startup_script
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
export LD_LIBRARY_PATH="$OLD_LD_LIBRARY_PATH"
# xwayland-satellite :10 &
# export DISPLAY=:10

$TELESCOPE_PATH/flatland &
$TELESCOPE_PATH/gravity -- 0 0.0 -0.5 $TELESCOPE_PATH/hexagon_launcher &
$TELESCOPE_PATH/black-hole &
Empty file added AppDir/usr/lib/libs_go_here
Empty file.
87 changes: 32 additions & 55 deletions build_appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ set -x
# Function to install a repository with musl and custom binary name
install_client_multi() {
local repo=$1
local revision=$2
local package_name=$3
local package_name=$2
local revision=$3

echo "Installing $repo with musl..."
git clone "https://github.com/StardustXR/$repo.git" "$repo"
local repo_dir="$repo"
git -C "$repo_dir" checkout "$revision"
if [ "$revision" ]; then
git -C "$repo_dir" checkout "$revision"
fi

# install resources
if [ -d "$repo_dir/res" ]; then
Expand All @@ -26,22 +28,29 @@ install_client_multi() {

cargo install --locked --path "$repo_dir" --root "Telescope.AppDir/usr"


rm -rf "$repo"
}
# Function to install a repository with musl
install_client() {
local repo=$1
local revision=$2
install_client_multi "$repo" "$revision" "${repo//-/_}"
if [ -n "$revision" ]; then
install_client_multi "$repo" "${repo//-/_}" "$revision"
else
install_client_multi "$repo" "${repo//-/_}"
fi
}

# Function to install the server with glibc
install_server() {
local revision=$1

echo "Installing server with glibc..."
cargo install --locked --git "https://github.com/StardustXR/server.git" --rev "$revision" --root "Telescope.AppDir/usr"
if [ -z "$revision" ]; then
cargo install --locked --git "https://github.com/StardustXR/server.git" --root "Telescope.AppDir/usr"
else
cargo install --locked --git "https://github.com/StardustXR/server.git" --rev "$revision" --root "Telescope.AppDir/usr"
fi
}

# Function to include system libraries in the AppImage
Expand All @@ -52,7 +61,8 @@ include_system_library() {
}

# Create AppDir structure
mkdir -p "Telescope.AppDir/usr/bin" "Telescope.AppDir/usr/lib" "Telescope.AppDir/usr/share"
# takes less code to just have the thing there
cp -rf AppDir Telescope.AppDir

# Include system libraries
# include_system_library "libxkbcommon.so.0"
Expand Down Expand Up @@ -85,64 +95,31 @@ mkdir -p "Telescope.AppDir/usr/bin" "Telescope.AppDir/usr/lib" "Telescope.AppDir
# include_system_library "libbrotlicommon.so.1"
# include_system_library "libpcre2-8.so.0"

install_server "0.50.0"
# Install server with glibc
install_server

install_client "flatland" "0.50.0"
install_client_multi "protostar" "0.50.0" "hexagon_launcher"
install_client "gravity" "0.50.0"
install_client "black-hole" "0.50.0"
install_client "solar-sailer" "0.50.0"
# Install clients with musl
install_client "flatland"
install_client_multi "protostar" "hexagon_launcher"
install_client "gravity"
install_client "black-hole"
install_client "solar-sailer"

install_client_multi "non-spatial-input" "0.50.0" "manifold"
install_client_multi "non-spatial-input" "0.50.0" "simular"
install_client_multi "non-spatial-input" "manifold"
install_client_multi "non-spatial-input" "simular"

cargo install --locked --git "https://github.com/Supreeeme/xwayland-satellite" --rev "v0.7" --root "Telescope.AppDir/usr"

# Create startup script
cat << EOF > "Telescope.AppDir/usr/bin/startup_script"
#!/bin/bash
export LD_LIBRARY_PATH="\$OLD_LD_LIBRARY_PATH"
xwayland-satellite :10 &
export DISPLAY=:10

\$TELESCOPE_PATH/flatland &
\$TELESCOPE_PATH/gravity -- 0 0.0 -0.5 \$TELESCOPE_PATH/hexagon_launcher &
\$TELESCOPE_PATH/gravity -- 0 0.1 -0.5 \$TELESCOPE_PATH/solar-sailer &
\$TELESCOPE_PATH/black-hole &

WAYLAND_DISPLAY=\$FLAT_WAYLAND_DISPLAY \$TELESCOPE_PATH/manifold | \$TELESCOPE_PATH/simular &
EOF
chmod +x "Telescope.AppDir/usr/bin/startup_script"

# Create AppRun script
cat << EOF > "Telescope.AppDir/AppRun"
#!/bin/bash
export TELESCOPE_PATH="\$APPDIR/usr/bin"
export OLD_LD_LIBRARY_PATH="\$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="\$APPDIR/usr/lib:\$OLD_LD_LIBRARY_PATH"
export STARDUST_THEMES="\$APPDIR/usr/share"

\$TELESCOPE_PATH/stardust-xr-server -o 6 -e "\$TELESCOPE_PATH/startup_script" \$@
EOF
chmod +x "Telescope.AppDir/AppRun"

# Create desktop file
cat << EOF > "Telescope.AppDir/telescope.desktop"
[Desktop Entry]
Name=Telescope
Exec=AppRun
Icon=stardust
Type=Application
Categories=Utility;
EOF

# Download icon
wget https://raw.githubusercontent.com/StardustXR/assets/main/icon.png -O "Telescope.AppDir/stardust.png"

# Create tarball of AppDir
tar -czvf Telescope-x86_64.tar.gz Telescope.AppDir

# Create AppImage
if [ ! -e "./appimagetool" ]; then
wget https://github.com/AppImage/appimagetool/releases/download/1.9.0/appimagetool-x86_64.AppImage -O appimagetool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

especially on user machines, please check for a known hash here

chmod u+x appimagetool
fi

./appimagetool "Telescope.AppDir" Telescope-x86_64.AppImage

echo "AppImage created: Telescope-x86_64.AppImage"
103 changes: 103 additions & 0 deletions build_appimage_nightly.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#!/bin/bash

set -e
set -x
# Function to install a repository with musl and custom binary name
install_client_multi() {
local repo=$1
local package_name=$2

echo "Installing $repo with musl..."
git clone "https://github.com/StardustXR/$repo.git" "$repo"
local repo_dir="$repo"
git -C "$repo_dir" switch dev

# install resources
if [ -d "$repo_dir/res" ]; then
cp -r "$repo_dir/res"/* "Telescope-Nightly.AppDir/usr/share/"
fi

# Check if it's a workspace or a single package
if [ -f "$repo_dir/Cargo.toml" ] && grep -q '^\[workspace\]' "$repo_dir/Cargo.toml"; then
# It's a workspace, assume the package is there
repo_dir="$repo_dir/$package_name"
fi

cargo install --locked --path "$repo_dir" --target x86_64-unknown-linux-musl --root "Telescope-Nightly.AppDir/usr"

rm -rf "$repo"
}
# Function to install a repository with musl
install_client() {
local repo=$1
install_client_multi "$repo" "${repo//-/_}"
}

# Function to install the server with glibc
install_server() {
echo "Installing server with glibc..."
cargo install --locked --target x86_64-unknown-linux-gnu --git "https://github.com/StardustXR/server.git" --branch "dev" --root "Telescope-Nightly.AppDir/usr"
}

# Function to include system libraries in the AppImage
include_system_library() {
local library=$1
echo "Including system library: $library"
cp -L $(ldconfig -p | grep "$library" | awk '{print $NF}' | head -n 1) "Telescope-Nightly.AppDir/usr/lib/"
}

# Create AppDir structure
# takes less code to just have the thing there
cp -rf AppDir Telescope-Nightly.AppDir

# Include system libraries
# include_system_library "libxkbcommon.so.0"
# include_system_library "libstdc++.so.6"
# include_system_library "libopenxr_loader.so.1"
# include_system_library "libX11.so.6"
# include_system_library "libXfixes.so.3"
# include_system_library "libgbm.so.1"
# include_system_library "libfontconfig.so.1"
# include_system_library "libgcc_s.so.1"
# include_system_library "libjsoncpp.so.25"
# include_system_library "libxcb.so.1"
# include_system_library "libGLdispatch.so.0"
# include_system_library "libdrm.so.2"
# include_system_library "libwayland-server.so.0"
# include_system_library "libexpat.so.1"
# include_system_library "libxcb-randr.so.0"
# include_system_library "libfreetype.so.6"
# include_system_library "libxml2.so.2"
# include_system_library "libXau.so.6"
# include_system_library "libffi.so.8"
# include_system_library "libz.so.1"
# include_system_library "libbz2.so.1"
# include_system_library "libpng16.so.16"
# include_system_library "libharfbuzz.so.0"
# include_system_library "libbrotlidec.so.1"
# include_system_library "liblzma.so.5"
# include_system_library "libglib-2.0.so.0"
# include_system_library "libgraphite2.so.3"
# include_system_library "libbrotlicommon.so.1"
# include_system_library "libpcre2-8.so.0"

# Install server with glibc
install_server

# Install clients with musl
install_client "flatland"
install_client_multi "protostar" "hexagon_launcher"
install_client "gravity"
install_client "black-hole"

# Create tarball of AppDir
tar -czvf Telescope-x86_64.tar.gz Telescope-Nightly.AppDir

# Create AppImage
if [ ! -e "./appimagetool" ]; then
wget https://github.com/AppImage/appimagetool/releases/download/1.9.0/appimagetool-x86_64.AppImage -O appimagetool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, please check for a known hash

chmod u+x appimagetool
fi
./appimagetool "Telescope-Nightly.AppDir" Telescope-Nightly-x86_64.AppImage

echo "AppImage created: Telescope-Nightly-x86_64.AppImage"