e573efcd34
Tarballs only store timestamps with 1s resolution, while the fontconfig cache uses nano-second resolution from the filesystem to check that a directory hasn't changed. So the font directories extracted by the installer were almost always considered out of date, causing applications that use fontconfig to trigger a rebuild of the cache. Now, when installing with DESTDIR set, we use a perl one-liner to remove the nanoseconds from the mtime of the fonts directories before running fc-cache, so that the timestamps recorded in the cache match what will be set after extracting the xfont set. Help and suggestions from at least guenther@, millert@, espie@ and deraadt@
30 lines
1.2 KiB
Makefile
30 lines
1.2 KiB
Makefile
# $OpenBSD: Makefile.bsd-wrapper,v 1.6 2018/07/09 21:20:56 matthieu Exp $
|
|
|
|
afterinstall:
|
|
.for fdir in 100dpi 75dpi OTF TTF Type1 cyrillic misc
|
|
rm -f ${DESTDIR}/usr/X11R6/lib/X11/fonts/${fdir}/fonts.dir
|
|
mkfontdir ${DESTDIR}/usr/X11R6/lib/X11/fonts/${fdir}
|
|
chown ${BINOWN}:${BINGRP} ${DESTDIR}/usr/X11R6/lib/X11/fonts/${fdir}/fonts.dir
|
|
chmod 644 ${DESTDIR}/usr/X11R6/lib/X11/fonts/${fdir}/fonts.dir
|
|
.endfor
|
|
.for fdir in OTF TTF Type1
|
|
mkfontscale ${DESTDIR}/usr/X11R6/lib/X11/fonts/${fdir}
|
|
chown ${BINOWN}:${BINGRP} ${DESTDIR}/usr/X11R6/lib/X11/fonts/${fdir}/fonts.scale
|
|
chmod 644 ${DESTDIR}/usr/X11R6/lib/X11/fonts/${fdir}/fonts.scale
|
|
.endfor
|
|
if test -z "$(DESTDIR)"; then \
|
|
echo "fc-cache -s -v ${DESTDIR}/usr/X11R6/lib/X11/fonts";\
|
|
fc-cache -s -v ${DESTDIR}/usr/X11R6/lib/X11/fonts ;\
|
|
chmod 644 ${DESTDIR}/var/cache/fontconfig/*; \
|
|
else \
|
|
echo "truncating font directories mtimes"; \
|
|
find "${DESTDIR}/usr/X11R6/lib/X11/fonts" -type d \
|
|
-exec perl -e 'utime+(stat)[8,9],$$_ for @ARGV' {} + ; \
|
|
echo "fc-cache -y ${DESTDIR} -s -v /usr/X11R6/lib/X11/fonts";\
|
|
fc-cache -y ${DESTDIR} -s -v /usr/X11R6/lib/X11/fonts;\
|
|
chown root:wheel ${DESTDIR}/var/cache/fontconfig/*; \
|
|
chmod 644 ${DESTDIR}/var/cache/fontconfig/*; \
|
|
fi
|
|
|
|
.include <bsd.xorg.mk>
|