1 { stdenv, lib, fetchFromGitea, fetchpatch, pkg-config, meson, ninja, scdoc
2 , freetype, fontconfig, nanosvg, pixman, tllist, check
3 # Text shaping methods to enable, empty list disables all text shaping.
4 # See `availableShapingTypes` or upstream meson_options.txt for available types.
5 , withShapingTypes ? [ "grapheme" "run" ]
7 , fcft # for passthru.tests
11 # Needs to be reflect upstream meson_options.txt
12 availableShapingTypes = [
18 stdenv.mkDerivation rec {
22 src = fetchFromGitea {
23 domain = "codeberg.org";
27 hash = "sha256-D4W62IHuM7ofEeU/3sp038tv2a1+xQd0mdSKXaY7Ikg=";
30 depsBuildBuild = [ pkg-config ];
31 nativeBuildInputs = [ pkg-config meson ninja scdoc ];
32 buildInputs = [ freetype fontconfig nanosvg pixman tllist ]
33 ++ lib.optionals (withShapingTypes != []) [ harfbuzz ]
34 ++ lib.optionals (builtins.elem "run" withShapingTypes) [ utf8proc ];
35 nativeCheckInputs = [ check ];
37 mesonBuildType = "release";
39 (lib.mesonEnable "system-nanosvg" true)
41 lib.mesonEnable "${t}-shaping" (lib.elem t withShapingTypes)
42 ) availableShapingTypes;
46 outputs = [ "out" "doc" "man" ];
49 noShaping = fcft.override { withShapingTypes = []; };
50 onlyGraphemeShaping = fcft.override { withShapingTypes = [ "grapheme" ]; };
54 homepage = "https://codeberg.org/dnkl/fcft";
55 changelog = "https://codeberg.org/dnkl/fcft/releases/tag/${version}";
56 description = "Simple library for font loading and glyph rasterization";
57 maintainers = with maintainers; [
61 license = with licenses; [ mit zlib ];
62 platforms = with platforms; linux;