Tweak fontconfig handling when making AppImage

This points to the correct FONTCONFIG_PATH as well so that the conf.d
files in the AppImage are read. This also removes lines in fonts.conf
that refer to a prefix directory (e.g. conda prefix) that doesn't exist
in the AppImage.
This commit is contained in:
Ryan Volz 2023-12-07 10:16:13 -05:00 committed by Clayton Smith
parent 2b3fa9e768
commit 3f40b38fd3

View File

@ -76,7 +76,8 @@ done
mkdir -p ./AppDir/apprun-hooks
echo 'export CONDA_PREFIX="$APPDIR/usr"' >./AppDir/apprun-hooks/soapy-hook.sh
echo 'export UHD_PKG_PATH="$APPDIR/usr"' >./AppDir/apprun-hooks/uhd-hook.sh
echo 'export FONTCONFIG_FILE="$APPDIR/etc/fonts/fonts.conf"' >./AppDir/apprun-hooks/fontconfig-hook.sh
echo 'export FONTCONFIG_FILE="$APPDIR/etc/fonts/fonts.conf"
export FONTCONFIG_PATH="$APPDIR/etc/fonts"' >./AppDir/apprun-hooks/fontconfig-hook.sh
# since libs come from prefix, little use in querying copyright files with dpkg-query
export DISABLE_COPYRIGHT_FILES_DEPLOYMENT=1
@ -106,9 +107,12 @@ cp "$PREFIX"/lib/libxcb.so.1 ./AppDir/usr/lib/
cp "$PREFIX"/lib/libz.so.1 ./AppDir/usr/lib/
# copy fontconfig configuration files that the FONTCONFIG_FILE env var points to
mkdir -p ./AppDir/etc/ ./AppDir/share/
cp -R "$PREFIX"/etc/fonts ./AppDir/etc/fonts
cp -R "$PREFIX"/share/fontconfig ./AppDir/share/fontconfig
mkdir -p ./AppDir/etc/
cp -RL "$PREFIX"/etc/fonts ./AppDir/etc/fonts
# remove any config file lines that refer to the old prefix if it's not /usr
if [ "${PREFIX:0:4}" != "/usr" ] ; then
sed -i "\|$PREFIX|d" ./AppDir/etc/fonts/fonts.conf
fi
# finally make the AppImage
./appimagetool-x86_64.AppImage AppDir/