File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,20 @@ quick-sharun \
1616 /usr/bin/OpenCode \
1717 /usr/bin/opencode-cli
1818
19- # Additional changes can be done in between here
19+ # bun makes binaries that self extract and read /proc/self/exe
20+ # they are also very delicate and get broken by strip
21+ kek=.$( tr -dc ' A-Za-z0-9_=-' < /dev/urandom | head -c 10)
22+ rm -f ./AppDir/bin/opencode-cli ./AppDir/shared/bin/opencode-cli
23+ cp -v /usr/bin/opencode-cli ./AppDir/bin/opencode-cli.wrapped
24+ patchelf --set-interpreter /tmp/" $kek " ./AppDir/bin/opencode-cli.wrapped
25+ patchelf --set-rpath ' $ORIGIN/../lib' ./AppDir/bin/opencode-cli.wrapped
26+
27+ cat << EOF > ./AppDir/bin/opencode-cli
28+ #!/bin/sh
29+ cp -f "\$ APPDIR"/shared/lib/ld-linux*.so* /tmp/"$kek "
30+ exec "\$ APPDIR"/bin/opencode-cli.wrapped "\$ @"
31+ EOF
32+ chmod +x ./AppDir/bin/opencode-cli*
2033
2134# Turn AppDir into AppImage
2235quick-sharun --make-appimage
You can’t perform that action at this time.
0 commit comments