fix: use ldconfig to find libraries

This commit is contained in:
DecDuck
2025-08-03 13:50:55 +10:00
parent d19c5b8e97
commit 41d23730cc
2 changed files with 12 additions and 4 deletions

7
.gitignore vendored
View File

@ -30,4 +30,9 @@ src-tauri/perf*
build/appimage/* build/appimage/*
!build/appimage/drop-app.d !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

View File

@ -27,13 +27,16 @@ fi
# install binaries in the appdir, then the libraries # install binaries in the appdir, then the libraries
cp $target_dir/release/drop-app $appdir/usr/bin 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 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 done
wget -O $appimage_dir/appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$arch.AppImage wget -O $appimage_dir/appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$arch.AppImage
cd $appimage_dir cd $appimage_dir
chmod u+x appimagetool chmod u+x appimagetool
appimagetool $appdir ./appimagetool $appdir