Emacs built with pgtk ("pure gtk") isn't X, so `withX` isn't true.
This commit extends the test conditions for format libraries inclusion
to withX || withPgtk, so Pgtk Emacs gets image format support
libraries as well.
Co-authored-by: Atemu <atemu.main@gmail.com>
Because of long standing bugs and stability issues & an
uncollaborative upstream there has been talk on the emacs-devel
mailing list to switch the default toolkit to
Lucid (https://lists.gnu.org/archive/html/emacs-devel/2022-08/msg00752.html).
The GTK build also has issues with Xinput2, something that both we and
upstream want to enable by default in Emacs 29.
This situation has prompted me to use both Lucid an no-toolkit (pure X11) Emacs
as a daily driver in recent weeks to evaluate what the
advantages/drawbacks are and I have concluded that, at least for me,
switching the toolkit to Lucid is strictly an upgrade.
It has resulted in better stability (there are far fewer tiny UX
issues that are hard to understand/identify) & a snappier UI.
On top of that the closure size is reduced by ~10%.
In the pure X11 build I noticed some unsharpness around fonts so this
is not a good default choice.
As with everything there is a cost, and that is uglier (I think most
would agree but of course this is subjective) menu bars for
those that use them and no GTK scroll bars.
For anyone who still wants to use GTK they could of course still
choose to do so via the new `emacs-gtk` attribute but I think this
is a bad default.
A note to Wayland users:
This does not affect Wayland compatibility in any way since that will
already need a PGTK build variant in the future.
In the past the motivation to not recurse into Emacs packages was that
it added quite a lot of packages to the evalution and they were so
fast to build locally that substituting them from a binary cache
didn't make sense.
With native compilation this equation has changed drastically, build
times are much longer and build closures are larger so the utility
of having cached packages has gone way up.
Additionally, it looks to me like Emacs is the only ecosystem in nixpkgs to
ever care about evaluation performance like this.
Every other extensible editor ecosystem has recurseIntoAttrs set to true on their respective
package sets.
Quoting @collares from #170426:
> The difference between the two versions is that one is built from the
> tarball, while the other is built from Git. The tarball includes
> byte-compiled (.elc) files but not native-compiled (.eln)
> files. The build notices the .elc files and does not rebuild them,
> but native-compilation is a side-effect of byte-compilation and so
> the .eln files aren't built either.
libungif was merged into giflib in 2006, and hasn't been updated
since. All non-broken packages still using it build fine with giflib.
See <http://giflib.sourceforge.net/history.html>.
This approach applies to _all_ RUN_TEMACS calls and successfully removes -dev paths from the closure and reduces the closure size from ~1.4G to just under ~464M.
It's also less brittle than having in-tree patches.
continuation of #109595
pkgconfig was aliased in 2018, however, it remained in
all-packages.nix due to its wide usage. This cleans
up the remaining references to pkgs.pkgsconfig and
moves the entry to aliases.nix.
python3Packages.pkgconfig remained unchanged because
it's the canonical name of the upstream package
on pypi.
This makes it much easier to create customisations around emacs via
the a new convenience passthru attr:
- `emacs.pkgs`: What used to be emacsPackages is now `emacs.pkgs`
The previous versioned names `emacs*Packages` have been moved to
aliases.nix and are now considered deprecated in favour of `emacs*.pkgs`.
siteVersionDir isn't a full path, it's just the name of the version
directory entry in $out/share/emacs, e.g. "27.1", so since
d1b0eef9b5 ("emacs: Don't use interpolation for version"), we've been
trying to remove a non-existent directory. This would have been
caught if we hadn't been giving -f to rm unnecessarily, because -f
suppresses errors. As well as fixing the path, I've removed the -f
from rm. Doing this to the line above as well revealed that rm-ing
$out/var was no longer necessary, since nothing has been put there
since ac23a7c459 ("emacs: 25.3 → 26.1") -- it would now only be
created if we set the --with-gameuser configure option, which we
don't.
Emacs 27 doesn't use ImageMagick by default to display images [1]:
** Emacs no longer defaults to using ImageMagick to display images.
This is due to security and stability concerns with ImageMagick. To
override the default, use 'configure --with-imagemagick'.
[1] https://github.com/emacs-mirror/emacs/blob/emacs-27.1/etc/NEWS#L96-L98