Skip to content

Commit b654c0a

Browse files
authored
refactor and prepare aarch64 builds (#13)
1 parent b56ac4b commit b654c0a

File tree

4 files changed

+151
-128
lines changed

4 files changed

+151
-128
lines changed

.github/workflows/blank.yml

Lines changed: 29 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,83 +2,62 @@ name: Appimage
22
concurrency:
33
group: build-${{ github.ref }}
44
cancel-in-progress: true
5-
65
on:
76
schedule:
87
- cron: "0 21 * * 0"
98
workflow_dispatch:
109

1110
jobs:
1211
build:
13-
runs-on: ubuntu-22.04
12+
name: "${{ matrix.name }} (${{ matrix.arch }})"
13+
runs-on: ${{ matrix.runs-on }}
14+
strategy:
15+
matrix:
16+
include:
17+
- runs-on: ubuntu-latest
18+
name: "Build AppImage"
19+
arch: x86_64
20+
# - runs-on: ubuntu-24.04-arm
21+
# name: "Build AppImage"
22+
# arch: aarch64
1423
container: alpine:latest
1524
steps:
1625
- uses: actions/checkout@v4
1726

18-
- name: build
19-
if: always()
20-
run: |
21-
apk add bash \
22-
bash \
23-
bison \
24-
build-base \
25-
cairo-dev \
26-
check-dev \
27-
coreutils \
28-
cppcheck \
29-
flex \
30-
gdk-pixbuf-dev \
31-
git \
32-
glib-dev \
33-
gvfs \
34-
librsvg-dev \
35-
libxcb-dev \
36-
libxkbcommon-dev \
37-
meson \
38-
musl-fts-dev \
39-
pango-dev \
40-
patchelf \
41-
ronn \
42-
startup-notification-dev \
43-
strace \
44-
wget \
45-
xcb-util-cursor-dev \
46-
xcb-util-dev \
47-
xcb-util-keysyms-dev \
48-
xcb-util-wm-dev \
49-
xcb-util-xrm-dev \
50-
xkeyboard-config-dev
27+
- name: Get dependencies
28+
run: chmod +x ./get-dependencies.sh && ./get-dependencies.sh
5129

52-
chmod +x ./rofi-appimage.sh && ./rofi-appimage.sh
53-
mkdir dist
54-
mv *.AppImage* dist/
30+
- name: Make AppImage
31+
run: chmod +x ./*-appimage.sh && ./*-appimage.sh
5532

56-
- name: Check version file
57-
run: |
58-
cat ~/version
59-
echo "APP_VERSION=$(cat ~/version)" >> "${GITHUB_ENV}"
60-
6133
- name: Upload artifact
6234
uses: actions/upload-artifact@v4.6.2
6335
with:
64-
name: AppImage
65-
path: 'dist'
66-
36+
name: AppImage-${{ matrix.arch }}
37+
path: "dist"
38+
6739
- name: Upload version file
6840
uses: actions/upload-artifact@v4.6.2
6941
with:
70-
name: version
71-
path: ~/version
72-
42+
name: version
43+
path: ~/version
44+
overwrite: true
45+
7346
release:
47+
if: ${{ github.ref_name == 'main' }}
7448
needs: [build]
7549
permissions: write-all
7650
runs-on: ubuntu-latest
7751

7852
steps:
7953
- uses: actions/download-artifact@v4.3.0
8054
with:
81-
name: AppImage
55+
name: AppImage-x86_64
56+
57+
# - uses: actions/download-artifact@v4.3.0
58+
# with:
59+
# name: AppImage-aarch64
60+
8261
- uses: actions/download-artifact@v4.3.0
8362
with:
8463
name: version

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
# rofi-AppImage
22

3-
Unofficial AppImage of [rofi](https://github.com/davatorium/rofi)
3+
AppImage made using [sharun](https://github.com/VHSgunzo/sharun), which makes it extremely easy to turn any binary into a portable package without using containers or similar tricks.
44

55
**This AppImage bundles everything and should work on any linux distro, even on musl based ones.**
66

7-
rofi-theme-selector is called this way: `./appimagename rofi-theme-selector`.
7+
It is possible that this appimage may fail to work with appimagelauncher, I recommend these alternatives instead:
88

9-
You can also run the `rofi-appimage.sh` script in your machine to make the AppImage, provided it has all the dependencies needed to build rofi.
9+
* [AM](https://github.com/ivan-hc/AM) `am -i rofi` or `appman -i rofi`
1010

11-
It is possible that these appimages may fail to work with appimagelauncher, since appimagelauncher is pretty much dead I recommend this alternative: https://github.com/ivan-hc/AM
11+
* [dbin](https://github.com/xplshn/dbin) `dbin install rofi.appimage`
1212

13-
This appimage works without fuse2 as it can use fuse3 instead.
13+
* [soar](https://github.com/pkgforge/soar) `soar install rofi`
14+
15+
This appimage works without fuse2 as it can use fuse3 instead, it can also work without fuse at all thanks to the [uruntime](https://github.com/VHSgunzo/uruntime)
16+
17+
<details>
18+
<summary><b><i>raison d'être</i></b></summary>
19+
<img src="https://github.com/user-attachments/assets/d40067a6-37d2-4784-927c-2c7f7cc6104b" alt="Inspiration Image">
20+
</a>
21+
</details>
22+
23+
---
24+
25+
More at: [AnyLinux-AppImages](https://pkgforge-dev.github.io/Anylinux-AppImages/)

get-dependencies.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
3+
apk add \
4+
bash \
5+
bison \
6+
build-base \
7+
cairo-dev \
8+
check-dev \
9+
coreutils \
10+
cppcheck \
11+
flex \
12+
gdk-pixbuf-dev \
13+
git \
14+
glib-dev \
15+
gvfs \
16+
librsvg-dev \
17+
libxcb-dev \
18+
libxkbcommon-dev \
19+
meson \
20+
musl-fts-dev \
21+
pango-dev \
22+
ronn \
23+
startup-notification-dev \
24+
strace \
25+
wget \
26+
xcb-util-cursor-dev \
27+
xcb-util-dev \
28+
xcb-util-keysyms-dev \
29+
xcb-util-wm-dev \
30+
xcb-util-xrm-dev \
31+
xkeyboard-config-dev

rofi-appimage.sh

Lines changed: 74 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,94 @@
11
#!/bin/sh
22

3-
set -eux
3+
set -ex
44

5-
APP=rofi
65
export ARCH="$(uname -m)"
76
export APPIMAGE_EXTRACT_AND_RUN=1
7+
export URUNTIME_PRELOAD=1
88

99
UPINFO="gh-releases-zsync|$(echo "$GITHUB_REPOSITORY" | tr '/' '|')|latest|*$ARCH.AppImage.zsync"
10-
LIB4BN="https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
10+
SHARUN="https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-$ARCH-aio"
1111
APPIMAGETOOL="https://github.com/pkgforge-dev/appimagetool-uruntime/releases/download/continuous/appimagetool-$ARCH.AppImage"
1212

1313
# CREATE DIRECTORIES
14-
mkdir ./AppDir
15-
cd ./AppDir
16-
17-
# DOWNLOAD AND BUILD ROFI
18-
git clone --depth 1 "https://github.com/davatorium/rofi.git" ./rofi && (
19-
cd ./rofi
20-
meson --prefix /usr . build
21-
meson compile -C build
22-
meson install -C build --destdir "$(realpath ../)"
14+
mkdir ./AppDir && (
15+
cd ./AppDir
16+
# DOWNLOAD AND BUILD ROFI
17+
git clone --depth 1 "https://github.com/davatorium/rofi.git" ./rofi && (
18+
cd ./rofi
19+
meson --prefix /usr . build
20+
meson compile -C build
21+
meson install -C build --destdir "$(realpath ../)"
22+
)
23+
mv -v ./usr/* ./
24+
cp -v ./share/icons/hicolor/scalable/apps/rofi.svg ./
25+
cp -v ./share/icons/hicolor/scalable/apps/rofi.svg ./.DirIcon
26+
cp -v ./share/applications/rofi.desktop ./
27+
echo "Categories=Utility;" >> ./rofi.desktop
28+
29+
# ADD LIBRARIES
30+
wget --retry-connrefused --tries=30 "$SHARUN" -O ./sharun-aio
31+
chmod +x ./sharun-aio
32+
./sharun-aio l -p -v -k -s \
33+
./bin/* \
34+
/usr/lib/gio/modules/* \
35+
/usr/lib/gdk-pixbuf-*/*/*/*
36+
rm -f ./sharun-aio
37+
38+
# We can't use the gdk variables here because that breaks child processes
39+
#git clone --depth 1 "https://github.com/fritzw/ld-preload-open" && (
40+
# cd ./ld-preload-open
41+
# make all
42+
# mv ./path-mapping.so ../lib
43+
#)
44+
#mv -v ./shared/lib/gdk-pixbuf-* ./
45+
#echo 'path-mapping.so' >./.preload
46+
#echo 'PATH_MAPPING=/usr/lib/gdk-pixbuf-2.0:${SHARUN_DIR}/gdk-pixbuf-2.0' >> ./.env
47+
rm -rf ./rofi ./usr ./ld-preload-open
48+
49+
# AppRun
50+
cat > ./AppRun <<-'EOF'
51+
#!/bin/sh
52+
CURRENTDIR="$(dirname "$(readlink -f "$0")")"
53+
54+
BIN="${ARGV0#./}"
55+
unset ARGV0
56+
DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}"
57+
58+
export XDG_DATA_DIRS="$DATADIR:$XDG_DATA_DIRS:/usr/local/share:/usr/share"
59+
export PATH="$CURRENTDIR/bin:$PATH"
60+
61+
if [ ! -d "$DATADIR"/rofi/themes ]; then
62+
mkdir -p "$DATADIR"/rofi || exit 1
63+
cp -rn "$CURRENTDIR"/share/rofi/themes "$DATADIR"/rofi/themes || exit 1
64+
fi
65+
66+
if [ "$1" = "rofi-theme-selector" ]; then
67+
shift
68+
exec "$CURRENTDIR/bin/rofi-theme-selector" "$@"
69+
elif [ -f "$CURRENTDIR/bin/$BIN" ]; then
70+
exec "$CURRENTDIR/bin/$BIN" "$@"
71+
else
72+
exec "$CURRENTDIR/bin/rofi" "$@"
73+
fi
74+
EOF
75+
76+
chmod a+x ./AppRun
77+
./sharun -g
2378
)
24-
mv -v ./usr/* ./
25-
cp -v ./share/icons/hicolor/scalable/apps/rofi.svg ./
26-
cp -v ./share/icons/hicolor/scalable/apps/rofi.svg ./.DirIcon
27-
cp -v ./share/applications/rofi.desktop ./
28-
echo "Categories=Utility;" >> ./rofi.desktop
29-
30-
# ADD LIBRARIES
31-
wget "$LIB4BN" -O ./lib4bin
32-
chmod +x ./lib4bin
33-
./lib4bin -p -v -k -s \
34-
./bin/* \
35-
/usr/lib/gio/modules/* \
36-
/usr/lib/gdk-pixbuf-*/*/*/*
37-
38-
# We can't use the gdk variables here because that breaks child processes
39-
#git clone --depth 1 "https://github.com/fritzw/ld-preload-open" && (
40-
# cd ./ld-preload-open
41-
# make all
42-
# mv ./path-mapping.so ../lib
43-
#)
44-
#mv -v ./shared/lib/gdk-pixbuf-* ./
45-
#echo 'path-mapping.so' >./.preload
46-
#echo 'PATH_MAPPING=/usr/lib/gdk-pixbuf-2.0:${SHARUN_DIR}/gdk-pixbuf-2.0' >> ./.env
47-
48-
rm -rf ./rofi ./usr ./ld-preload-open
49-
50-
# AppRun
51-
echo '#!/bin/sh
52-
CURRENTDIR="$(dirname "$(readlink -f "$0")")"
53-
54-
BIN="${ARGV0#./}"
55-
unset ARGV0
56-
DATADIR="${XDG_DATA_HOME:-$HOME/.local/share}"
5779

58-
export XDG_DATA_DIRS="$DATADIR:$XDG_DATA_DIRS:/usr/local/share:/usr/share"
59-
export PATH="$CURRENTDIR/bin:$PATH"
60-
61-
if [ ! -d "$DATADIR"/rofi/themes ]; then
62-
mkdir -p "$DATADIR"/rofi || exit 1
63-
cp -rn "$CURRENTDIR"/share/rofi/themes "$DATADIR"/rofi/themes || exit 1
64-
fi
65-
66-
if [ "$1" = "rofi-theme-selector" ]; then
67-
shift
68-
exec "$CURRENTDIR/bin/rofi-theme-selector" "$@"
69-
elif [ -f "$CURRENTDIR/bin/$BIN" ]; then
70-
exec "$CURRENTDIR/bin/$BIN" "$@"
71-
else
72-
exec "$CURRENTDIR/bin/rofi" "$@"
73-
fi' > ./AppRun
74-
75-
chmod a+x ./AppRun
76-
./sharun -g
77-
78-
# don't set XKB_CONFIG_ROOT since it breaks child processes
79-
echo 'unset XKB_CONFIG_ROOT' >> ./.env
80-
81-
export VERSION="$(./AppRun -v | awk 'FNR==1 {print $2; exit}')"
80+
export VERSION="$(./AppDir/AppRun -v | awk '{print $2; exit}')"
8281
echo "$VERSION" > ~/version
8382

8483
# MAKE APPIMAGE WITH FUSE3 COMPATIBLE APPIMAGETOOL
85-
cd ..
86-
wget "$APPIMAGETOOL" -O ./appimagetool
84+
wget --retry-connrefused --tries=30 "$APPIMAGETOOL" -O ./appimagetool
8785
chmod +x ./appimagetool
8886

8987
echo "Generating AppImage..."
90-
URUNTIME_PRELOAD=1 ./appimagetool -n -u "$UPINFO" \
91-
"$PWD"/AppDir "$PWD"/"$APP"-"$VERSION"-anylinux-"$ARCH".AppImage
88+
./appimagetool -n -u "$UPINFO" \
89+
"$PWD"/AppDir "$PWD"/rofi-"$VERSION"-anylinux-"$ARCH".AppImage
90+
91+
mkdir -p ./dist
92+
mv -v ./*.AppImage* ./dist
9293

9394
echo "All Done!"

0 commit comments

Comments
 (0)