2021-08-08 15:12:06 +00:00
|
|
|
{ stdenv, lib, fetchFromGitea, pkg-config, meson, ninja, scdoc
|
2020-12-18 13:47:35 +00:00
|
|
|
, freetype, fontconfig, pixman, tllist, check
|
2021-11-13 12:51:56 +00:00
|
|
|
# Text shaping methods to enable, empty list disables all text shaping.
|
|
|
|
# See `availableShapingTypes` or upstream meson_options.txt for available types.
|
|
|
|
, withShapingTypes ? [ "grapheme" "run" ]
|
|
|
|
, harfbuzz, utf8proc
|
|
|
|
, fcft # for passthru.tests
|
2020-12-18 13:47:35 +00:00
|
|
|
}:
|
2020-07-06 03:07:05 +00:00
|
|
|
|
2021-08-08 15:12:06 +00:00
|
|
|
let
|
2021-11-13 12:51:56 +00:00
|
|
|
# Needs to be reflect upstream meson_options.txt
|
|
|
|
availableShapingTypes = [
|
|
|
|
"grapheme"
|
|
|
|
"run"
|
|
|
|
];
|
2021-08-08 15:12:06 +00:00
|
|
|
in
|
|
|
|
|
2020-07-06 03:07:05 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "fcft";
|
2022-09-24 08:09:50 +00:00
|
|
|
version = "3.1.5";
|
2020-07-06 03:07:05 +00:00
|
|
|
|
2021-08-08 15:12:06 +00:00
|
|
|
src = fetchFromGitea {
|
|
|
|
domain = "codeberg.org";
|
|
|
|
owner = "dnkl";
|
|
|
|
repo = "fcft";
|
|
|
|
rev = version;
|
2022-09-24 08:09:50 +00:00
|
|
|
sha256 = "sha256-3gsaXnflGiGOpIkqDQe5u6x8d18x67/dc4Hh1iU89+o=";
|
2020-07-06 03:07:05 +00:00
|
|
|
};
|
|
|
|
|
2021-07-07 21:12:54 +00:00
|
|
|
depsBuildBuild = [ pkg-config ];
|
2020-08-14 23:31:43 +00:00
|
|
|
nativeBuildInputs = [ pkg-config meson ninja scdoc ];
|
2020-12-18 13:47:35 +00:00
|
|
|
buildInputs = [ freetype fontconfig pixman tllist ]
|
2021-11-13 12:51:56 +00:00
|
|
|
++ lib.optionals (withShapingTypes != []) [ harfbuzz ]
|
|
|
|
++ lib.optionals (builtins.elem "run" withShapingTypes) [ utf8proc ];
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [ check ];
|
2020-08-17 12:49:42 +00:00
|
|
|
|
2021-08-08 15:12:06 +00:00
|
|
|
mesonBuildType = "release";
|
2021-11-13 12:51:56 +00:00
|
|
|
mesonFlags = builtins.map (t:
|
2022-12-07 21:44:39 +00:00
|
|
|
lib.mesonEnable "${t}-shaping" (lib.elem t withShapingTypes)
|
2021-11-13 12:51:56 +00:00
|
|
|
) availableShapingTypes;
|
2020-08-17 12:49:42 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
2020-07-06 03:07:05 +00:00
|
|
|
|
2021-12-13 12:43:44 +00:00
|
|
|
outputs = [ "out" "doc" "man" ];
|
|
|
|
|
2021-11-13 12:51:56 +00:00
|
|
|
passthru.tests = {
|
|
|
|
noShaping = fcft.override { withShapingTypes = []; };
|
|
|
|
onlyGraphemeShaping = fcft.override { withShapingTypes = [ "grapheme" ]; };
|
|
|
|
};
|
|
|
|
|
2020-07-06 03:07:05 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://codeberg.org/dnkl/fcft";
|
2021-08-08 15:12:06 +00:00
|
|
|
changelog = "https://codeberg.org/dnkl/fcft/releases/tag/${version}";
|
2020-07-06 03:07:05 +00:00
|
|
|
description = "Simple library for font loading and glyph rasterization";
|
2021-04-14 15:02:45 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
fionera
|
|
|
|
sternenseemann
|
|
|
|
];
|
2020-07-06 03:07:05 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = with platforms; linux;
|
|
|
|
};
|
|
|
|
}
|