17
0
Files
python-FontTools/python-FontTools.spec
Takashi Iwai c0d87dea84 Accepting request 863150 from home:dirkmueller:branches:M17N
- update to 4.18.2:
  - [COLRv1] Implemented ``PaintTranslate`` paint format (#2129).
  - [varLib.cff] Fixed unbound local variable error (#1787).
  - [otlLib] Don't crash when creating OpenType class definitions if some glyphs
    occur more than once (#2125).
  - [colorLib] Speed optimization for ``LayerV1ListBuilder`` (#2119).
  - [mutator] Fixed missing tab in ``interpolate_cff2_metrics`` (0957dc7a).
  - [COLRv1] Update to latest draft: added ``PaintRotate`` and ``PaintSkew`` (#2118).
  - [woff2] Support new ``brotlicffi`` bindings for PyPy (#2117).
  - [glifLib] Added ``expectContentsFile`` parameter to ``GlyphSet``, for use when
    reading existing UFOs, to comply with the specification stating that a
    ``contents.plist`` file must exist in a glyph set (#2114).
  - [subset] Allow ``LangSys`` tags in ``--layout-scripts`` option (#2112). For example:
    ``--layout-scripts=arab.dflt,arab.URD,latn``; this will keep ``DefaultLangSys``
    and ``URD`` language for ``arab`` script, and all languages for ``latn`` script.
  - [varLib.interpolatable] Allow UFOs to be checked; report open paths, non existant
    glyphs; add a ``--json`` option to produce a machine-readable list of
    incompatibilities
  - [pens] Added ``QuartzPen`` to create ``CGPath`` from glyph outlines on macOS.
    Requires pyobjc (#2107).
  - [feaLib] You can export ``FONTTOOLS_LOOKUP_DEBUGGING=1`` to enable feature file
    debugging info stored in ``Debg`` table (#2106).
  - [otlLib] Build more efficient format 1 and format 2 contextual lookups whenever
    possible (#2101).
  - [colorLib] Fixed regression in 4.17.0 when building COLR v0 table; when color
    layers are stored in UFO lib plist, we can't distinguish tuples from lists so
    we need to accept either types (e5439eb9, googlefonts/ufo2ft/issues#426).
  - [colorLib/otData] Updated to latest draft ``COLR`` v1 spec (#2092).
  - [svgLib] Fixed parsing error when arc commands' boolean flags are not separated
    by space or comma (#2094).

OBS-URL: https://build.opensuse.org/request/show/863150
OBS-URL: https://build.opensuse.org/package/show/M17N/python-FontTools?expand=0&rev=18
2021-01-18 13:26:05 +00:00

140 lines
4.3 KiB
RPMSpec

#
# spec file for package python-FontTools
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%else
%define psuffix %{nil}
%endif
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-FontTools%{psuffix}
Version: 4.18.2
Release: 0
Summary: Suite of Tools and Libraries for Manipulating Fonts
License: MIT AND OFL-1.1
Group: Development/Languages/Python
URL: https://github.com/fonttools/fonttools
Source: https://files.pythonhosted.org/packages/source/f/fonttools/fonttools-%{version}.zip
Source1: https://raw.githubusercontent.com/fonttools/fonttools/master/Tests/cu2qu/data/curves.json
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: unzip
Requires: python-Brotli >= 1.0.1
Requires: python-fs >= 2.4.11
Requires: python-lxml >= 4.0
Requires: python-scipy >= 1.5.1
Requires: python-sympy
Requires: python-unicodedata2 >= 13.0.0
Requires: python-zopfli >= 0.1.6
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends: python-reportlab
BuildArch: noarch
%if "%{flavor}" == "test"
BuildRequires: zip
# SECTION test requirements
BuildRequires: %{python_module Brotli >= 1.0.1}
BuildRequires: %{python_module fs >= 2.4.11}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module scipy >= 1.5.1}
BuildRequires: %{python_module sympy}
BuildRequires: %{python_module ufoLib2 >= 0.6.2}
BuildRequires: %{python_module zopfli >= 0.1.6}
%endif
# /SECTION
%ifpython3
Obsoletes: fonttools < %{version}
Provides: fonttools = %{version}
Provides: python-fonttools = %{version}
%endif
%python_subpackages
%description
FontTools is a suite of tools and libraries for manipulating fonts
written in Python.
It currently reads and writes TrueType font files, reads PostScript
Type 1 fonts, and more. It contains two command line programs to
convert TrueType fonts to an XML based format (called TTX) and back.
%prep
%setup -q -n fonttools-%{version}
# Remove shebang
sed -i -e '/^#!\//, 1d' Lib/fontTools/mtiLib/__init__.py
cp %{SOURCE1} Tests/cu2qu/data/curves.json
%build
%python_build
%install
%if "%{flavor}" != "test"
%python_install
%python_clone -a %{buildroot}%{_mandir}/man1/ttx.1
%python_clone -a %{buildroot}%{_bindir}/ttx
%python_clone -a %{buildroot}%{_bindir}/pyftsubset
%python_clone -a %{buildroot}%{_bindir}/pyftmerge
%python_expand %fdupes %{buildroot}%{$python_sitelib}
# remove undocumented and non working script
rm %{buildroot}%{_bindir}/fonttools
%endif
%if "%{flavor}" == "test"
%check
ufodir='Tests/ufoLib/testdata/TestFont1 (UFO3).ufo'
if [ ! -e "${ufodir}z" ]; then
# they forgot to ship Tests/ufoLib/testdata/TestFont1 (UFO3).ufoz
pushd $(dirname "$ufodir")
name=$(basename "$ufodir")
zip -r "${name}z" "$name"
popd
else
echo "this can be removed (including zip buildrequires)"
exit 1
fi
export LANG=en_US.UTF-8
export PYTHONDONTWRITEBYTECODE=1
%pytest
%else
%post
%python_install_alternative ttx ttx.1
%python_install_alternative pyftsubset
%python_install_alternative pyftmerge
%postun
%python_uninstall_alternative ttx
%python_uninstall_alternative pyftsubset
%python_uninstall_alternative pyftmerge
%files %{python_files}
%license LICENSE LICENSE.external
%doc README.rst NEWS.rst
%{python_sitelib}/*
%python_alternative %{_bindir}/pyftmerge
%python_alternative %{_bindir}/pyftsubset
%python_alternative %{_bindir}/ttx
%python_alternative %{_mandir}/man1/ttx.1%{?ext_man}
%endif
%changelog