emacs: rework imagemagick detection

We do not have Emacs 27 anymore.

We set this as false by default because it is the previous behaviour for Emacs >
27. Further, the test `(withX || withNS)` is migrated to an assertion.
This commit is contained in:
Anderson Torres
2025-05-19 07:30:16 +08:00
committed by Lin Jian
parent 2448ffdd55
commit 951fb7ac54
@@ -82,7 +82,8 @@
withGTK3 ? withPgtk && !noGui,
withGlibNetworking ? withPgtk || withGTK3 || (withX && withXwidgets),
withGpm ? stdenv.hostPlatform.isLinux,
withImageMagick ? lib.versionOlder version "27" && (withX || withNS),
# https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS.27#L140-L142
withImageMagick ? false,
# Emacs 30+ has native JSON support
withJansson ? lib.versionOlder version "30",
withMailutils ? true,
@@ -128,6 +129,7 @@ assert noGui -> !(withX || withGTK3 || withNS || variant == "macport");
assert withAcl -> stdenv.hostPlatform.isLinux;
assert withAlsaLib -> stdenv.hostPlatform.isLinux;
assert withGpm -> stdenv.hostPlatform.isLinux;
assert withImageMagick -> (withX || withNS);
assert withNS -> stdenv.hostPlatform.isDarwin && !(withX || variant == "macport");
assert withPgtk -> withGTK3 && !withX;
assert withXwidgets -> !noGui && (withGTK3 || withPgtk);