Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 446012 - font.eclass should RDEPEND on media-libs/fontconfig
Summary: font.eclass should RDEPEND on media-libs/fontconfig
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Fonts Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-04 22:38 UTC by Kobboi
Modified: 2013-07-25 13:18 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch (font.eclass.patch,816 bytes, patch)
2013-04-16 06:06 UTC, Nikoli
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kobboi 2012-12-04 22:38:16 UTC
Installing from a binary package I created earlier, I noticed the following error (sorry, language is set to Dutch but the error should be clear:

>>> Installing (15 of 614) media-fonts/urw-fonts-2.4.9
 * Updating global fontcache ...
/var/tmp/portage/media-fonts/urw-fonts-2.4.9/temp/environment: regel 1244: fc-cache: opdracht niet gevonden (="command not found")

fc-cache is provided by fontconfig, which is not pulled in as a dependency

Reproducible: Always
Comment 1 Kobboi 2012-12-04 22:44:32 UTC
Edit: added similar issues with similar ebuilds
Comment 2 Kobboi 2012-12-12 21:38:35 UTC
When I emerge fontconfig from just stage3+snapshot and setting profile, I get the following, which already leads to the issue I mention

Calculating dependencies... done!
[nomerge       ] media-libs/fontconfig-2.9.0  USE="-doc -static-libs" 
[ebuild  N     ]  virtual/ttf-fonts-1  0 kB
[ebuild  N     ]   media-fonts/dejavu-2.33  USE="X -fontforge" 0 kB
[ebuild  N     ]  app-admin/eselect-fontconfig-1.1  0 kB
[ebuild  N     ]   media-libs/fontconfig-2.9.0  USE="-doc -static-libs" 0 kB
[nomerge       ] media-fonts/dejavu-2.33  USE="X -fontforge" 
[ebuild  N     ]  media-fonts/encodings-1.0.4  0 kB
[ebuild  N     ]  x11-apps/mkfontdir-1.0.7  0 kB
[ebuild  N     ]   x11-apps/mkfontscale-1.1.0  0 kB
[ebuild  N     ]    x11-libs/libfontenc-1.1.1  USE="-static-libs" 0 kB
[nomerge       ] media-fonts/encodings-1.0.4 
[ebuild  N     ]  media-fonts/font-util-1.3.0  0 kB
[nomerge       ] media-libs/fontconfig-2.9.0  USE="-doc -static-libs" 
[ebuild  N     ]  media-libs/freetype-2.4.10-r1  USE="X bzip2 -auto-hinter -bindist -debug -doc -fontforge -infinality -static-libs -utils" 0 kB
[ebuild  N     ]   x11-libs/libX11-1.5.0  USE="ipv6 -doc -static-libs -test" 0 kB
[ebuild  N     ]    x11-libs/libxcb-1.9  USE="-doc (-selinux) -static-libs" 0 kB
[ebuild  N     ]     dev-libs/libxslt-1.1.27  USE="crypt -debug -python -static-libs" 0 kB
[ebuild  N     ]      dev-libs/libgcrypt-1.5.0-r4  USE="-static-libs" 0 kB
[ebuild  N     ]       dev-libs/libgpg-error-1.10-r1  USE="nls -common-lisp -static-libs" 0 kB
[ebuild  N     ]     dev-libs/libpthread-stubs-0.3  USE="-static-libs" 0 kB
[ebuild  N     ]     x11-proto/xcb-proto-1.8  0 kB
[ebuild  N     ]    x11-libs/xtrans-1.2.7  USE="-doc" 0 kB
[ebuild  N     ]    x11-proto/inputproto-2.2  0 kB
[ebuild  N     ]    x11-proto/xf86bigfontproto-1.2.0  0 kB
[ebuild  N     ]    x11-proto/xextproto-7.2.1  USE="-doc" 0 kB
[ebuild  N     ]    x11-proto/kbproto-1.0.6  0 kB
[ebuild  N     ]   x11-libs/libXau-1.0.7  USE="-static-libs" 0 kB
[ebuild  N     ]   x11-libs/libXdmcp-1.1.1  USE="-doc -static-libs" 0 kB
[ebuild  N     ]    x11-proto/xproto-7.0.23-r1  USE="-doc" 0 kB
Comment 3 Ben de Groot (RETIRED) gentoo-dev 2013-03-02 13:43:04 UTC
font.eclass already depends on fontconfig
Comment 4 Kobboi 2013-03-04 07:37:56 UTC
(In reply to comment #3)
> font.eclass already depends on fontconfig

It DEPENDs. Shouldn't it RDEPEND, since it's using fontconfig outside of the src_* ebuild phases?
Comment 5 Ben de Groot (RETIRED) gentoo-dev 2013-04-05 13:25:42 UTC
You're right. Fixed.
Comment 6 Nikoli 2013-04-16 05:32:55 UTC
I think solution from http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/font.eclass?r1=1.54&r2=1.55 is wrong. Instead of forcing installation of fontconfig with all deps like freetype and virtual/ttf-fonts you should just drop fontconfig from deps and run fc-cache only when it exists. fontconfig ebuilds run '/usr/bin/fc-cache -srf' in pkg_postin, so such change is safe.

I found this bug when i was updating my minimal server system where only media-fonts/terminus-font was installed, 'emerge --depclean --with-bdeps=n -qa' output did not have fontconfig.
Comment 7 Nikoli 2013-04-16 06:06:29 UTC
Created attachment 345658 [details, diff]
patch
Comment 8 Luca Barbato gentoo-dev 2013-06-08 08:30:12 UTC
I think Nikoli is right, you might use a font without fontconfig.

Probably is better inject a fontconfig? () dep and act accordingly.
Comment 9 Peter Volkov (RETIRED) gentoo-dev 2013-07-24 06:24:26 UTC
Luca, I think following patch does not fix this issue:

"Do not require fontconfig at runtime, it isn't necessary for many purposes, thanks to Nikoli for the original patch"

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/font.eclass?r1=1.55&r2=1.56

Nikoli suggests to drop fontconfig dependency completely and tend to agree here. Let's give other packages opportunity to depend on fontconfig, if they use it. The problem with such approach is that if user first installs all fonts and then installs some package that uses fontconfig, fontcontfing will be installed, but fonts will be not prepared. So a I see correct solution here will be:

1. Drop fontconfig dependency from eclass
2. Update fontconfig package to run fc-cache once it is installed and no fonconfig cache created.

Actually we already do 2 in fontconfig, so I guess it's safe to drop fontconfig dependency at all.

Opinions?

BTW, ChangeLog mentions some "runtime" while there is no "run time" for eclasses :)
Comment 10 Nikoli 2013-07-24 15:48:01 UTC
> 2. Update fontconfig package to run fc-cache once it is installed and no fonconfig cache created.

fontconfig ebuilds already do it, line 126:
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-libs/fontconfig/fontconfig-2.8.0-r1.ebuild?view=markup
Comment 11 Peter Volkov (RETIRED) gentoo-dev 2013-07-25 06:19:37 UTC
(In reply to Nikoli from comment #10)
> fontconfig ebuilds already do it

Yup, that's what was said in comment #8. :)

I'm more interested if I'm missing anything else?
Comment 12 Nikoli 2013-07-25 06:33:53 UTC
Seems like not, removing fontconfig dep from eclass is safe.
Comment 13 Ben de Groot (RETIRED) gentoo-dev 2013-07-25 09:12:10 UTC
(In reply to Nikoli from comment #12)
> Seems like not, removing fontconfig dep from eclass is safe.

Then we should remove the calls to fc-cache as well.
Comment 14 Peter Volkov (RETIRED) gentoo-dev 2013-07-25 09:29:36 UTC
 Ben, could you elaborate, why?
Comment 15 Ben de Groot (RETIRED) gentoo-dev 2013-07-25 09:52:10 UTC
Because they depend on fontconfig. If you drop that dependency, you get "automagic" behaviour. To me that seems inconsistent. 

Or maybe we can make it dependent on a useflag?
Comment 16 Peter Volkov (RETIRED) gentoo-dev 2013-07-25 13:18:38 UTC
Discussed issue with Ben in irc:

In font.eclass we made fontconfig optional runtime (execution time) dependency for eclass:

if has_version media-libs/fontconfig && [[ ${ROOT} == / ]]; then 
    fc-cache -fs 

For ebuilds with optional runtime dependencies we just throw elog suggestions to install required packages (if user desires some feature emerge c/p). For eclass ... this looks not necessary.

USE flag is also unnecessary: if there is no application installed that uses fontconfig then no need to update cache, once application will be installed cache will be created and updated as necessary.

Dependency dropped. Also added einfo message if fontconfig generation cache was skipped: 
elog "Skipping fontcache update (media-libs/fontconfig is not installed or ROOT != /)"