anchor.diff:      # pens
       reportlab
       sphinx
  +  ] ++ lib.optionals (pythonOlder "3.9") [
  +    # unicode extra
  +    unicodedata2
     ];
   
     preCheck = ''
  -    export LC_ALL="en_US.UTF-8"
  +    # tests want to execute the "fonttools" executable from $PATH
  +    export PATH="$out/bin:$PATH"
     '';
   
  -  # avoid timing issues with timestamps in subset_test.py and ttx_test.py
  -  checkPhase = ''
  -    pytest Tests fontTools \
  -      -k 'not ttcompile_timestamp_calcs and not recalc_timestamp'
  -  '';
  +  # Timestamp tests have timing issues probably related
  +  # to our file timestamp normalization
  +  disabledTests = [
  +    "test_recalc_timestamp_ttf"
  +    "test_recalc_timestamp_otf"
  +    "test_ttcompile_timestamp_calcs"
  +  ];
   
     meta = with lib; {
       homepage = "https://github.com/fonttools/fonttools";
  
positive.code: , matplotlib
  , reportlab
  , sphinx
  , pytest
  , pytest-randomly
  , glibcLocales
  }:
  
  buildPythonPackage rec {
    pname = "fonttools";
    version = "4.21.1";
    disabled = pythonOlder "3.6";
  
    src = fetchFromGitHub {
      owner  = pname;
      repo   = pname;
      rev    = version;
      sha256 = "1x9qrg6ppqhm5214ymwvn0r34qdz8pqvyxd0sj7rkp06wa757z2i";
    };
  
    # all dependencies are optional, but
    # we run the checks with them
    checkInputs = [
      pytest
      pytest-randomly
      glibcLocales
      # etree extra
      lxml
      # ufo extra
  
negative.code:     # woff extra
      brotlipy
      zopfli
      # interpolatable extra
      scipy
      munkres
  