Skip to content

Commit

Permalink
Vendor additional data files (themes, SourceView...)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirod committed Nov 21, 2024
1 parent 8b89c8b commit c3d59b9
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions build-aux/appimage-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,36 @@ ninja -C build
DESTDIR=$PWD/build/appimagetool/AppDir/usr ninja -C build install

cd build/appimagetool

# Vendor extra files
if [ -d /usr/share/icons/Adwaita ]; then
mkdir -p AppDir/usr/share/icons
cp -rv /usr/share/icons/Adwaita AppDir/usr/share/icons
gtk4-update-icon-cache -q -t -f AppDir/usr/share/icons/Adwaita
else
echo "Warning: cannot vendor Adwaita icons"
fi
if [ -d /usr/share/themes/Adwaita ]; then
mkdir -p AppDir/usr/share/themes
cp -rv /usr/share/themes/Adwaita AppDir/usr/share/themes
else
echo "Warning: cannot vendor Adwaita themes"
fi
if [ -d /usr/share/gtksourceview-5 ]; then
cp -rv /usr/share/gtksourceview-5 AppDir/usr/share/
else
echo "Warning: cannot vendor GtkSourceView 5 data files"
fi
gtk4-update-icon-cache -q -t -f AppDir/usr/share/icons/hicolor

# Start packaging process
[ -x appimagetool-x86_64.AppImage ] || curl -OL https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
[ -x linuxdeploy-x86_64.AppImage ] || curl -OL https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
[ -x linuxdeploy-plugin-gtk.sh ] || curl -OL https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh
chmod +x appimagetool-x86_64.AppImage linuxdeploy-x86_64.AppImage linuxdeploy-plugin-gtk.sh

DEPLOY_GTK_VERSION=4

export DEPLOY_GTK_VERSION

# First iteration
export DEPLOY_GTK_VERSION=4
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin gtk --output appimage \
--executable AppDir/usr/bin/cartero \
--icon-file "$ICON_PATH" \
Expand All @@ -44,8 +64,5 @@ export DEPLOY_GTK_VERSION
sed -i '/GTK_THEME/d' AppDir/apprun-hooks/linuxdeploy-plugin-gtk.sh
sed -i '/GDK_BACKEND/d' AppDir/apprun-hooks/linuxdeploy-plugin-gtk.sh

# Extra fixes for the icon theme.
gtk4-update-icon-cache -q -t -f AppDir/usr/share/icons/hicolor

# Recompile with the changes.
./appimagetool-x86_64.AppImage AppDir

0 comments on commit c3d59b9

Please sign in to comment.