Commit Graph

82 Commits

Author SHA1 Message Date
adisbladis
8ce7893477 emacs: add back treeSitter passthru 2023-06-20 02:18:47 +12:00
adisbladis
75650d79da emacs: add nativeComp passthru
As reported by @terlar in
https://github.com/NixOS/nixpkgs/pull/235859#issuecomment-1597012885
the removal of nativeComp in passthru breaks external tooling.

This adds back `passthru.nativeComp` with a deprecation notice which sets the removal for 23.11.
2023-06-20 02:18:47 +12:00
Mario Rodas
104992f3cf emacs: disable withXwidgets on darwin
withXwidgets requires webkitgtk, which is marked as broken on Darwin.
2023-06-13 04:20:00 +00:00
Anderson Torres
e5e43e6beb emacs generic: rename attributes
Namely:

- treeSitter -> withTreeSitter
- nativeComp -> withNativeCompilation
2023-06-07 23:26:31 -03:00
Anderson Torres
196d71b295 emacs generic: decouple Xwidgets from X 2023-06-04 22:51:03 -03:00
Anderson Torres
441036d7f9 emacs generic.nix: append -macport to pname when appropriate 2023-06-04 22:49:27 -03:00
Anderson Torres
6a6110bd76 emacs generic.nix: require pname
Also, remove versionModifier and name
2023-06-04 22:46:55 -03:00
Brian Leung
0bf7571e2f
emacs: Enable SQLite3 and WebP for Emacs >=29 2023-05-30 16:04:30 -07:00
Anderson Torres
c4e48ded59 emacs: a huge refactor
A list of modifications:

- The calling handles at `top-level/all-packages.nix` were transferred to
`pkgs/applications/editors/emacs/default.nix` (the good old `recurseIntoAttrs`
design pattern);
- The files `macport.nix` and `28.nix` were removed, replaced by the bigger and
better `sources.nix`;
- Aliases for the most important derivations were put on `all-packages.nix`;
- The file `generic.nix` was refactored. Among its changes, the most noticeable:
  - `pname` is decorated according to the selected UI options;
  - Environment variables are explicitly under `env` set;
  - The `null` defaults and (in)equality tests were removed;
    - It obliged the addition of some Boolean flag guards;
  - The flag `noGui` was added, allowing easier override for `emacs-nox`.

With this huge refactor, the emacs build functions become more sane and
maintainable, allowing future additions.
2023-05-29 22:16:45 -03:00
Vladimír Čunát
fd77cd7a01
Merge branch 'master' into staging-next
Indentation conflict in vulkan-related src fetches.
2023-04-08 11:33:08 +02:00
Adam Joseph
82d4de8ecf emacs: mark meta.broken if cross 2023-04-07 00:46:00 -07:00
Bernardo Meurer
f1f6ca8bcd
Merge pull request #209870 from amjoseph-nixpkgs/pr/stdenv/external-gcc-bootstrap 2023-04-03 08:19:03 -07:00
Adam Joseph
6c209e862e emacs: path fixes resulting from libgccjit changes
The Nix-driven bootstrap of gcc resulted in some changes to the
structure of the `libgccjit` outpaths, and also added an additional
output (`libgcc`) to `gcc`.

This commit makes the corresponding changes in the `emacs`
derivation in order to not break emacs.

