Browse Source
Stop forcing the overwrite of the cache at each run it is not necessary most of the time. Reviewed by: tcberner Differencial Revision: https://reviews.freebsd.org/D34602 While here rework USES=fonts to drop @fcfontsdir which is not nessary anymore and convert the @fontsdir into lua which make it way simpler to readoverlay

7 changed files with 32 additions and 67 deletions
@ -1,27 +0,0 @@ |
|||
# MAINTAINER: x11@FreeBSD.org |
|||
|
|||
actions: [dir] |
|||
post-install: <<EOD |
|||
case "%@" in |
|||
/*) fontsdir="%@" ;; |
|||
*) fontsdir="%D/%@" ;; |
|||
esac |
|||
fc-cache -fs ${fontsdir} 2>/dev/null || true |
|||
mkfontscale ${fontsdir} 2>/dev/null || true |
|||
mkfontdir ${fontsdir} 2>/dev/null || true |
|||
EOD |
|||
post-deinstall: <<EOD |
|||
case "%@" in |
|||
/*) fontsdir="%@" ;; |
|||
*) fontsdir="%D/%@" ;; |
|||
esac |
|||
fc-cache -fs ${fontsdir} 2>/dev/null || true |
|||
mkfontscale ${fontsdir} 2>/dev/null || true |
|||
if [ -e ${fontsdir}/fonts.scale -a "`stat -f '%%z' ${fontsdir}/fonts.scale 2>/dev/null`" = '2' ]; then |
|||
rm ${fontsdir}/fonts.scale |
|||
fi |
|||
mkfontdir ${fontsdir} 2>/dev/null || true |
|||
if [ -e ${fontsdir}/fonts.dir -a "`stat -f '%%z' ${fontsdir}/fonts.dir 2>/dev/null`" = '2' ]; then |
|||
rm ${fontsdir}/fonts.dir |
|||
fi |
|||
EOD |
@ -1,25 +1,19 @@ |
|||
# MAINTAINER: x11@FreeBSD.org |
|||
|
|||
actions: [dir] |
|||
post-install: <<EOD |
|||
case "%@" in |
|||
/*) fontsdir="%@" ;; |
|||
*) fontsdir="%D/%@" ;; |
|||
esac |
|||
mkfontscale ${fontsdir} 2>/dev/null || true |
|||
mkfontdir ${fontsdir} 2>/dev/null || true |
|||
post-install-lua: <<EOD |
|||
fontdir = pkg.prefixed_path("%@") |
|||
pkg.exec({"mkfontscale", fontdir}) |
|||
pkg.exec({"mkfontdir", fontdir}) |
|||
EOD |
|||
post-deinstall: <<EOD |
|||
case "%@" in |
|||
/*) fontsdir="%@" ;; |
|||
*) fontsdir="%D/%@" ;; |
|||
esac |
|||
mkfontscale ${fontsdir} 2>/dev/null || true |
|||
if [ -e ${fontsdir}/fonts.scale -a "`stat -f '%%z' ${fontsdir}/fonts.scale 2>/dev/null`" = '2' ]; then |
|||
rm ${fontsdir}/fonts.scale |
|||
fi |
|||
mkfontdir ${fontsdir} 2>/dev/null || true |
|||
if [ -e ${fontsdir}/fonts.dir -a "`stat -f '%%z' ${fontsdir}/fonts.dir 2>/dev/null`" = '2' ]; then |
|||
rm ${fontsdir}/fonts.dir |
|||
fi |
|||
post-deinstall-lua: <<EOD |
|||
fontdir = pkg.prefixed_path("%@") |
|||
pkg.exec({"mkfontscale", fontdir}) |
|||
pkg.exec({"mkfontdir", fontdir}) |
|||
for _, v in pairs {"/fonts.scale", "/fonts.dir" } do |
|||
local st = pkg.stat(fontdir .. v) |
|||
if st and st.type == "reg" and st.size == 2 then |
|||
os.remove(fontdir .. v) |
|||
end |
|||
end |
|||
EOD |
|||
|
@ -0,0 +1,9 @@ |
|||
path: [ "%%PREFIX%%/share/fonts", %%PREFIX%%/etc/fonts/conf.d ] |
|||
trigger: { |
|||
type: lua |
|||
sandbox: false |
|||
script: <<EOS |
|||
print("Running fc-cache to build fontconfig cache...") |
|||
pkg.exec({"%%PREFIX%%/bin/fc-cache", "-s" }) |
|||
EOS |
|||
} |
@ -1,10 +0,0 @@ |
|||
#!/bin/sh |
|||
|
|||
PATH=/bin:/usr/bin:/sbin:/usr/sbin:%%PREFIX%%/bin |
|||
export PATH |
|||
|
|||
if [ "$2" = "POST-INSTALL" ]; then |
|||
echo "Running fc-cache to build fontconfig cache..." |
|||
fc-cache -f -s -v |
|||
exit 0 |
|||
fi |
Loading…
Reference in new issue