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

Anydesk arm64 #2455

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
34 changes: 26 additions & 8 deletions api
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,20 @@ install_packages() { #Make some packages dependencies of the $app app. Package-n

[ -f "$package" ] || error "install_packages(): Local package does not exist! ($package)"

#determine the package name from the filename
packagename="$(dpkg-deb -I "$package" | grep "^ Package:" | awk '{print $2}')"
packageversion="$(dpkg-deb -I "$package" | grep "^ Version:" | awk '{print $2}')"
[ -z "$packagename" ] && error "install_packages(): failed to determine a package-name for the file '$package'"
[ -z "$packageversion" ] && error "install_packages(): failed to determine a package-version for the file '$package'"
#determine the package name, package version, and architecture from the file
local dpkg_deb_output="$(dpkg-deb -I "$filename")"
local packagename="$(echo "$dpkg_deb_output" | grep "^ Package:" | awk '{print $2}')"
local packageversion="$(echo "$dpkg_deb_output" | grep "^ Version:" | awk '{print $2}')"
local packagearch="$(echo "$dpkg_deb_output" | grep "^ Architecture:" | awk '{print $2}')"
[ -z "$packagename" ] && error "install_packages(): failed to determine a package-name for the file '$filename'"
[ -z "$packageversion" ] && error "install_packages(): failed to determine a package-version for the file '$filename'"
[ -z "$packagearch" ] && error "install_packages(): failed to determine a package-architecture for the file '$filename'"
unset dpkg_deb_output

#foreign arch: add :armhf or :arm64 to the packagename if this local package is of a foreign architecture
if [ "$packagearch" != "$(dpkg --print-architecture)" ];then
packagename+=":$packagearch"
fi

#add this local package to the pi-apps-local-packages repository
repo_add "$package" || return 1
Expand All @@ -429,11 +438,20 @@ install_packages() { #Make some packages dependencies of the $app app. Package-n

wget -O "$filename" "$package" || return 1

#determine the package name from the filename
packagename="$(dpkg-deb -I "$filename" | grep "^ Package:" | awk '{print $2}')"
packageversion="$(dpkg-deb -I "$filename" | grep "^ Version:" | awk '{print $2}')"
#determine the package name, package version, and architecture from the file
local dpkg_deb_output="$(dpkg-deb -I "$filename")"
local packagename="$(echo "$dpkg_deb_output" | grep "^ Package:" | awk '{print $2}')"
local packageversion="$(echo "$dpkg_deb_output" | grep "^ Version:" | awk '{print $2}')"
local packagearch="$(echo "$dpkg_deb_output" | grep "^ Architecture:" | awk '{print $2}')"
[ -z "$packagename" ] && error "install_packages(): failed to determine a package-name for the file '$filename'"
[ -z "$packageversion" ] && error "install_packages(): failed to determine a package-version for the file '$filename'"
[ -z "$packagearch" ] && error "install_packages(): failed to determine a package-architecture for the file '$filename'"
unset dpkg_deb_output

#foreign arch: add :armhf or :arm64 to the packagename if this local package is of a foreign architecture
if [ "$packagearch" != "$(dpkg --print-architecture)" ];then
packagename+=":$packagearch"
fi

#add this local package to the pi-apps-local-packages repository
repo_add "$filename" || return 1
Expand Down
41 changes: 41 additions & 0 deletions apps/AnyDesk/install-64
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

version=6.3.0-1

function check-armhf() {
ARMHF="$(dpkg --print-foreign-architectures | grep "armhf")"
}

#add armhf architecture (multiarch)
check-armhf
if [[ "$ARMHF" == *"armhf"* ]]; then
echo "armhf arcitecture already added..."
else
sudo dpkg --add-architecture armhf
check-armhf
if [[ "$ARMHF" != *"armhf"* ]]; then
error "armhf architecture should be added by now, but it isn't!"
fi
fi

unset rpi_arm_userspace
# only install the libraspberrypi0 arm32 package if the user already has the libraspberrypi0 arm64 package installed
if package_installed libraspberrypi0 ; then
rpi_arm_userspace="libraspberrypi0:armhf"
fi
Botspot marked this conversation as resolved.
Show resolved Hide resolved

install_packages https://download.anydesk.com/rpi/anydesk_${version}_armhf.deb libgles-dev:armhf libegl-dev:armhf libpolkit-gobject-1-0:armhf $rpi_arm_userspace || exit 1

#As libraspberrypi-dev:armhf cannot be installed with multiarch, symlink the required libs from libraspberrypi0:armhf
if [ -e /usr/lib/arm-linux-gnueabihf/libbcm_host.so.0 ] && [ -e /usr/lib/arm-linux-gnueabihf/libvcos.so.0 ] && [ -e /usr/lib/arm-linux-gnueabihf/libvchiq_arm.so.0 ];then
sudo ln -s /usr/lib/arm-linux-gnueabihf/libbcm_host.so.0 /usr/lib/arm-linux-gnueabihf/libbcm_host.so
sudo ln -s /usr/lib/arm-linux-gnueabihf/libvcos.so.0 /usr/lib/arm-linux-gnueabihf/libvcos.so
sudo ln -s /usr/lib/arm-linux-gnueabihf/libvchiq_arm.so.0 /usr/lib/arm-linux-gnueabihf/libvchiq_arm.so
else
error "Could not locate needed libs to symlink! Please ask pi-apps developers for help about this."
fi
# Solve error on Bullseye: "anydesk: error while loading shared libraries: libbrcmGLESv2.so: cannot open shared object file: No such file or directory"

[ ! -e /usr/lib/libbrcmGLESv2.so ] && sudo ln -s /usr/lib/arm-linux-gnueabihf/libGLESv2.so /usr/lib/arm-linux-gnueabihf/libbrcmGLESv2.so
[ ! -e /usr/lib/libbrcmEGL.so ] && sudo ln -s /usr/lib/arm-linux-gnueabihf/libEGL.so /usr/lib/arm-linux-gnueabihf/libbrcmEGL.so
Botspot marked this conversation as resolved.
Show resolved Hide resolved
exit 0
14 changes: 14 additions & 0 deletions apps/AnyDesk/uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

purge_packages || exit 1

if [ "$arch" == 64 ];then
# remove armhf architecture if no packages from it are currently installed
apt list --installed | awk '$3 == "armhf" { print }' | grep -q installed || sudo dpkg --remove-architecture armhf

#unlink libs
IFS=' '
for i in /usr/lib/arm-linux-gnueabihf/libbcm_host.so /usr/lib/arm-linux-gnueabihf/libvcos.so /usr/lib/arm-linux-gnueabihf/libvchiq_arm.so /usr/lib/arm-linux-gnueabihf/libbrcmGLESv2.so /usr/lib/arm-linux-gnueabihf/libbrcmEGL.so ;do
if [ -L $i ];then
sudo rm -f $i
fi
done

fi

#remove symlinked libraries
if [ -L /usr/lib/libbrcmGLESv2.so ];then
sudo rm -f /usr/lib/libbrcmGLESv2.so
Expand Down
Loading