From owner-freebsd-desktop@FreeBSD.ORG Tue Feb 28 14:13:52 2012 Return-Path: Delivered-To: freebsd-desktop@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 808E7106564A for ; Tue, 28 Feb 2012 14:13:52 +0000 (UTC) (envelope-from rflynn@acsalaska.net) Received: from mailhub.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 36E158FC08 for ; Tue, 28 Feb 2012 14:13:51 +0000 (UTC) Received: from [127.0.0.1] (squeeze.lan.rachie.is-a-geek.net [192.168.2.30]) by mailhub.rachie.is-a-geek.net (Postfix) with ESMTP id 2CB7E7E854; Tue, 28 Feb 2012 04:57:11 -0900 (AKST) Message-ID: <4F4CDD40.1030906@acsalaska.net> Date: Tue, 28 Feb 2012 14:57:20 +0100 From: Mel Flynn User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Alberto Villa References: <20120120065141.GM4729@azathoth.lan> <201201201004.36979.avilla@freebsd.org> <201202280357.05198.avilla@freebsd.org> <201202281314.13503.avilla@freebsd.org> In-Reply-To: <201202281314.13503.avilla@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: freebsd-desktop@freebsd.org Subject: Re: What about improving the desktop ports consistency: task 1, the fonts X-BeenThere: freebsd-desktop@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using and improving FreeBSD on the desktop List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 14:13:52 -0000 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