Skip to content

Commit

Permalink
appimage.sh: deploy /.../*/copyright manually
Browse files Browse the repository at this point in the history
linuxdeploy scans with a separate dpkg-query per package (slow)
  • Loading branch information
mralusw committed Apr 5, 2024
1 parent 46a4fba commit 823cae2
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions scripts/appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,31 @@ make_appimage()
export UPDATE_INFORMATION="gh-releases-zsync|vim|vim-appimage|latest|$APP-*x86_64.AppImage.zsync"
export OUTPUT="${APP}-${VERSION}.glibc${GLIBC}-${ARCH}.AppImage"

./linuxdeploy.appimage --appdir "$APP.AppDir" \
DISABLE_COPYRIGHT_FILES_DEPLOYMENT=1 ./linuxdeploy.appimage \
--appdir "$APP.AppDir" \
-d "${SOURCE_DIR}/runtime/${LOWERAPP}.desktop" \
-i "${SOURCE_DIR}/runtime/${LOWERAPP}.png" \
${PLUGIN:-} \
--output appimage

chmod u+x "$OUTPUT"
# somehow linuxdeploy manages to change the AppDir *after* packing it: extract the AppImage
rm -rf squashfs-root
./"$OUTPUT" --appimage-extract >/dev/null
mv "$OUTPUT" "${OUTPUT%.*}".ldai # available for debugging

for lib in $(dpkg-query -S $(find squashfs-root/usr/lib -type f -name '*.so*' -printf '*/%f\n' ) | sed -e 's@:.*@@' | uniq | LC_ALL=C sort -u); do
docdir=usr/share/doc/"$lib"
copyfile="$docdir"/copyright
if [ -r /"$copyfile" ]; then
mkdir -p squashfs-root/"$docdir"
cp -a /"$copyfile" squashfs-root/"$copyfile"
fi
done

[ -e appimagetool ] || wget -O appimagetool https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
chmod u+x appimagetool
./appimagetool -u "$UPDATE_INFORMATION" --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 9 --mksquashfs-opt -b --mksquashfs-opt 1M squashfs-root "$OUTPUT"
rm -rf squashfs-root
)

github_actions_deploy()
Expand Down

0 comments on commit 823cae2

Please sign in to comment.