Skip to content

Commit f09dcf1

Browse files
committed
Bundle libgee and libsoup libraries. Fixes #9
1 parent be45243 commit f09dcf1

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

.github/workflows/package.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,24 @@ jobs:
8787
# Copy installed files
8888
cp -a "$DESTDIR/usr" "$APPDIR/"
8989
90+
# Bundle shared libraries that may not be present on non-GNOME systems
91+
# (e.g. KDE-based distros like CachyOS KDE)
92+
mkdir -p "$APPDIR/usr/lib"
93+
for lib in libgee-0.8.so libsoup-3.0.so; do
94+
lib_path=$(ldd "$DESTDIR/usr/bin/app-manager" 2>/dev/null | grep "$lib" | awk '{print $3}' | head -1)
95+
if [ -n "$lib_path" ] && [ -f "$lib_path" ]; then
96+
cp -L "$lib_path" "$APPDIR/usr/lib/"
97+
echo "Bundled: $lib → $(basename "$lib_path") ($lib_path)"
98+
else
99+
echo "Warning: $lib not found via ldd, skipping"
100+
fi
101+
done
102+
90103
# Create AppRun script
91104
printf '%s\n' '#!/bin/bash' \
92105
'HERE="$(dirname "$(readlink -f "$0")")"' \
93106
'export APPDIR="$HERE"' \
107+
'export LD_LIBRARY_PATH="$HERE/usr/lib:${LD_LIBRARY_PATH:-}"' \
94108
'export GSETTINGS_SCHEMA_DIR="$HERE/usr/share/glib-2.0/schemas:${GSETTINGS_SCHEMA_DIR:-}"' \
95109
'export XDG_DATA_DIRS="$HERE/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"' \
96110
'export PATH="$HERE/usr/bin:$PATH"' \
@@ -210,10 +224,24 @@ jobs:
210224
# Copy installed files
211225
cp -a "$DESTDIR/usr" "$APPDIR/"
212226
227+
# Bundle shared libraries that may not be present on non-GNOME systems
228+
# (e.g. KDE-based distros like CachyOS KDE)
229+
mkdir -p "$APPDIR/usr/lib"
230+
for lib in libgee-0.8.so libsoup-3.0.so; do
231+
lib_path=$(ldd "$DESTDIR/usr/bin/app-manager" 2>/dev/null | grep "$lib" | awk '{print $3}' | head -1)
232+
if [ -n "$lib_path" ] && [ -f "$lib_path" ]; then
233+
cp -L "$lib_path" "$APPDIR/usr/lib/"
234+
echo "Bundled: $lib → $(basename "$lib_path") ($lib_path)"
235+
else
236+
echo "Warning: $lib not found via ldd, skipping"
237+
fi
238+
done
239+
213240
# Create AppRun script
214241
printf '%s\n' '#!/bin/bash' \
215242
'HERE="$(dirname "$(readlink -f "$0")")"' \
216243
'export APPDIR="$HERE"' \
244+
'export LD_LIBRARY_PATH="$HERE/usr/lib:${LD_LIBRARY_PATH:-}"' \
217245
'export GSETTINGS_SCHEMA_DIR="$HERE/usr/share/glib-2.0/schemas:${GSETTINGS_SCHEMA_DIR:-}"' \
218246
'export XDG_DATA_DIRS="$HERE/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"' \
219247
'export PATH="$HERE/usr/bin:$PATH"' \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ sudo dnf install vala meson ninja-build gtk4-devel libadwaita-devel glib2-devel
5353
- **Arch Linux / Manjaro:**
5454

5555
```bash
56-
sudo pacman -S vala meson ninja gtk4 libadwaita glib2 json-glib gee libsoup p7zip cmake desktop-file-utils jq
56+
sudo pacman -S vala meson ninja gtk4 libadwaita glib2 json-glib libgee libsoup p7zip cmake desktop-file-utils jq
5757
```
5858

5959
</details>

scripts/make-appimage.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,39 @@ cp -a "$INSTALL_ROOT"/* "$APPDIR/usr/"
8888

8989
# DwarFS tools are now installed directly to bin via meson
9090

91+
# Bundle shared libraries that may not be present on non-GNOME systems
92+
# (e.g. KDE-based distros like CachyOS KDE)
93+
mkdir -p "$APPDIR/usr/lib"
94+
95+
bundle_lib() {
96+
local lib_name="$1"
97+
local lib_path
98+
# Resolve the versioned .so path using the linker (most reliable)
99+
lib_path=$(ldd "$BUILD_DIR/src/$BINARY_NAME" 2>/dev/null | grep "$lib_name" | awk '{print $3}' | head -1)
100+
if [ -n "$lib_path" ] && [ -f "$lib_path" ]; then
101+
cp -L "$lib_path" "$APPDIR/usr/lib/"
102+
echo "Bundled: $lib_name$(basename "$lib_path") ($lib_path)"
103+
else
104+
echo "Warning: $lib_name not found via ldd, skipping"
105+
fi
106+
if [ -n "$lib_path" ] && [ -f "$lib_path" ]; then
107+
cp -L "$lib_path" "$APPDIR/usr/lib/"
108+
echo "Bundled: $lib_name ($lib_path)"
109+
else
110+
echo "Warning: $lib_name not found on system, skipping"
111+
fi
112+
}
113+
114+
bundle_lib "libgee-0.8.so"
115+
bundle_lib "libsoup-3.0.so"
116+
91117
# Create AppRun script that sets up environment for GSettings schemas
118+
# and bundled libraries
92119
cat > "$APPDIR/AppRun" << 'EOF'
93120
#!/bin/bash
94121
HERE="$(dirname "$(readlink -f "$0")")"
95122
export APPDIR="$HERE"
123+
export LD_LIBRARY_PATH="$HERE/usr/lib:${LD_LIBRARY_PATH:-}"
96124
export GSETTINGS_SCHEMA_DIR="$HERE/usr/share/glib-2.0/schemas:${GSETTINGS_SCHEMA_DIR:-}"
97125
export XDG_DATA_DIRS="$HERE/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
98126
export PATH="$HERE/usr/bin:$PATH"

0 commit comments

Comments
 (0)