summary refs log tree commit diff
path: root/pkgs/data/fonts/noto-fonts/tools.nix
blob: d91ace35e2c8fba7c328f9a673055f34d06306c7 (plain) (blame)
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
{ fetchFromGitHub, lib, fetchpatch, buildPythonPackage, isPy3k, fonttools, numpy, pillow, six, bash }:

buildPythonPackage rec {
  pname = "nototools";
  version = "unstable-2019-10-21";

  src = fetchFromGitHub {
    owner = "googlefonts";
    repo = "nototools";
    rev = "cae92ce958bee37748bf0602f5d7d97bb6db98ca";
    sha256 = "1jqr0dz23rjqiyxw1w69l6ry16dwdcf3c6cysiy793g2v7pir2yi";
  };

  propagatedBuildInputs = [ fonttools numpy ];

  patches = lib.optionals isPy3k [
    # Additional Python 3 compat https://github.com/googlefonts/nototools/pull/497
    (fetchpatch {
      url = https://github.com/googlefonts/nototools/commit/ded1f311b3260f015b5c5b80f05f7185392c4eff.patch;
      sha256 = "0bn0rlbddxicw0h1dnl0cibgj6xjalja2qcm563y7kk3z5cdwhgq";
    })
  ];

  postPatch = ''
    sed -ie "s^join(_DATA_DIR_PATH,^join(\"$out/third_party/ucd\",^" nototools/unicode_data.py
  '';

  checkInputs = [
    pillow six bash
  ];

  checkPhase = ''
    patchShebangs tests/
    cd tests
    rm gpos_diff_test.py # needs ttxn?
    ./run_tests
  '';

  postInstall = ''
    cp -r third_party $out
  '';

  meta = {
    description = "Noto fonts support tools and scripts plus web site generation";
    license = lib.licenses.asl20;
    homepage = https://github.com/googlefonts/nototools;
  };
}