@@ -8,40 +8,32 @@ export ARCH VERSION
88export OUTPATH=./dist
99export ADD_HOOKS=" self-updater.bg.hook"
1010export UPINFO=" gh-releases-zsync|${GITHUB_REPOSITORY%/* } |${GITHUB_REPOSITORY#*/ } |latest|*$ARCH .AppImage.zsync"
11- export ICON=/usr/share/icons/hicolor/128x128/apps/OpenCode.png
12- export DESKTOP=/usr/share/applications/OpenCode.desktop
1311export DEPLOY_OPENGL=1
1412
13+ # save the bun binary for later
14+ cp -v ./AppDir/bin/resources/opencode-cli ./
15+
1516# Deploy dependencies
1617quick-sharun \
17- /usr /bin/opencode * \
18+ ./AppDir /bin/* \
1819 /usr/lib/libnss_nis.so* \
1920 /usr/lib/libnsl.so* \
2021 /usr/lib/libnss_mdns* _minimal.so*
2122
2223# bun makes binaries that self extract and read /proc/self/exe
2324# they are also very delicate and get broken by strip
25+ f=./AppDir/bin/opencode-cli
26+ rm -f " $f " ./AppDir/bin/resources/opencode-cli
2427kek=.$( tr -dc ' A-Za-z0-9_=-' < /dev/urandom | head -c 10)
25- rm -f \
26- ./AppDir/bin/opencode \
27- ./AppDir/bin/opencode-cli \
28- ./AppDir/shared/bin/opencode \
29- ./AppDir/shared/bin/opencode-cli
30- cp -v /usr/bin/opencode ./AppDir/bin/opencode
31- ln -s opencode ./AppDir/bin/opencode-cli
32- patchelf --set-interpreter /tmp/" $kek " ./AppDir/bin/opencode
33- patchelf --set-rpath ' $ORIGIN/../lib' ./AppDir/bin/opencode
28+ cp -v ./opencode-cli " $f "
29+ patchelf --set-interpreter /tmp/" $kek " " $f "
30+ patchelf --set-rpath ' $ORIGIN/../lib' " $f "
31+ ln -s ../opencode-cli ./AppDir/bin/resources/opencode-cli
3432
3533cat << EOF > ./AppDir/bin/random-linker.src.hook
36- #!/bin/sh
34+ #!/bin/false
3735cp -f "\$ APPDIR"/shared/lib/ld-linux*.so* /tmp/"$kek "
3836EOF
39- chmod +x ./AppDir/bin/* .hook
40-
41- # for weird reasons opencode now attempts to execute $(basename $APPIMAGE)/opencode-cli
42- # this makes absolutely no sense wtf, so we have to set the APPIMAGE var to the
43- # opencode binary inside the AppDir so that it resolves correctly
44- echo ' APPIMAGE=${SHARUN_DIR}/bin/opencode' >> ./AppDir/.env
4537
4638# Turn AppDir into AppImage
4739quick-sharun --make-appimage
0 commit comments