Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling arm64 support for omakub #29

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from 19 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
7 changes: 6 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Determine architecture
ARCH=$(dpkg --print-architecture)
export ARCH

Copy link
Member

Choose a reason for hiding this comment

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

One nice property of the install/* scripts is that they can be invoked independently. Introducing global env vars breaks that. Would keep this invocation in each script.

Alternatively, you could

: "${ARCH:=$(dpkg --print-architecture)}"

in the scripts to lazy-set the env var.

# Be fancy
source ~/.local/share/omakub/ascii.sh

Expand All @@ -18,9 +22,10 @@ for script in ~/.local/share/omakub/install/*.sh; do source $script; done
# Upgrade everything that might ask for a reboot last
sudo apt upgrade -y


# Revert to normal idle and lock settings
gsettings set org.gnome.desktop.screensaver lock-enabled true
gsettings set org.gnome.desktop.session idle-delay 300

# Logout to pickup changes
gum confirm "Ready to logout for all settings to take effect?" && gnome-session-quit --logout --no-prompt
gum confirm "Ready to logout for all settings to take effect?" && gnome-session-quit --logout --no-prompt
iljo-dp marked this conversation as resolved.
Show resolved Hide resolved
17 changes: 12 additions & 5 deletions install/app-1password.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
cd ~/Downloads
wget https://downloads.1password.com/linux/debian/amd64/stable/1password-latest.deb
sudo apt install -y ./1password-latest.deb
rm 1password-latest.deb
cd -
if [[ $ARCH == "amd64" ]]; then
wget https://downloads.1password.com/linux/debian/amd64/stable/1password-latest.deb
sudo apt install -y ./1password-latest.deb
rm 1password-latest.deb
elif [[ $ARCH == "arm64" ]]; then
curl -sSO https://downloads.1password.com/linux/tar/stable/aarch64/1password-latest.tar.gz
sudo tar -xf 1password-latest.tar.gz
sudo mkdir -p /opt/1Password
sudo mv 1password-*/* /opt/1Password
sudo /opt/1Password/after-install.sh
rm 1password-latest.tar.gz
fi
12 changes: 8 additions & 4 deletions install/app-chrome.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
cd ~/Downloads
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
rm google-chrome-stable_current_amd64.deb
cd -
if [[ $ARCH == "amd64" ]]; then
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
rm google-chrome-stable_current_amd64.deb
elif [[ $ARCH == "arm64" ]]; then
Copy link

@dre-hh dre-hh Jun 17, 2024

Choose a reason for hiding this comment

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

chromium has no widevine on arm64, thereofre cannot play netflix, spotify etc.
Also it might require certain flags for launching with gpu acceleration suuport to watch youtube properly. (guess the latter can only be properly tested on the actual device)
For widevine people often pull some bins from chromeos projects

Copy link

@dre-hh dre-hh Jun 28, 2024

Choose a reason for hiding this comment

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

After some recent reserach on this, there is still no binary package with widevine for ubuntu or an arm browser which ships with it.

AsahiLinux is hosting a widevine installer script from crhomeos project which is pulling it from googleapis.com

And Brave browser published a manual how to link it #28903.

Chrome has released an arm64 version for windows. Guess a an arm chrome with widevine support is also likely to happen in future. But for now, probably going asahilinux way is best: adding custom installer, updater via chromeos binaries. Probably its best done in another PR once arm support ist merged

sudo apt install chromium-browser -y
fi
cd -
8 changes: 4 additions & 4 deletions install/app-github-cli.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg &&
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg &&
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list >/dev/null &&
sudo apt update &&
sudo apt install gh -y
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg &&
echo "deb [arch=$ARCH signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list >/dev/null &&
sudo apt update &&
sudo apt install gh -y
iljo-dp marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions install/app-gum.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Gum is used for the Omakub commands for tailoring Omakub after the initial install
cd ~/Downloads
GUM_VERSION="0.14.1" # Use known good version
wget -O gum.deb "https://github.com/charmbracelet/gum/releases/latest/download/gum_${GUM_VERSION}_amd64.deb"
wget -O gum.deb "https://github.com/charmbracelet/gum/releases/latest/download/gum_${GUM_VERSION}_${ARCH}.deb"
sudo apt install -y ./gum.deb
rm gum.deb
cd -
cd -
9 changes: 8 additions & 1 deletion install/app-lazydocker.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
cd ~/Downloads
LAZYDOCKER_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazydocker/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -sLo lazydocker.tar.gz "https://github.com/jesseduffield/lazydocker/releases/latest/download/lazydocker_${LAZYDOCKER_VERSION}_Linux_x86_64.tar.gz"

