-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake-appimage.sh
More file actions
40 lines (33 loc) · 1.63 KB
/
make-appimage.sh
File metadata and controls
40 lines (33 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
set -eux
ARCH=$(uname -m)
BINS_SOURCE="$PWD"/scrcpy/release/work/build-linux-"$ARCH"/dist
UDEV="https://raw.githubusercontent.com/M0Rf30/android-udev-rules/refs/heads/main/51-android.rules"
export ARCH
export ADD_HOOKS="self-updater.bg.hook:udev-installer.hook"
export UPINFO="gh-releases-zsync|${GITHUB_REPOSITORY%/*}|${GITHUB_REPOSITORY#*/}|latest|*$ARCH.AppImage.zsync"
export DEPLOY_OPENGL=1
export DEPLOY_PIPEWIRE=1
export OUTPATH=./dist
export ICON="$BINS_SOURCE"/icon.png
export MAIN_BIN=scrcpy
# scrcpy build script just downloads the upstream android adb binary
# which is x86_64 only, so we have to remove it and bundle the distro adb
rm -f "$BINS_SOURCE"/adb
# Deploy dependencies
quick-sharun "$BINS_SOURCE"/* /usr/bin/adb
cp -v /usr/share/scrcpy/scrcpy-server ./AppDir/bin # get server binary
cp -v "$BINS_SOURCE"/scrcpy.1 ./AppDir/bin # man page?
sed -i -e 's|Exec=.*|Exec=scrcpy|g' ./AppDir/*.desktop
echo 'SCRCPY_SERVER_PATH=${SHARUN_DIR}/bin/scrcpy-server' >> ./AppDir/.env
echo 'SCRCPY_ICON_PATH=${SHARUN_DIR}/icon.png' >> ./AppDir/.env
# Add udev rules
mkdir -p ./AppDir/etc/udev/rules.d
wget --retry-connrefused --tries=30 "$UDEV" -O ./AppDir/etc/udev/rules.d/51-android.rules
# We also need to be added to a group after installing udev rules
sed -i "/cp -v '\$_tmp_udev_dir'/a groupadd -f adbusers; usermod -a -G adbusers \$(logname)" ./AppDir/bin/udev-installer.hook
# Turn AppDir into AppImage
quick-sharun --make-appimage
# Test the app for 12 seconds, if the test fails due to the app
# having issues running in the CI use --simple-test instead
quick-sharun --simple-test ./dist/*.AppImage --version