nixpkgs/pkgs/development/libraries/fcft/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.7 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchFromGitea, pkg-config, meson, ninja, scdoc
, freetype, fontconfig, pixman, tllist, check
# 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-07-06 03:07:05 +00:00
let
# Needs to be reflect upstream meson_options.txt
availableShapingTypes = [
"grapheme"
"run"
];
in
2020-07-06 03:07:05 +00:00
stdenv.mkDerivation rec {
pname = "fcft";
version = "3.1.5";
2020-07-06 03:07:05 +00:00
src = fetchFromGitea {
domain = "codeberg.org";
owner = "dnkl";
repo = "fcft";
rev = version;
sha256 = "sha256-3gsaXnflGiGOpIkqDQe5u6x8d18x67/dc4Hh1iU89+o=";
2020-07-06 03:07:05 +00:00
};
2021-07-07 21:12:54 +00:00
depsBuildBuild = [ pkg-config ];
nativeBuildInputs = [ pkg-config meson ninja scdoc ];
buildInputs = [ freetype fontconfig pixman tllist ]
++ lib.optionals (withShapingTypes != []) [ harfbuzz ]
++ lib.optionals (builtins.elem "run" withShapingTypes) [ utf8proc ];
nativeCheckInputs = [ check ];
mesonBuildType = "release";
mesonFlags = builtins.map (t:
2022-12-07 21:44:39 +00:00
lib.mesonEnable "${t}-shaping" (lib.elem t withShapingTypes)
) availableShapingTypes;
doCheck = true;
2020-07-06 03:07:05 +00:00
outputs = [ "out" "doc" "man" ];
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";
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;
};
}