emacs: use withPgtk option more

- do not require X when withPgtk is true
- make default settings and boolean logic consistent with withPgtk setting
This commit is contained in:
Brian Leung 2022-09-05 03:05:30 -07:00
parent 24b025c615
commit 6d0e82f11a
No known key found for this signature in database
GPG Key ID: 2D86D6A94C8BB3B1

View File

@ -15,10 +15,10 @@
, libgccjit, targetPlatform, makeWrapper # native-comp params
, fetchFromSavannah
, systemd ? null
, withX ? !stdenv.isDarwin
, withX ? !stdenv.isDarwin && !withPgtk
, withNS ? stdenv.isDarwin
, withGTK2 ? false, gtk2-x11 ? null
, withGTK3 ? false, gtk3-x11 ? null, gsettings-desktop-schemas ? null
, withGTK3 ? withPgtk, gtk3-x11 ? null, gsettings-desktop-schemas ? null
, withXwidgets ? false, webkitgtk ? null, wrapGAppsHook ? null, glib-networking ? null
, withMotif ? false, motif ? null
, withSQLite3 ? false
@ -29,7 +29,7 @@
, nativeComp ? true
, withAthena ? false
, withToolkitScrollBars ? true
, withPgtk ? false
, withPgtk ? false, gtk3 ? null
, withXinput2 ? withX && lib.versionAtLeast version "29"
, withImageMagick ? lib.versionOlder version "27" && (withX || withNS)
, toolkit ? (
@ -45,9 +45,10 @@ assert stdenv.isDarwin -> libXaw != null; # fails to link otherwise
assert withNS -> !withX;
assert withNS -> stdenv.isDarwin;
assert (withGTK2 && !withNS) -> withX;
assert (withGTK3 && !withNS) -> withX;
assert withGTK2 -> !withGTK3 && gtk2-x11 != null;
assert withGTK3 -> !withGTK2 && gtk3-x11 != null;
assert (withGTK3 && !withNS) -> withX || withPgtk;
assert withGTK2 -> !withGTK3 && gtk2-x11 != null && !withPgtk;
assert withGTK3 -> !withGTK2 && ((gtk3-x11 != null) || withPgtk);
assert withPgtk -> withGTK3 && !withX && gtk3 != null;
assert withXwidgets -> withGTK3 && webkitgtk != null;
@ -134,7 +135,9 @@ let emacs = stdenv.mkDerivation (lib.optionalAttrs nativeComp {
++ lib.optionals withImageMagick [ imagemagick ]
++ lib.optionals (stdenv.isLinux && withX) [ m17n_lib libotf ]
++ lib.optional (withX && withGTK2) gtk2-x11
++ lib.optionals (withX && withGTK3) [ gtk3-x11 gsettings-desktop-schemas ]
++ lib.optional (withX && withGTK3) gtk3-x11
++ lib.optional withGTK3 gsettings-desktop-schemas
++ lib.optional withPgtk gtk3
++ lib.optional (withX && withMotif) motif
++ lib.optional withSQLite3 sqlite
++ lib.optional withWebP libwebp