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
Edit: added similar issues with similar ebuilds
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
font.eclass already depends on fontconfig
(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?
You're right. Fixed.
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.
Created attachment 345658 [details, diff] patch
I think Nikoli is right, you might use a font without fontconfig. Probably is better inject a fontconfig? () dep and act accordingly.
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 :)
> 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
(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?
Seems like not, removing fontconfig dep from eclass is safe.
(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.
Ben, could you elaborate, why?
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?
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 != /)"