if [[ "$ARCH" == "arm64" ]]; then
LAZYDOCKER_ARCH="x86_64"
else
LAZYDOCKER_ARCH="$ARCH"
fi

curl -sLo lazydocker.tar.gz "https://github.com/jesseduffield/lazydocker/releases/latest/download/lazydocker_${LAZYDOCKER_VERSION}_Linux_${LAZYDOCKER_ARCH}.tar.gz"fi
tar -xf lazydocker.tar.gz lazydocker
sudo install lazydocker /usr/local/bin
rm lazydocker.tar.gz lazydocker
Expand Down
8 changes: 7 additions & 1 deletion install/app-lazygit.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
cd ~/Downloads
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
curl -sLo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"

#For some reason, Lazygit uses x86_64 instead of amd64 for naming, which means we can't use the variable ARCH for a 1 liner
iljo-dp marked this conversation as resolved.
Show resolved Hide resolved
if [[ $ARCH == "arm64" ]]; then
curl -sLo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit${LAZYGIT_VERSION}_Linux_${ARCH}.tar.gz"
elif [[ $ARCH == "amd64" ]]; then
curl -sLo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/latest/download/lazygit${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
fi
tar -xf lazygit.tar.gz lazygit
sudo install lazygit /usr/local/bin
rm lazygit.tar.gz lazygit
Expand Down
9 changes: 7 additions & 2 deletions install/app-localsend.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
cd ~/Downloads
LOCALSEND_VERSION=$(curl -s "https://api.github.com/repos/localsend/localsend/releases/latest" | grep -Po '"tag_name": "v\K[^"]*')
wget -O localsend.deb "https://github.com/localsend/localsend/releases/latest/download/LocalSend-${LOCALSEND_VERSION}-linux-x86-64.deb"
#For some reason, Localsend uses x86_64 instead of amd64 for naming, which means we can't use the variable ARCH for a 1 liner
iljo-dp marked this conversation as resolved.
Show resolved Hide resolved
if [[ $ARCH == "arm64" ]]; then
wget -O localsend.deb "https://github.com/localsend/localsend/releases/latest/download/LocalSend-${LOCALSEND_VERSION}-linux-arm-64.deb"
elif [[ $ARCH == "amd64" ]]; then
wget -O localsend.deb "https://github.com/localsend/localsend/releases/latest/download/LocalSend-${LOCALSEND_VERSION}-linux-x86-64.deb"
fi
sudo apt install -y ./localsend.deb
rm localsend.deb
cd -
cd -
5 changes: 3 additions & 2 deletions install/app-pinta.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# FIXME: Get this out of snap
sudo snap install pinta
sudo add-apt-repository -y ppa:pinta-maintainers/pinta-stable
sudo apt-get update
sudo apt-get install -y pinta
iljo-dp marked this conversation as resolved.
Show resolved Hide resolved
13 changes: 9 additions & 4 deletions install/app-signal.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
wget -qO- https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor >signal-desktop-keyring.gpg
cat signal-desktop-keyring.gpg | sudo tee /usr/share/keyrings/signal-desktop-keyring.gpg >/dev/null
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' |
sudo tee /etc/apt/sources.list.d/signal-xenial.list
sudo apt update
sudo apt install -y signal-desktop

if [[ $ARCH == "amd64" ]]; then
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' |
sudo tee /etc/apt/sources.list.d/signal-xenial.list
sudo apt update
sudo apt install -y signal-desktop
elif [[ $ARCH == "arm64" ]]; then
echo "Signal Desktop is only available for amd64 architecture."
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

oh wow, sounds great I'il look into it soon :D

Choose a reason for hiding this comment

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

Or use snap: sudo snap install signal-desktop

fi
22 changes: 19 additions & 3 deletions install/app-spotify.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
curl -sS https://download.spotify.com/debian/pubkey_6224F9941A8AA6D1.gpg | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/spotify.gpg
echo "deb [signed-by=/etc/apt/trusted.gpg.d/spotify.gpg] http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list
sudo apt update
sudo apt install -y spotify-client
if [[ $ARCH == "amd64" ]]; then
echo "deb [signed-by=/etc/apt/trusted.gpg.d/spotify.gpg] http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list
sudo apt update
sudo apt install -y spotify-client
elif [[ $ARCH == "arm64" ]]; then
cat <<EOF > ~/.local/share/applications/Spotify.desktop
[Desktop Entry]
Version=1.0
Name=Spotify
Comment=Spotify online music player
Exec=xdg-open --app=https://open.spotify.com/ --name=Spotify
Copy link

@dre-hh dre-hh Jun 17, 2024

Choose a reason for hiding this comment

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

Is this opening in Chromium? I believe that also won't run without widevine

Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/web-apps/icons/Spotify.png
Categories=GTK,Network,Music;
MimeType=text/html;text/xml;application/xhtml_xml;
StartupNotify=true
EOF
fi
9 changes: 7 additions & 2 deletions install/app-vscode.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
cd ~/Downloads
wget -O code.deb 'https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64'
if [[ $ARCH == "amd64" ]]; then
wget -O code.deb 'https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64'
elif [[ $ARCH == "arm64" ]]; then
wget -O code.deb 'https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-arm64'
fi
iljo-dp marked this conversation as resolved.
Show resolved Hide resolved
sudo apt install -y ./code.deb

rm code.deb
cd -

Expand All @@ -11,4 +16,4 @@ cp ~/.local/share/omakub/configs/vscode.json ~/.config/Code/User/settings.json
code --install-extension enkia.tokyo-night

# Install default language extensions
code --install-extension golang.go
code --install-extension golang.go
6 changes: 5 additions & 1 deletion install/app-zellij.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
cd ~/Downloads
wget -O zellij.tar.gz "https://github.com/zellij-org/zellij/releases/latest/download/zellij-x86_64-unknown-linux-musl.tar.gz"
if [[ $ARCH == "amd64" ]]; then
wget -O zellij.tar.gz "https://github.com/zellij-org/zellij/releases/latest/download/zellij-x86_64-unknown-linux-musl.tar.gz"
iljo-dp marked this conversation as resolved.
Show resolved Hide resolved
elif [[ $ARCH == "arm64" ]]; then
wget -O zellij.tar.gz "https://github.com/zellij-org/zellij/releases/latest/download/zellij-aarch64-unknown-linux-musl.tar.gz"
fi
tar -xf zellij.tar.gz zellij
sudo install zellij /usr/local/bin
rm zellij.tar.gz zellij
Expand Down
24 changes: 20 additions & 4 deletions install/app-zoom.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
cd ~/Downloads
wget https://zoom.us/client/latest/zoom_amd64.deb
sudo apt install -y ./zoom_amd64.deb
rm zoom_amd64.deb
cd -
if [[ $ARCH == "amd64" ]]; then
wget https://zoom.us/client/latest/zoom_amd64.deb
sudo apt install -y ./zoom_amd64.deb
rm zoom_amd64.deb
elif [[ $ARCH == "arm64" ]]; then
cat <<EOF > ~/.local/share/applications/Zoom.desktop
[Desktop Entry]
Version=1.0
Name=Zoom
Comment=Zoom online meetings
Exec=xdg-open --app="https://zoom.us/meeting" --name=Zoom
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/web-apps/icons/Zoom.png
Categories=GTK;
MimeType=text/html;text/xml;application/xhtml_xml;
StartupNotify=true
EOF
fi
cd -
6 changes: 5 additions & 1 deletion install/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ echo '{"log-driver":"json-file","log-opts":{"max-size":"10m","max-file":"5"}}' |
DOCKER_COMPOSE_VERSION="2.27.0"
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -sSL https://github.com/docker/compose/releases/download/v$DOCKER_COMPOSE_VERSION/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
if [[ $ARCH == "amd64" ]]; then
curl -sSL https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64 -o ${DOCKER_CONFIG}/cli-plugins/docker-compose
iljo-dp marked this conversation as resolved.
Show resolved Hide resolved
elif [[ $ARCH == "arm64" ]]; then
curl -sSL https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-linux-aarch64 -o ${DOCKER_CONFIG}/cli-plugins/docker-compose
fi
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose

sudo docker create --restart unless-stopped -p "127.0.0.1:3306:3306" --name=mysql8 -e MYSQL_ROOT_PASSWORD= -e MYSQL_ALLOW_EMPTY_PASSWORD=true mysql:8.4
Expand Down
6 changes: 3 additions & 3 deletions install/mise.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Install mise for managing multiple versions of languages. See https://mise.jdx.dev/
sudo apt update -y && sudo apt install -y gpg sudo wget curl
sudo install -dm 755 /etc/apt/keyrings
wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg 1>/dev/null
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list
wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg >/dev/null
echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=${ARCH}] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list
Copy link

