4

I am using Ubuntu 19.10. I have nix version 2.3.1. I installed emacs 26.3 using:

nix-env -iA nixpkgs.emacs

When I launch emacs I get these error messages:

(process:9100): Gtk-WARNING **: 09:41:39.668: Locale not supported by C library.
Using the fallback 'C' locale.
Gtk-Message: 09:41:39.756: Failed to load module "canberra-gtk-module"
Gtk-Message: 09:41:39.756: Failed to load module "canberra-gtk-module"
Fontconfig warning: "/etc/fonts/fonts.conf", line 5: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/fonts.conf", line 6: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/fonts.conf", line 9: unknown element "description"
Fontconfig error: Cannot load config file from /etc/fonts/fonts.conf

Is there some way to fix this?

  • Does not seem to be related to nix. You're probably just missing a locale. https://askubuntu.com/questions/359753/gtk-warning-locale-not-supported-by-c-library-when-starting-apps-from-th – Chris Stryczynski Jan 06 '20 at 22:20
  • If I intstall emacs from source it loads wthout any of these errors. I don't see how these problems are not related to nix. I have a fresh install of Ubunto 19.10. I've installed nix and then used it to install emacs. Shouldn't the emacs pkg just work? I'm not sure, but I think the Fontconfig errors mean that emacs was created with a different version of Fontconfig than the version that is installed with Ubuntu 19.10. Unfortuntely, I don't know how the nix emacs pkg resolves Fontconfig. This is all guess work on my part. i am completely new to nix. – Darrell Pittman Jan 09 '20 at 15:51
  • In that case sounds like a config/packing issue with nix, it's probably best to open a issue at https://github.com/NixOS/nixpkgs – Chris Stryczynski Jan 09 '20 at 16:05

1 Answers1

1

The issue here is that Emacs in nixpkgs is built against a slightly older version of fontconfig (2.12.6) than is shipped with Ubuntu (2.13.1). However, the fontconfig 2.12.6 of Emacs tries to read the /etc/fonts/fonts.conf that was installed by fontconfig 2.13.1 of the host system. In the meantime some additional fields have been added to the configuration which the old version doesn't understand.

On my system I simply removed the offending lines from /etc/fonts/fonts.conf and have not experience any adverse effects yet.

Henri Menke
  • 10,010
  • 1
  • 20
  • 35