Some changes for better use of postinstall_helpers and run_stuff_*.
Introduce run_stuff_<state>_<stage>_cmd. These are used to run a specific command before or after the specified stage. Introduce two new helpers: fontconfig-update.sh and mkfontxx-rebuild.sh. The first runs fc-cache once fontconfig is installed, the second rebuilds the fonts.dir and fonts.scale files in a directory for a template. Allow run_stuff_* to execute a script with any path, not just from PKGFS_TEMPLATESDIR. That means that now if you install GTK+ and any fonts package, gtk-demo will work without any additional stuff. --HG-- extra : convert_revision : c8aa7eb8d1ab958f64808af0d4c1cce8760d012e
This commit is contained in:
9
helper-templates/fontconfig-update.sh
Executable file
9
helper-templates/fontconfig-update.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# This helpers runs fc-cache after fontconfig has been installed,
|
||||
# and update its list of fonts.
|
||||
#
|
||||
|
||||
if [ -x $PKGFS_MASTERDIR/bin/fc-cache ]; then
|
||||
$PKGFS_MASTERDIR/bin/fc-cache -f
|
||||
[ "$?" -eq 0 ] && echo "=> Updated fontconfig fonts cache."
|
||||
fi
|
||||
25
helper-templates/mkfontxx-rebuild.sh
Executable file
25
helper-templates/mkfontxx-rebuild.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# This helper rebuilds the fonts.dir and fonts.scale files in a
|
||||
# directory specified by a template.
|
||||
#
|
||||
|
||||
[ -z "$fonts_dir" ] && return 1
|
||||
[ ! -d "$fonts_dir" ] && $mkdir_cmd -p $fonts_dir
|
||||
|
||||
mkfontdir_cmd=$PKGFS_MASTERDIR/bin/mkfontdir
|
||||
mkfontscale_cmd=$PKGFS_MASTERDIR/bin/mkfontscale
|
||||
|
||||
if [ -x $mkfontdir_cmd -a -x $mkfontscale_cmd ]; then
|
||||
save_path=$(pwd -P 2>/dev/null)
|
||||
cd $fonts_dir && $mkfontdir_cmd && $mkfontscale_cmd
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "=> Updated $fonts_dir/fonts.dir."
|
||||
echo "=> Updated $fonts_dir/fonts.scale."
|
||||
fi
|
||||
cd $save_path
|
||||
unset save_path
|
||||
fi
|
||||
|
||||
unset fonts_dir
|
||||
unset mkfontdir_cmd
|
||||
unset mkfontscale_cmd
|
||||
Reference in New Issue
Block a user