Emacs is the only user of `libgccjit` in nixpkgs at the moment.
2023-04-02 13:49:54 -07:00
adisbladis
f5c5751d07
Merge pull request #224125 from tadfisher/emacs-pgtk-wrapgappshook
emacs: include wrapGAppsHook for pgtk build
2023-04-01 14:36:19 +13:00
Tad Fisher
42e2af66c4
emacs: include wrapGAppsHook for pgtk build 2023-03-31 12:51:43 -07:00
Chris Hodapp
1a8edfe192
emacs: Add basic tree-sitter support (#219559)
This commit adds basic support for tree-sitter in the emacs build,
such that (if the user opts into tree-sitter support), tree-sitter
will be enabled and binary library files for tree-sitter can be
included in the `lib` directory of packages passed to
`emacsWithPackages`. The libraries will be aggregated and included in
treesit-extra-load-path.

The previous pattern for this in the community was to add tree-sitter
libaries by patching emacs's `RUNPATH` with `patchelf` in a post-fixup
phase. However, this has the substantial drawback that two different
emacs installations with different lists of available tree-sitter
libraries must be entirely separate builds. By supplying the
tree-sitter libraries in the wrapping layer of `emacsWithpackages`, it
becomes possible to share a single, more-cacheable "core emacs".

This support defaults to "on" only in emacs 29 and up, since previous
versions do not support tree-sitter out of the box.
2023-03-15 16:51:29 +13:00
Mario Rodas
6bb4f0f103 emacs: use mkDerivation with finalAttrs
This will help the emacs overlays to correctly apply the native
compilation patch.
2023-02-04 04:20:00 +00:00
Adam Joseph
42815b4a0c treewide: systemdSupport: use lib.meta.availableOn
Many packages have some kind of flag indicating whether or not to build with
systemd support.  Most of these default to `stdenv.isLinux`, but systemd does
not build on (and is marked `broken` for) `isStatic`.  Only a few packages have
the needed `&& !isStatic` in the default value for their parameter.

This commit moves the logic for the default value of these flags into
`systemd.meta.{platforms,badPlatforms}` and evaluates those conditions using
`lib.meta.availableOn`.

This provides three benefits:

1. The default values are set correctly (i.e. including `&& isStatic`)

2. The default values are set consistently

3. The way is paved for any future non-Linux systemd platforms (FreeBSD is
   reported to have experimental systemd support)
2023-01-22 00:27:19 -08:00
Artturin
2eeb34c273 treewide: {build,host,target}Platform -> stdenv.{build,host,target}Platform 2023-01-09 21:13:22 +02:00
Sergei Trofimovich
8f88cd3f7a emacs: drop unused xlibsWrapper 2022-12-01 23:54:14 +00:00
Brian Leung
8ede52a7c1
emacs: change substituteInPlace invocation to an aligning patch
Commit 97b928ce09d6034ebcb541fb548e5d4862302add in Emacs
messed up the substituteInPlace. Use a patch instead to prevent silent failures.

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=97b928ce09d6034ebcb541fb548e5d4862302add
2022-11-30 11:37:12 -08:00
Thibault Polge
b42d97f572
emacs: build pgtk variant with full image support
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>
2022-11-22 07:29:44 +01:00
Adam Joseph
0e2c58c77f
emacs: add withSystemd option 2022-11-14 23:05:55 +13:00
Atemu
5dd7a6e33d emacs: don't call macport emacs -nox 2022-10-15 19:31:54 +02:00
Atemu
d34513014f emacs: always put texinfo in nativeBuildinputs for macport builds
Non-source macport builds require it
2022-10-15 19:31:54 +02:00
Atemu
338701e3de emacs: add myself as maintainer
I added macport support to the generic drv and will maintain that part
2022-10-15 19:31:54 +02:00
Atemu
45d9595b41 emacs: consider macport in meta 2022-10-15 19:31:54 +02:00
Atemu
0ae5a9688b emacs: move Linux-only buildInputs where they belong 2022-10-15 19:31:54 +02:00
Atemu
76d7a14ed2 emacs: integrate macport into generic drv 2022-10-15 19:31:53 +02:00
Atemu
470e40eb1f emacs: provide functional default for patches argument 2022-10-15 19:23:56 +02:00
Brian Leung
499921d643
emacs: avoid installing gsettings-desktop-schemas on Darwin 2022-09-09 15:03:16 -07:00
Brian Leung
6d0e82f11a
emacs: use withPgtk option more
- do not require X when withPgtk is true
- make default settings and boolean logic consistent with withPgtk setting
2022-09-05 16:39:01 -07:00
Anderson Torres
1ed2ad6290
Merge pull request #189543 from adisbladis/emacs-lucid-default
emacs: Switch to lucid as the default toolkit
2022-09-03 10:02:49 -03:00
Anderson Torres
104d14b3c1
Merge pull request #187968 from adisbladis/emacs-xinput2-29
emacs: Enable xinput2 on version 29 and newer
2022-09-03 00:41:06 -03:00
adisbladis
c1861b6658 emacs: Switch to lucid as the default toolkit
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.
2022-09-03 15:31:45 +12:00
adisbladis
d20c9d7a88 emacs: Set recurseIntoAttrs on package set
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.
2022-08-24 08:45:46 +08:00
adisbladis
ca25a9c7b2 emacs: Enable xinput2 on version 29 and newer 2022-08-23 14:27:12 +08:00
adisbladis
73c90badf3 emacs: Simplify patchelf invocation when building with lucid 2022-08-23 14:27:12 +08:00
Lin Jian
51bd7cf0d0
emacs: enable native-comp 2022-08-18 20:38:37 +08:00
adisbladis
54e795706d emacs: Build from git instead of tarball to fix native compilation
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.
2022-04-27 07:20:33 +12:00
Daniel Nagy
506050b57f
emacs: prepare webp support for versions >=29.1
This prepares the derivation for the upcoming webp image file format
support with Emacs 29.1. Therefore this change is mainly useful with the
"emacs-overlay".

https://github.com/nix-community/emacs-overlay/

Changelog from upstream Emacs:

1cdb8d4c99/etc/NEWS (L435-L439)

More info on image formats in Emacs and how to check for their support:

https://www.gnu.org/software/emacs/manual/html_node/elisp/Image-Formats.html
2022-04-18 17:45:47 +02:00
Azat Bahawi
55f57facbf emacs: 27.2 -> 28.1 2022-04-16 16:53:45 +12:00
Felix Buehler
2e5f265fdb emacs-nox: remove appendToName to have a consistent package name for repology 2022-03-02 11:00:53 -08:00
andreoss
e0620fbefe
emacs: Add withToolkitScrollBars argument 2022-01-30 12:12:21 -05:00
Fabian Möller
4329d79dba
nixos/tests: link tests to their packages 2022-01-23 21:08:10 +01:00
Have a good time
3fdeef8a7e
emacs: Add withXinput2 argument 2021-12-27 17:08:27 +08:00
adisbladis
dbc5845320 emacs: Add withPgtk argument
Recently Emacs merged the pgtk branch.
2021-12-24 11:49:56 -08:00
adisbladis
4b89ac58bb emacs: Use string replacement for gvfs tramp detection rather than a patch
The patches are unwieldy to manage, especially with the automated packaging flows in the Emacs overlay.
2021-12-14 14:35:34 -08:00
Brian Leung
7c8fae3b8b emacs: Add sqlite support introduced in Emacs 29 2021-12-12 22:47:10 -08:00
Peter Simons
476635afe1 Drop myself from meta.maintainers for most packages.
I'd like to reduce the number of Github notifications and
review requests I receive.
2021-10-14 11:01:27 +02:00