fcft: refactor derivation

* Change from fetchzip to fetchFromGitea.
* Set `mesonBuildType` instead of supplying the --build-type=
  argument in `mesonFlags` as the build type option will be
  repeated.
* Abstact optional flag declaration with a helper function.
* Add upstream changelog.
This commit is contained in:
polykernel 2021-08-08 11:12:06 -04:00
parent c10ded1bb2
commit ceea8b2b35

View file

@ -1,15 +1,23 @@
{ stdenv, lib, fetchzip, pkg-config, meson, ninja, scdoc { stdenv, lib, fetchFromGitea, pkg-config, meson, ninja, scdoc
, freetype, fontconfig, pixman, tllist, check , freetype, fontconfig, pixman, tllist, check
, withHarfBuzz ? true , withHarfBuzz ? true
, harfbuzz , harfbuzz
}: }:
let
# Courtesy of sternenseemann and FRidh, commit c9a7fdfcfb420be8e0179214d0d91a34f5974c54
mesonFeatureFlag = opt: b: "-D${opt}=${if b then "enabled" else "disabled"}";
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "fcft"; pname = "fcft";
version = "2.4.4"; version = "2.4.4";
src = fetchzip { src = fetchFromGitea {
url = "https://codeberg.org/dnkl/fcft/archive/${version}.tar.gz"; domain = "codeberg.org";
owner = "dnkl";
repo = "fcft";
rev = version;
sha256 = "0ycc2xy9jhxcxwbfk9d4jdxgf2zsc664phbf859kshb822m3jf57"; sha256 = "0ycc2xy9jhxcxwbfk9d4jdxgf2zsc664phbf859kshb822m3jf57";
}; };
@ -19,15 +27,16 @@ stdenv.mkDerivation rec {
++ lib.optional withHarfBuzz harfbuzz; ++ lib.optional withHarfBuzz harfbuzz;
checkInputs = [ check ]; checkInputs = [ check ];
mesonBuildType = "release";
mesonFlags = [ mesonFlags = [
"--buildtype=release" (mesonFeatureFlag "text-shaping" withHarfBuzz)
"-Dtext-shaping=${if withHarfBuzz then "enabled" else "disabled"}"
]; ];
doCheck = true; doCheck = true;
meta = with lib; { meta = with lib; {
homepage = "https://codeberg.org/dnkl/fcft"; homepage = "https://codeberg.org/dnkl/fcft";
changelog = "https://codeberg.org/dnkl/fcft/releases/tag/${version}";
description = "Simple library for font loading and glyph rasterization"; description = "Simple library for font loading and glyph rasterization";
maintainers = with maintainers; [ maintainers = with maintainers; [
fionera fionera