Choose a reason for hiding this comment

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

Nit: i guess you could also set arch=amd64,arm64 to support both?

Copy link
Author

Choose a reason for hiding this comment

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

what do you mean? Current we use ARCH to get the architecture, ARCH is a global variable set in the main sh script ran on starting omakub. And then ARCH indeed is arm64 or amd64, whatever ARCH is automatically set to at the start. What do you mean here, what do I need to change?

Copy link
Author

Choose a reason for hiding this comment

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

so ARCH is dynamically set based on what architecture you use, so just doing arch=${ARCH} should work no?

Copy link
Member

Choose a reason for hiding this comment

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

@roele That'll fetch package info for the other architecture as well, however.

The arch can just be omitted, too. Then it'll use the default Apt::Architectures, which is just the native amd64/arm64.

sudo apt update
sudo apt install -y mise

# Install default languages
mise use --global [email protected]
mise use --global node@lts
mise use --global go@latest
mise use --global go@latest
9 changes: 7 additions & 2 deletions install/optional/app-dropbox.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
sudo apt install -y nautilus-dropbox
gtk-launch dropbox.desktop
if [[ $ARCH == "amd64" ]]; then
sudo apt install -y nautilus-dropbox
gtk-launch dropbox.desktop
elif [[ $ARCH == "arm64" ]]; then
#https://packages.ubuntu.com/noble/nautilus-dropbox
echo "Dropbox is not supported on arm64 architecture."
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

