Skip to content

Commit fd621dc

Browse files
committed
Use system SSL libraries if available when running AppImage.
1 parent 8a2d120 commit fd621dc

2 files changed

Lines changed: 19 additions & 8 deletions

File tree

.github/workflows/tools/build-appimage

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,18 +207,23 @@ cp /usr/local/lib/libcdio_cdda.so.2 appdir
207207
cp /usr/local/lib/libcdio_paranoia.so.2 appdir
208208
cp /usr/local/lib/libcurl.so.4 appdir
209209

210+
strip --strip-all appdir/lib*.so*
211+
212+
# Copy OpenSSL dependencies
213+
mkdir -p appdir/openssl
214+
210215
if [[ "$OS" = Linux ]]; then
211-
cp -P /usr/lib/$HOST/libcrypto.so.3 appdir
212-
cp -P /usr/lib/$HOST/libssl.so.3 appdir
216+
cp -P /usr/lib/$HOST/libcrypto.so.3 appdir/openssl
217+
cp -P /usr/lib/$HOST/libssl.so.3 appdir/openssl
213218
else
214-
cp -P /lib/libcrypto.so.* appdir
215-
cp -P /usr/lib/libssl.so.* appdir
219+
cp -P /lib/libcrypto.so.* appdir/openssl
220+
cp -P /usr/lib/libssl.so.* appdir/openssl
216221

217-
chmod 0755 appdir/libcrypto.so.*
218-
chmod 0755 appdir/libssl.so.*
222+
chmod 0755 appdir/openssl/libcrypto.so.*
223+
chmod 0755 appdir/openssl/libssl.so.*
219224
fi
220225

221-
strip --strip-all appdir/lib*.so*
226+
strip --strip-all appdir/openssl/lib*.so*
222227

223228
# Build custom AppImage runtime
224229
if [[ "$AppImageArch" = riscv64 || "$AppImageArch" = ppc64el || "$OS" != Linux ]]; then

packaging/appimage/AppRun

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ else
1818
MAIN="$HERE/freac"
1919
fi
2020

21-
LD_LIBRARY_PATH="${HERE}" \
21+
# Use system SSL libraries over our own if available
22+
23+
if ! LD_LIBRARY_PATH="${HERE}" ldd ${HERE}/libsmooth-0.9.so.0 > /dev/null 2> /dev/null; then
24+
LIBRARY_PATH="${HERE}/openssl"
25+
fi
26+
27+
LD_LIBRARY_PATH="${HERE}:${LIBRARY_PATH}" \
2228
LD_PRELOAD="${HERE}/codecs/ogg.so:${HERE}/codecs/vorbis.so" \
2329
exec "${MAIN}" "$@"

0 commit comments

Comments
 (0)