nixpkgs/pkgs/by-name/fc/fcft/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

65 lines
1.8 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;
};
}