-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
68 lines (58 loc) · 2.11 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
description = "Fork of ttfautohint with Derani support";
inputs = {
flake-utils.url = github:numtide/flake-utils;
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in {
defaultPackage = pkgs.stdenv.mkDerivation rec {
name = "ttfautohint";
version = "1.8.4";
src = self;
preAutoreconf = let
printVersion = pkgs.writeShellScript "print-version" ''
echo -n ${pkgs.lib.escapeShellArg version}
'';
in ''
./bootstrap --gnulib-srcdir=${pkgs.gnulib} --no-git --bootstrap-sync --skip-po
cp ${printVersion} gnulib/git-version-gen
'';
postAutoreconf = ''
substituteInPlace configure --replace "macx-g++" "macx-clang"
'';
nativeBuildInputs = [
pkgs.pkg-config
pkgs.autoreconfHook
pkgs.flex
pkgs.freetype
pkgs.harfbuzz
pkgs.libiconv
pkgs.bison
pkgs.perl
];
configureFlags = [ "--with-qt=no" "--with-doc=no" ];
# workaround https://github.com/NixOS/nixpkgs/issues/155458
preBuild = pkgs.lib.optionalString pkgs.stdenv.cc.isClang ''
rm version
'';
enableParallelBuilding = true;
meta = {
description = "Automatic hinter for TrueType fonts";
mainProgram = "ttfautohint";
longDescription = ''
A library and two programs which take a TrueType font as the
input, remove its bytecode instructions (if any), and return a
new font where all glyphs are bytecode hinted using the
information given by FreeType’s auto-hinting module.
'';
homepage = "https://www.freetype.org/ttfautohint";
license = pkgs.lib.licenses.gpl2Plus; # or the FreeType License (BSD + advertising clause)
platforms = pkgs.lib.platforms.unix;
};
};
}
);
}