What about improving the desktop ports consistency: task 1, the fonts

Alberto Villa avilla at freebsd.org
Tue Feb 28 12:14:17 UTC 2012


On Tuesday 28 February 2012 03:57:02 Alberto Villa wrote:
> When not using XORG_CAT=font and INSTALLS_TTF=yes, ports just 
mimic
> that behaviour, with some deviations (like installing fonts.scale and
> fonts.dirs files) which appear not to be optimal. I will try converting
> some ports to bsd.xorg.mk magic and see what changes.

I had a closer look at the process, and read some documentation as well.

fontconfig is *required* to be run after installation to update fontconfig 
system fonts cache. Some ports which run it explicitly don't pass option -s 
(while bsd.xorg.mk does), thus updating also user's (in that case, root's!) 
cache, which is not what we want. fc-cache @exec line in bsd.xorg.mk is 
thus correct and *required*.
I'm not sure about @unexec line, though. It doesn't remove the font from 
the cache, so the only reason for its existence I can think of is if a port 
overwrites a font installed by another port, and on deinstallation it restores 
it. But this sounds like something which should not happen by design. 
melflynn: ideas on why that line could be there? Meanwhile, I'll see if I can 
ask to the author of that code. If it's useless, it should be removed, as it 
also slows down a bit the port deinstallation.
A @unexec line should also be added by bsd.xorg.mk to remove 
font.cache-1 files. According to melflynn, they're backup files created by 
(old?) fc-cache, so let's do some garbage cleaning.

mkfontscale and mkfontdir are *required* to update X fonts cache (i.e., 
font.scale and font.dir files). We could package font.* files, but this would 
break horribly if we end up installing two ports in the same directory. So, 
since we already have to put fc-cache in post installation scripts, there's no 
reason in not adding those too. Plus, if we want to package those files, we 
need to keep them in sync with the fonts on every update, which is sub-
optimal. Both @exec and @unexec lines are *required* here, still for the "n 
ports, 1 directory" reason above.

> > > (do we still need that FontPath thing?, if no then the
> > > pkg-message asking people to fill it should be dropped)
> > 
> > I think we do, but will try and report.
> 
> I'm currently running KDE with stock FontPath's, and I can use my port-
> installed fonts. Seems like fontconfig takes care of this. Thus, there's no
> pkg-message in my port.
> I wonder, though, if there's still software not using fontconfig: I guess
> that, in that case, FontPath might be required.

Apparently there is some, so the pkg-message is still required (without the 
line about loading FreeType). I'd like to fill it via bsd.xorg.mk, but that 
wouldn't let maintainers write their custom pkg-message. Maybe we could 
make it conditional, i.e., if maintainer didn't set any pkg-message, write it 
automatically.

About the packaging issue: I know I've talked about @exec's and 
@unexec's above, but I think we can convert them to standard post-* 
scripts. Can't we? This would conflict with maintainers custom scripts, of 
course, just like pkg-message, but the solution might be the same.
-- 
Alberto Villa, FreeBSD committer <avilla at FreeBSD.org>
http://people.FreeBSD.org/~avilla

Der Horizont vieler Menschen ist ein Kreis mit Radius Null -
und das nennen sie ihren Standpunkt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 314 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freebsd.org/pipermail/freebsd-desktop/attachments/20120228/36fcbeec/attachment-0001.pgp


More information about the freebsd-desktop mailing list