diff --git a/pkgs/applications/editors/emacs/build-support/wrapper-test.nix b/pkgs/applications/editors/emacs/build-support/wrapper-test.nix new file mode 100644 index 000000000000..f23c8afd8856 --- /dev/null +++ b/pkgs/applications/editors/emacs/build-support/wrapper-test.nix @@ -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 + '' diff --git a/pkgs/applications/editors/emacs/make-emacs.nix b/pkgs/applications/editors/emacs/make-emacs.nix index 4002b222084a..ef8a5d923822 100644 --- a/pkgs/applications/editors/emacs/make-emacs.nix +++ b/pkgs/applications/editors/emacs/make-emacs.nix @@ -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 // {