From e7cb19c1a7f5440fd5a10b7d4b454a221496e0a5 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sat, 23 Oct 2021 15:57:11 -0300 Subject: [PATCH] fntsample: init at 5.4 --- pkgs/tools/misc/fntsample/default.nix | 80 +++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 82 insertions(+) create mode 100644 pkgs/tools/misc/fntsample/default.nix diff --git a/pkgs/tools/misc/fntsample/default.nix b/pkgs/tools/misc/fntsample/default.nix new file mode 100644 index 000000000000..4f67d564e452 --- /dev/null +++ b/pkgs/tools/misc/fntsample/default.nix @@ -0,0 +1,80 @@ +{ lib +, stdenv +, fetchurl +, fetchFromGitHub +, cmake +, pkg-config +, cairo +, fontconfig +, freetype +, glib +, libXdmcp +, makeWrapper +, pango +, pcre +, perlPackages +}: + +let + ucd-blocks = fetchurl { + url = "https://www.unicode.org/Public/14.0.0/ucd/Blocks.txt"; + hash = "sha256-WYhw3d73s0talykWUoxFav8nZbec1Plkf7WM63Z+fxc="; + }; +in +stdenv.mkDerivation rec { + pname = "fntsample"; + version = "5.4"; + + src = fetchFromGitHub { + owner = "eugmes"; + repo = pname; + rev = "release/${version}"; + hash = "sha256-O5RT68wPWwzCb51JZWWNcIubWoM7NZw/MRiaHXPDmF0="; + }; + + cmakeFlags = [ + "-DUNICODE_BLOCKS=${ucd-blocks.outPath}" + ]; + + outputs = [ "out" "man" ]; + + nativeBuildInputs = [ + cmake + makeWrapper + pkg-config + ]; + + buildInputs = [ + cairo + fontconfig + freetype + glib + libXdmcp + pango + perlPackages.perl + pcre + ]; + + postFixup = + let + perlPath = with perlPackages; makePerlPath [ + ExporterTiny + ListMoreUtils + PDFAPI2 + libintl_perl + ]; + in '' + for cmd in pdfoutline pdf-extract-outline; do + wrapProgram "$out/bin/$cmd" --prefix PERL5LIB : "${perlPath}" + done + ''; + + meta = with lib; { + homepage = "https://github.com/eugmes/fntsample"; + description = "PDF and PostScript font samples generator"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ ]; + platforms = platforms.unix; + }; +} +# TODO: factor/package ucd-blocks diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cdc5641010d7..9987f72119ec 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -432,6 +432,8 @@ with pkgs; etBook = callPackage ../data/fonts/et-book { }; + fntsample = callPackage ../tools/misc/fntsample { }; + fetchutils = callPackage ../tools/misc/fetchutils { }; fet-sh = callPackage ../tools/misc/fet-sh { };