Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Feb 2012 14:57:20 +0100
From:      Mel Flynn <rflynn@acsalaska.net>
To:        Alberto Villa <avilla@freebsd.org>
Cc:        freebsd-desktop@freebsd.org
Subject:   Re: What about improving the desktop ports consistency: task 1, the fonts
Message-ID:  <4F4CDD40.1030906@acsalaska.net>
In-Reply-To: <201202281314.13503.avilla@freebsd.org>
References:  <20120120065141.GM4729@azathoth.lan> <201201201004.36979.avilla@freebsd.org> <201202280357.05198.avilla@freebsd.org> <201202281314.13503.avilla@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2/28/2012 13:14, Alberto Villa wrote:
> 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*.

It is only incorrect for the INSTALL_AS_USER case. In that case the
FONTROOTDIR should be set to $PREFIX/.fontconfig and -s should be
omitted. The not so pretty case is where she sets PREFIX to be something
else then $HOME. Also, when -s is omitted, fc-cache will still try the
system directories (and fail) and generate some mild noise if -v is also
set.

> 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.

So the unexec is executed before the font is removed? The unexec makes
sense if executed after the .ttf is removed. The cache should be updated
then and if a directory tree is used by multiple ports this should
effectively remove only the uninstalled font from the cache, while
preserving the other fonts. So the unexec should be there for this case:

./TTF/myport.ttf
./TTF/otherport/otherport.ttf

> 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.

Note that the only machine I found it on hasn't been updated since 7.2.
They may be the old format. fc-cache man page only references
fonts.cache-2 which are font name to file mappings. So it's likely that
fonts.cache-1 used to be the same with different format.

> 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,

There are a handful of few ports that OPTIONally have fontconfig support:
databases/phpmyadmin
graphics/evas-core
graphics/ImageMagick
graphics/gd
multimedia/mencoder
print/ghostscript9
print/ghostscript8

With the exception of evas-core, these are all applications that are not
primarily X applications. As for mencoder, it's also doubtful to turn it
on/off. Makes more sense to me to tie it to subtitle support as it's
confusing for a user to install a better font for subtitles and mencoder
not picking up on it, especially since the default is off.

 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.

You could define a variable that a maintainer can use in pkg-message.
Might be tricky with \n. Documenting it and providing default text is
the better solution in my opinion. Especially if you fix up existing
ports to use the standard text, so that if a maintainer copies another
port he's using the correct text.

> 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.

I'm not sure 8 lines is enough to motivate a script, but it would at
least resolve any ordering/timing issues if they exist now.
-- 
Mel



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F4CDD40.1030906>