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.
This commit is contained in:
Alyssa Ross 2020-06-06 00:03:38 +00:00
parent e9848d11ad
commit 8a74399de3
No known key found for this signature in database
GPG Key ID: F9DBED4859B271C0

View File

@ -4,11 +4,14 @@
, readline, woff2, zeromq, libuninameslist , readline, woff2, zeromq, libuninameslist
, withSpiro ? false, libspiro , withSpiro ? false, libspiro
, withGTK ? false, gtk3 , withGTK ? false, gtk3
, withGUI ? withGTK
, withPython ? true , withPython ? true
, withExtras ? true , withExtras ? true
, Carbon ? null, Cocoa ? null , Carbon ? null, Cocoa ? null
}: }:
assert withGTK -> withGUI;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "fontforge"; pname = "fontforge";
version = "20200314"; version = "20200314";
@ -36,12 +39,13 @@ stdenv.mkDerivation rec {
python freetype zlib glib libungif libpng libjpeg libtiff libxml2 python freetype zlib glib libungif libpng libjpeg libtiff libxml2
] ]
++ lib.optionals withSpiro [libspiro] ++ lib.optionals withSpiro [libspiro]
++ lib.optionals withGTK [ gtk3 cairo pango ] ++ lib.optionals withGUI [ gtk3 cairo pango ]
++ lib.optionals stdenv.isDarwin [ Carbon Cocoa ]; ++ lib.optionals stdenv.isDarwin [ Carbon Cocoa ];
cmakeFlags = [ "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON" ] cmakeFlags = [ "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON" ]
++ lib.optional (!withSpiro) "-DENABLE_LIBSPIRO=OFF" ++ 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"; ++ lib.optional withExtras "-DENABLE_FONTFORGE_EXTRAS=ON";
# work-around: git isn't really used, but configuration fails without it # work-around: git isn't really used, but configuration fails without it