about summary refs log tree commit diff
path: root/pkgs/build-support/emacs
AgeCommit message (Collapse)AuthorFilesLines
2023-03-15emacs: Add basic tree-sitter support (#219559)Chris Hodapp1-0/+11
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.
2022-10-04emacs: remove warning of xargs when doing AOT native-compLin Jian1-1/+1
Before, there is a warning: xargs: warning: options --max-args and --replace/-I/-i are mutually exclusive, ignoring previous --max-args value According to the manual[1], swap -I and -n can remove this warning. [1]: https://www.gnu.org/software/findutils/manual/html_node/find_html/Conflicting-xargs-options.html
2022-09-18package-build: don't use mtime when creating tarballsOsama Rebach2-5/+58
2022-09-18update package-build: 35017a2 -> c3c535eOsama Rebach1-2/+2
2022-07-11emacsWithPackages: Rely on package.el for autoloadsThomas Tuegel2-16/+3
The builtin `package.el` functionality is necessary and sufficient to handle autoloads in the Emacs wrapper.
2022-05-23emacsPackages.melpaBuild: Update package-build, avoid monkey-patchTad Fisher2-6/+16
2022-04-22emacsWrapper: add missing variable substitutions to Darwin appMario Rodas1-0/+2
2022-04-19emacsWrapper: fix mishandling of empty package listDaniel Nagy2-1/+8
The native compiler of emacs does not handle empty files well. This arose in https://github.com/NixOS/nixpkgs/pull/168954 .
2022-04-17emacsWrapper: preload autoloadsDaniel Nagy2-3/+8
This commits changes the Emacs wrapper, in order to preload all autoload definitions when built with additional packages. The list of all definitions is generated at build-time. Packages do not need to be (require)d for them to work. Before this change, a code like ```sh nix-shell -I "nixpkgs=$PWD" -p "emacs.pkgs.withPackages(e:[e.magit])" \ --run "emacs -Q -nw -f magit" ``` will fail with the message `Symbol’s function definition is void: magit` After the change, the same code above will open Emacs with magit enabled. A slightly longer startup time of ~10ms was detected in local, informal experiments. More information on autoloading: https://www.gnu.org/software/emacs/manual/html_node/eintr/Autoload.html
2021-12-19melpa2nix: Ignore large file warningsadisbladis1-0/+3
While we haven't encountered any problems related to this in MELPA it's just a matter of time (this just happened for an ELPA package (phps-mode)).
2021-12-19emacs: Ignore large file warnings for native compilationadisbladis1-1/+1
This was blocking building phps-mode with native compilation enabled.
2021-11-14emacs: resolve wrapper load-path at build timeRobert Helgesson2-2/+13
Since the included package set is determined at build time we can also generate the `subdirs.el` file at build time. This improves startup time somewhat since we don't have to traverse the directory to add to `load-path`. For example, ``` sh-session $ bench './emacs-old -Q --batch --kill' './emacs-new -Q --batch --kill' benchmarking bench/./emacs-old -Q --batch --kill time 72.77 ms (71.66 ms .. 73.65 ms) 1.000 R² (0.999 R² .. 1.000 R²) mean 72.49 ms (72.06 ms .. 72.92 ms) std dev 746.5 μs (582.4 μs .. 1.008 ms) benchmarking bench/./emacs-new -Q --batch --kill time 40.56 ms (40.24 ms .. 40.86 ms) 1.000 R² (0.999 R² .. 1.000 R²) mean 40.30 ms (40.12 ms .. 40.51 ms) std dev 401.9 μs (311.1 μs .. 555.8 μs) ``` The change does not actually affect the content of `load-path`: ``` sh-session $ diff -s <(./emacs-old --batch --eval '(prin1 load-path)' | sed -E 's!/nix/store/[[:alnum:]]{32}-!!g') \ <(./emacs-new --batch --eval '(prin1 load-path)' | sed -E 's!/nix/store/[[:alnum:]]{32}-!!g') Files /dev/fd/63 and /dev/fd/62 are identical ``` So in principle the only observable effect should be the improved startup time.
2021-08-16elpa-packages: deprecate phasesFelix Buehler1-1/+1
2021-08-04Merge pull request #130021 from neosimsim/fix-emacs-override-examplesadisbladis1-1/+1
emacs: fix overrideScope' examples
2021-07-21Merge pull request #128786 from pjones/pjones-fix-elpa-srcThomas Tuegel1-1/+1
elpaBuild: Delay src evaluation so it can be overridden
2021-07-15Merge pull request #127980 from matthewbauer/darwin-emacs-native-compMatthew Bauer4-7/+12
Add gcc for emacs wrapper so native-comp works
2021-07-12emacs: fix overrideScope' examplesAlexander Ben Nasrallah1-1/+1
2021-07-06emacs.pkgs.melpaBuild: package-build: 2018-10-05 -> 2021-04-13Alyssa Ross2-4/+7
I think this is due an update. I've chosen to update to the latest version that has been merged into Melpa. Unfortunately we now need to hack around it trying to run VCS commands. My Emacs configuration with thirty-something leaf packages seems fine after the rebuild.
2021-06-30elpaBuild: Delay src evaluation so it can be overriddenPeter Jones1-1/+1
This change allows ELPA packages to have their src attribute updated by overrideAttrs. Without this change the installPhase references the original src attribute and overriding is not possible.
2021-06-23Add gcc for emacs wrapper so native-comp worksMatthew Bauer4-7/+12
On macos, we don’t have a gcc executable by default, which is required for some reason when compiling site-start.
2021-05-06emacs: adapt to renamed native-comp variablesMauricio Collares1-2/+2
2021-02-25emacsWithPackages: prevent the UI showing prematurely during startupmidchildan1-1/+7
This change makes the wrapper script avoid displaying echo area messages during startup. This helps prevent split second UI glitches early in the startup process. The messages itself will still be logged and therefore will not hamper inspection for debugging purposes.
2021-02-19emacs: add currently compiling package dirs to load-pathMauricio Collares4-17/+26
Co-authored-by: Tad Fisher <tadfisher@gmail.com>
2021-01-26emacs.pkgs.trivialBuild: add missing stdenv argumentDaniël de Kok2-3/+3
Fix fallout of #110687 (generic.nix requires stdenv).
2021-01-25treewide: remove stdenv where not neededPavol Rusnak1-1/+1
2021-01-13treewide: emacsPackages -> emacs.pkgs & emacsWithPackages -> ↵adisbladis1-7/+7
emacs.pkgs.withPackages The previous names are now aliases and shouldn't be used anywhere inside nixpkgs.
2021-01-08emacs: fix accidental double wrapper (Darwin)Alyssa Ross1-4/+0
This was already fixed on non-Darwin, but the fix missed that it was also reintroduced for the Darwin code path at the same time. Fixes: dd5d2482c9d ("emacs: Fix accidental double wrapping")
2020-12-20emacs: replace 'emacs.nativeComp' in wrapper with 'nativeComp'Matthieu Le brazidec (r3v2d0g)1-1/+1
2020-12-17emacs: Fix accidental double wrappingadisbladis1-5/+0
This makeWrapper invocation found it's way back via a rebase.
2020-12-16emacs: Add comp-eln-load-path infrastructureTad Fisher4-3/+71
2020-12-12emacsWithPackages: fix application wrapper on darwinMario Rodas1-3/+3
2020-12-11Merge pull request #106606 from alyssais/elpa-metaadisbladis1-0/+11
emacsPackages.elpaBuild: pass through meta
2020-12-11Merge pull request #106608 from alyssais/melpa-homepageadisbladis1-1/+1
emacsPackages.melpaPackages: HTTPS for homepages
2020-12-10emacsWithPackages: don't tell sub-Emacs about pkgsAlyssa Ross1-0/+1
If I'm running an Emacs executable from emacsWithPackages as my main programming environment, and I'm hacking on Emacs, or the Emacs packaging in Nixpkgs, or whatever, I don't want the Emacs packages from the wrapper to show up in the load path of that child Emacs. It results in differing behaviour depending on whether the child Emacs is run from Emacs or from, for example, an external terminal emulator, which is very surprising. To avoid this, pass another environment variable containing the wrapper site-lisp path, and use that value to remove the corresponding entry in EMACSLOADPATH, so it won't be propagated to child Emacsen.
2020-12-10emacsWithPackages: mutate EMACSLOADPATH correctlyAlyssa Ross2-4/+38
An empty entry in EMACSLOADPATH gets filled with the default value. This is presumably why the wrapper inserted a colon after the entry it added for the dependencies. But this naive approach wasn't always correct. For example, if the user ran emacs with EMACSLOADPATH=foo, the wrapper would insert the default value (by adding the trailing `:') even though the user was trying to expressly opt out of it. To do this correctly, here I've replaced makeWrapper with a bespoke script that will actually parse the EMACSLOADPATH provided in the environment (if given), and insert the wrapper's load path just before the default value. If EMACSLOADPATH is given but contains no default value, we respect that and don't add the wrapped dependencies at all. If no EMACSLOADPATH is given, we insert the wrapped dependencies before the default value, just like before. In this way, the wrapped Emacs should now behave as if the wrapped dependencies were part of Emacs's default load-path value.
2020-12-10emacsPackages.melpaPackages: HTTPS for homepagesAlyssa Ross1-1/+1
2020-12-10emacsPackages.elpaBuild: pass through metaAlyssa Ross1-0/+11
Previously, meta wasn't being passed through at all, because it's removed from args without being used anywhere. This made it so that rcirc-menu wasn't being marked as broken even though it was supposed to be. This patch copies the meta handling from melpaBuild, including the default home page (adapted for ELPA).
2020-07-24emacs: Add native builds for nativeComp enabled emacsenadisbladis1-0/+10
2020-06-02Fix building of emacsWithPackages not findind subdirs.elDwarfMaster1-1/+1
2020-04-02emacs: fix setup-hookRobert Helgesson1-8/+16
This change fixes byte compilation of, e.g., Helm without breaking builds using, e.g., `trivialBuild`. See https://github.com/NixOS/nixpkgs/pull/82604#issuecomment-607201755
2020-03-14emacs: improve setup hookRobert Helgesson1-9/+21
- Add packages installed in a sub-directory of site-lisp, such as mu4e, to EMACSLOADPATH. - Add ELPA packages to EMACSLOADPATH. - Add each package only once to EMACSLOADPATH. Before, each package would typically be added twice for each transitive dependency leading to a huge variable for a package having many dependencies. Fixed #78680
2019-11-23emacs package setup hook: Fix FixHerwig Hochleitner1-2/+4
A trailing separator in emacs load paths has semantics cc @Ericson2314 @adisbladis https://github.com/NixOS/nixpkgs/pull/73287 This partially reverts commit ca782498a9532c48d8e12ce402813486ab90e7f0
2019-11-08emacs package setup hook: FixJohn Ericson1-3/+3
1. Make the test more robust 2. EMACSLOADPATH may be initially undefined. 3. did `targetOffset` twice when meant `hostOffset` too
2019-09-18emacs: use runCommand to generate wrapperRobert Helgesson1-103/+106
This removes the unnecessary compiler build dependency. We also set preferLocalBuild = true; allowSubstitutes = false; to not farm out the build on a remote builder or bother with trying to find a binary substitution.
2019-08-30emacsPackages: Drop old emacsPackages (non-NG) setsadisbladis1-2/+2
These have been deprecated for a long time now and has not seen much maintenance.
2019-04-29treewide: Remove usage of isNullDaniel Schaefer1-1/+1
isNull "is deprecated; just write e == null instead" says the Nix manual
2019-02-02emacs: Link subdirs.el into emacs-packages-depsMohammed Yaseen Mowzer1-4/+8
Emacs loads all the elisp files in the top-level of the site-lisp directory. However some packages (e.g. mu4e) put their elisp files in a subdirectory of site-lisp. Emacs will not load these packages unless subdirs.el is present. This commit links the subdirs.el file from the emacs package into the emacs-package-deps package so that packages that put their elisp files in a subdirectory of site-lisp are loaded.
2018-11-27melpaBuild: Get package-build from melpa/package-buildThomas Tuegel1-6/+6
This commit causes melpaBuild to use package-build from melpa/package-build instead of melpa/melpa. Development of package-build happens in the former repository whereas the latter is much larger, containing also the MELPA recipes. We do not need to fetch the MELPA recipes from melpa/melpa, as we fetch them one-by-one for Nixpkgs.
2018-11-27emacsPackagesNg.trivialBuild: cleanup and standardize functionBenjamin Hipple2-19/+13
No real function change here, but this updates the trivial and melpa builders to be formatted more consistently with the rest of the builders, and swaps `eval "$preBuild"` for the more standard `runHook preBuild`.
2018-09-24lib: Make `overrideScope'` which takes arguments in the conventional orderJohn Ericson1-1/+1
The `overrideScope` bound by `makeScope` (via special `callPackage`) took an override in the form `super: self { … }`. But this is dangerously close to the `self: super { … }` form used by *everything* else, even other definitions of `overrideScope`! Since that implementation did not even share any code either until I changed it recently in 3cf43547f4be03d1d6eb0bbfc557e2dbc13b4095, this inconsistency is almost certainly an oversight and not intentional. Unfortunately, just as the inconstency is hard to debug if one just assumes the conventional order, any sudden fix would break existing overrides in the same hard-to-debug way. So instead of changing the definition a new `overrideScope'` with the conventional order is added, and old `overrideScope` deprecated with a warning saying to use `overrideScope'` instead. That will hopefully get people to stop using `overrideScope`, freeing our hand to change or remove it in the future.