idk building from source seems kinda sketchy? we could do that but ehh...
Maestral seems nice, and is perhaps something @dhh would like also, perhaps as just a replacement for dropbox?

fi
2 changes: 1 addition & 1 deletion web-apps/Basecamp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cat <<EOF > ~/.local/share/applications/Basecamp.desktop
Version=1.0
Name=Basecamp
Comment=Basecamp Project Management
Exec=google-chrome --app="https://launchpad.37signals.com" --name=Basecamp
Exec=xdg-open --app="https://launchpad.37signals.com" --name=Basecamp
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/web-apps/icons/Basecamp.png
Expand Down
2 changes: 1 addition & 1 deletion web-apps/HEY.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cat <<EOF >~/.local/share/applications/HEY.desktop
Version=1.0
Name=HEY
Comment=HEY Email + Calendar
Exec=google-chrome --app="https://app.hey.com/" --name=HEY
Exec=xdg-open --app="https://app.hey.com/" --name=HEY
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/web-apps/icons/HEY.png
Expand Down
2 changes: 1 addition & 1 deletion web-apps/WhatsApp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cat <<EOF > ~/.local/share/applications/WhatsApp.desktop
Version=1.0
Name=WhatsApp
Comment=WhatsApp Messenger
Exec=google-chrome --app="https://web.whatsapp.com" --name=WhatsApp
Exec=xdg-open --app="https://web.whatsapp.com" --name=WhatsApp
Terminal=false
Type=Application
Icon=/home/$USER/.local/share/omakub/web-apps/icons/WhatsApp.png
Expand Down
Binary file added web-apps/icons/Spotify.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web-apps/icons/Zoom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.