nixpkgs/pkgs/by-name/fc/fcft/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

103 lines
2.0 KiB
Nix

{
stdenv,
lib,
fetchFromGitea,
fetchpatch,
pkg-config,
meson,
ninja,
scdoc,
freetype,
fontconfig,
nanosvg,
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
}:
let
# Needs to be reflect upstream meson_options.txt
availableShapingTypes = [
"grapheme"
"run"
];
in
stdenv.mkDerivation rec {
pname = "fcft";
version = "3.1.9";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "dnkl";
repo = "fcft";
rev = version;
hash = "sha256-D4W62IHuM7ofEeU/3sp038tv2a1+xQd0mdSKXaY7Ikg=";
};
depsBuildBuild = [ pkg-config ];
nativeBuildInputs = [
pkg-config
meson
ninja
scdoc
];
buildInputs =
[
freetype
fontconfig
nanosvg
pixman
tllist
]
++ lib.optionals (withShapingTypes != [ ]) [ harfbuzz ]
++ lib.optionals (builtins.elem "run" withShapingTypes) [ utf8proc ];
nativeCheckInputs = [ check ];
mesonBuildType = "release";
mesonFlags =
[
(lib.mesonEnable "system-nanosvg" true)
]
++ builtins.map (
t: lib.mesonEnable "${t}-shaping" (lib.elem t withShapingTypes)
) availableShapingTypes;
doCheck = true;
outputs = [
"out"
"doc"
"man"
];
passthru.tests = {
noShaping = fcft.override { withShapingTypes = [ ]; };
onlyGraphemeShaping = fcft.override { withShapingTypes = [ "grapheme" ]; };
};
meta = with lib; {
homepage = "https://codeberg.org/dnkl/fcft";
changelog = "https://codeberg.org/dnkl/fcft/releases/tag/${version}";
description = "Simple library for font loading and glyph rasterization";
maintainers = with maintainers; [
fionera
sternenseemann
];
license = with licenses; [
mit
zlib
];
platforms = with platforms; linux;
};
}