From 8a74399de3c1f78061ba08ddab1606b0a91fc689 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sat, 6 Jun 2020 00:03:38 +0000 Subject: [PATCH] fontforge: introduce withGUI option It was unintuitive that the withGTK option controlled whether a fontforge GUI was enabled at all, since fontforge supports multiple GUIs (a GTK one and an X11 one -- confusingly the X11 one still requires GTK). With the new withGUI option, it is possible to build the X11 GUI by setting withGTK to false and withGUI to true. I haven't added an attribute for this configuration because I expect it to be pretty obsure -- my rationale for adding this option was code clarity rather than utility. --- pkgs/tools/misc/fontforge/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/fontforge/default.nix b/pkgs/tools/misc/fontforge/default.nix index ed5c242e62418..82fd5c8210dd3 100644 --- a/pkgs/tools/misc/fontforge/default.nix +++ b/pkgs/tools/misc/fontforge/default.nix @@ -4,11 +4,14 @@ , readline, woff2, zeromq, libuninameslist , withSpiro ? false, libspiro , withGTK ? false, gtk3 +, withGUI ? withGTK , withPython ? true , withExtras ? true , Carbon ? null, Cocoa ? null }: +assert withGTK -> withGUI; + stdenv.mkDerivation rec { pname = "fontforge"; version = "20200314"; @@ -36,12 +39,13 @@ stdenv.mkDerivation rec { python freetype zlib glib libungif libpng libjpeg libtiff libxml2 ] ++ lib.optionals withSpiro [libspiro] - ++ lib.optionals withGTK [ gtk3 cairo pango ] + ++ lib.optionals withGUI [ gtk3 cairo pango ] ++ lib.optionals stdenv.isDarwin [ Carbon Cocoa ]; cmakeFlags = [ "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON" ] ++ lib.optional (!withSpiro) "-DENABLE_LIBSPIRO=OFF" - ++ lib.optional (!withGTK) "-DENABLE_GUI=OFF" + ++ lib.optional (!withGUI) "-DENABLE_GUI=OFF" + ++ lib.optional (!withGTK) "-DENABLE_X11=ON" ++ lib.optional withExtras "-DENABLE_FONTFORGE_EXTRAS=ON"; # work-around: git isn't really used, but configuration fails without it