nixpkgs/pkgs/development/libraries/fcft/default.nix
Christoph Heiss 1200d893f8
fcft: add zlib license to list
fcft bundles nanosvg in-tree and by default builds it into the library.
nanosvg is licensed under the zlib license.

Following the discussion on fnott [0] (which does the exact same), it
was decided that the license meta-attr should reflect this situation by
including the zlib license.

There are other precedents as well, like the NixOS [1] and Debian [2]
package for fuzzel.

Thus, the same should be applied to fcft as well.

[0] https://github.com/NixOS/nixpkgs/pull/225224
[1] https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/fuzzel/default.nix
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=982145#74

Signed-off-by: Christoph Heiss <christoph@c8h4.io>
2023-04-09 13:21:02 +02:00

62 lines
1.8 KiB
Nix

{ 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
}:
let
# Needs to be reflect upstream meson_options.txt
availableShapingTypes = [
"grapheme"
"run"
];
in
stdenv.mkDerivation rec {
pname = "fcft";
version = "3.1.5";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "dnkl";
repo = "fcft";
rev = version;
sha256 = "sha256-3gsaXnflGiGOpIkqDQe5u6x8d18x67/dc4Hh1iU89+o=";
};
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:
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;
};
}