emacs: add a test for withPackages wrapper (#389315)

This commit is contained in:
Lin Jian
2025-03-14 17:02:40 +08:00
committed by GitHub
2 changed files with 30 additions and 1 deletions
@@ -0,0 +1,21 @@
{
runCommand,
emacs,
git,
}:
runCommand "test-emacs-withPackages-wrapper"
{
nativeBuildInputs = [
(emacs.pkgs.withPackages (
epkgs: with epkgs; [
magit
]
))
git # needed by magit
];
}
''
emacs --batch --eval="(require 'magit)"
touch $out
''
@@ -128,6 +128,9 @@
QuartzCore,
UniformTypeIdentifiers,
WebKit,
# test
callPackage,
}:
assert (withGTK3 && !withNS && variant != "macport") -> withX || withPgtk;
@@ -524,7 +527,12 @@ mkDerivation (finalAttrs: {
inherit withTreeSitter;
inherit withXwidgets;
pkgs = recurseIntoAttrs (emacsPackagesFor finalAttrs.finalPackage);
tests = { inherit (nixosTests) emacs-daemon; };
tests = {
inherit (nixosTests) emacs-daemon;
withPackages = callPackage ./build-support/wrapper-test.nix {
emacs = finalAttrs.finalPackage;
};
};
};
meta = meta // {