From 41d23730cc2f7be63142d87a227a2089e2bdea45 Mon Sep 17 00:00:00 2001 From: DecDuck Date: Sun, 3 Aug 2025 13:50:55 +1000 Subject: [PATCH] fix: use ldconfig to find libraries --- .gitignore | 7 ++++++- build_appimage.sh | 9 ++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 52149c9..f0a82ea 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,9 @@ src-tauri/perf* build/appimage/* !build/appimage/drop-app.d -drop-app + +build/appimage/drop-app.d/usr/bin/* +!build/appimage/drop-app.d/usr/bin/.gitkeep + +build/appimage/drop-app.d/usr/lib/* +!build/appimage/drop-app.d/usr/lib/.gitkeep \ No newline at end of file diff --git a/build_appimage.sh b/build_appimage.sh index 5d281a9..23cf886 100755 --- a/build_appimage.sh +++ b/build_appimage.sh @@ -27,13 +27,16 @@ fi # install binaries in the appdir, then the libraries cp $target_dir/release/drop-app $appdir/usr/bin -for i in $(readelf -d "$target_dir/release/drop-app" | grep NEEDED |cut -d'[' -f2 |tr -d ]); +for lib_name in $(readelf -d "$target_dir/release/drop-app" | grep NEEDED |cut -d'[' -f2 |tr -d ]); do - install -g 1000 -o 1000 -Dm755 "$(ls -L1 /usr/lib/$i)" $appdir/usr/lib + echo $lib_name + ld_path=$(ldconfig -p | grep $lib_name | awk '{ print $NF }') + echo $ld_path + install -g 1000 -o 1000 -Dm755 "$(ls -L1 $ld_path)" $appdir/usr/lib done wget -O $appimage_dir/appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$arch.AppImage cd $appimage_dir chmod u+x appimagetool -appimagetool $appdir +./appimagetool $appdir