From 4fc79e674c331edea85bd2209d56cdc7acb28859 Mon Sep 17 00:00:00 2001 From: duli Date: Mon, 20 Jan 2025 17:11:09 +0800 Subject: [PATCH] emacs: make cairo optional I noticed that libxft was missing from the buildInputs of make-emacs.nix. After a brief observation, I found that cairo and xft are mutually exclusive options, so I made cairo optional. When `withCairo = false;` will fallback to xft. --- pkgs/applications/editors/emacs/make-emacs.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/emacs/make-emacs.nix b/pkgs/applications/editors/emacs/make-emacs.nix index 6ac71c07a33dd..775fc03b48926 100644 --- a/pkgs/applications/editors/emacs/make-emacs.nix +++ b/pkgs/applications/editors/emacs/make-emacs.nix @@ -32,6 +32,7 @@ jansson, libXaw, libXcursor, + libXft, libXi, libXpm, libgccjit, @@ -69,6 +70,7 @@ withAcl ? false, withAlsaLib ? false, withAthena ? false, + withCairo ? withX, withCsrc ? true, withDbus ? stdenv.hostPlatform.isLinux, withGTK3 ? withPgtk && !noGui, @@ -333,7 +335,6 @@ mkDerivation (finalAttrs: { ] ++ lib.optionals withX [ Xaw3d - cairo giflib libXaw libXpm @@ -342,6 +343,12 @@ mkDerivation (finalAttrs: { librsvg libtiff ] + ++ lib.optionals withCairo [ + cairo + ] + ++ lib.optionals (withX && !withCairo) [ + libXft + ] ++ lib.optionals withXinput2 [ libXi ] @@ -396,8 +403,8 @@ mkDerivation (finalAttrs: { else if withX then [ (lib.withFeatureAs true "x-toolkit" toolkit) - (lib.withFeature true "cairo") - (lib.withFeature true "xft") + (lib.withFeature withCairo "cairo") + (lib.withFeature (!withCairo) "xft") ] else if withPgtk then [