Skip to content

Commit fc52422

Browse files
authored
emacs: add a test for withPackages wrapper (#389315)
2 parents 949daad + cbbdf40 commit fc52422

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
runCommand,
3+
emacs,
4+
git,
5+
}:
6+
7+
runCommand "test-emacs-withPackages-wrapper"
8+
{
9+
nativeBuildInputs = [
10+
(emacs.pkgs.withPackages (
11+
epkgs: with epkgs; [
12+
magit
13+
]
14+
))
15+
git # needed by magit
16+
];
17+
}
18+
''
19+
emacs --batch --eval="(require 'magit)"
20+
touch $out
21+
''

pkgs/applications/editors/emacs/make-emacs.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@
128128
QuartzCore,
129129
UniformTypeIdentifiers,
130130
WebKit,
131+
132+
# test
133+
callPackage,
131134
}:
132135

133136
assert (withGTK3 && !withNS && variant != "macport") -> withX || withPgtk;
@@ -524,7 +527,12 @@ mkDerivation (finalAttrs: {
524527
inherit withTreeSitter;
525528
inherit withXwidgets;
526529
pkgs = recurseIntoAttrs (emacsPackagesFor finalAttrs.finalPackage);
527-
tests = { inherit (nixosTests) emacs-daemon; };
530+
tests = {
531+
inherit (nixosTests) emacs-daemon;
532+
withPackages = callPackage ./build-support/wrapper-test.nix {
533+
emacs = finalAttrs.finalPackage;
534+
};
535+
};
528536
};
529537

530538
meta = meta // {

0 commit comments

Comments
 (0)