diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore index 657a2dd..6c09f82 100644 --- a/.gitignore +++ b/.gitignore @@ -148,3 +148,27 @@ fonttools-2.3.tar.gz /fonttools-4.48.1.tar.gz /fonttools-4.49.0.tar.gz /fonttools-4.50.0.tar.gz +/fonttools-4.51.0.tar.gz +/fonttools-4.52.4.tar.gz +/fonttools-4.53.0.tar.gz +/fonttools-4.53.1.tar.gz +/fonttools-4.54.1.tar.gz +/fonttools-4.55.0.tar.gz +/fonttools-4.55.2.tar.gz +/fonttools-4.55.3.tar.gz +/fonttools-4.55.4.tar.gz +/fonttools-4.55.5.tar.gz +/fonttools-4.55.6.tar.gz +/fonttools-4.56.0.tar.gz +/fonttools-4.57.0.tar.gz +/fonttools-4.58.0.tar.gz +/fonttools-4.58.1.tar.gz +/fonttools-4.58.4.tar.gz +/fonttools-4.58.5.tar.gz +/fonttools-4.59.0.tar.gz +/fonttools-4.59.1.tar.gz +/fonttools-4.59.2.tar.gz +/fonttools-4.60.0.tar.gz +/fonttools-4.60.1.tar.gz +/fonttools-4.61.0.tar.gz +/fonttools-4.61.1.tar.gz diff --git a/fonttools.spec b/fonttools.spec index cec75cf..950301e 100644 --- a/fonttools.spec +++ b/fonttools.spec @@ -1,89 +1,193 @@ -%global pypi_name fonttools -%global desc \ -fontTools is a library for manipulating fonts, written in Python. The project \ -includes the TTX tool, that can convert TrueType and OpenType fonts to and \ -from an XML text format, which is also called TTX. It supports TrueType, \ -OpenType, AFM and to an extent Type 1 and some Mac-specific formats. +%bcond tests 1 + +# Some extras are disabled in RHEL to avoid bringing in additional +# dependencies. +# +# Requires python-lz4: +%bcond graphite_extra %[ %{undefined rhel} || %{defined epel} ] +# Requires python-skia-pathops, not packaged: +%bcond pathops_extra 0 +# Requires python-matplotlib: +%bcond plot_extra %[ %{undefined rhel} || %{defined epel} ] +# Requires python-uharfbuzz, currently only in F42+ +%bcond repacker_extra %[ 0%{?fedora} > 41 ] +# Requires python-sympy (not yet in any EPEL): +%bcond symfont_extra %{undefined rhel} +# Requires python-fs: +%bcond ufo_extra %[ %{undefined rhel} || %{defined epel} ] +# Requires python-unicodedata2 (depending on python version): +%bcond unicode_extra %[ %{undefined rhel} || %{defined epel} ] +# Requires python-brotli, python-zopfli: +%bcond woff_extra %[ %{undefined rhel} || %{defined epel} ] +# Requires scipy, munkres, pycairo +%bcond interpolatable_extra 1 + + +%global desc %{expand: +fontTools is a library for manipulating fonts, written in Python. The project +includes the TTX tool, that can convert TrueType and OpenType fonts to and from +an XML text format, which is also called TTX. It supports TrueType, OpenType, +AFM and to an extent Type 1 and some Mac-specific formats.} Name: fonttools -Version: 4.50.0 +Version: 4.61.1 Release: 1%{?dist} Summary: Tools to manipulate font files # https://spdx.org/licenses/MIT.html License: MIT URL: https://github.com/fonttools/fonttools/ -Source0: https://github.com/%{name}/%{name}/archive/%{version}/%{name}-%{version}.tar.gz#/%{pypi_name}-%{version}.tar.gz +Source: %{url}/archive/%{version}/fonttools-%{version}.tar.gz -Requires: python3-fonttools -Requires: python3-setuptools +Requires: python3-fonttools = %{version}-%{release} Provides: ttx = %{version}-%{release} -%description -%{desc} +BuildRequires: python3-devel +BuildRequires: gcc + +%if %{with tests} +# A few additional requirements for specific tests, noted in requirements.txt: +BuildRequires: %{py3_dist pytest} +# Not included in RHEL, but available in EPEL: +%if %{undefined rhel} || %{defined epel} +BuildRequires: %{py3_dist pytest-randomly} +%endif +# For Tests/cu2qu/{ufo,cli}_test.py +# Not yet in EPEL10: +%if %{undefined rhel} || (%{defined epel} && !%{defined el10}) +BuildRequires: %{py3_dist ufoLib2} +%endif +# Not yet in any EPEL: +%if %{undefined rhel} +BuildRequires: %{py3_dist ufo2ft} +%endif + +# For Tests/pens/freetypePen_test.py +%if %{undefined rhel} || (%{defined epel} && !%{defined el10}) +BuildRequires: %{py3_dist freetype-py} +%global have_freetype_py 1 +%endif + +# For Tests/varLib/interpolatable_test.py +# Not yet in any EPEL: +%if %{undefined rhel} +BuildRequires: %{py3_dist glyphsLib} +%endif +%endif + +%description %{desc} %package -n python3-fonttools Summary: Python 3 fonttools library -%{?python_provide:%python_provide python3-%{name}} -BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: python3-setuptools_scm - -BuildRequires: python3-Cython -BuildRequires: gcc - -Requires: python3-brotli -Requires: python3-lxml -Requires: python3-scipy -Requires: python3-fs - -# test requirements -%bcond_without tests -%if %{with tests} -# Need to run test files in %%check -BuildRequires: python3-pytest -BuildRequires: python3-brotli -BuildRequires: python3-scipy -BuildRequires: python3-fs -BuildRequires: python3-lxml -%if %{undefined rhel} -BuildRequires: python3-ufoLib2 -BuildRequires: python3-zopfli -%endif -%endif # From 3.31.0 and on, python3-fonttools incorporated the ufolib project under fontTools.ufoLib # python-ufolib has been retired and fontTools.ufoLib should be used instead. # See https://github.com/fonttools/fonttools/releases/tag/3.31.0 for further reference Obsoletes: python3-ufolib <= 2.1.1-11 -%description -n python3-fonttools -%{desc} +%description -n python3-fonttools %{desc} -# Cannot package “pathops” extra until python3dist(skia-pathops) is packaged; -# cannot package “all” extra without the “pathops” extra -%{?python_extras_subpkg:%python_extras_subpkg -n python3-fonttools -i %{python3_sitearch}/%{name}-%{version}-py%{python3_version}.egg-info graphite interpolatable lxml plot symfont type1 ufo unicode woff} +# Cannot package “all” extra unless dependencies for all individual extras +# become satisfiable. +%if %{with graphite_extra} +%pyproject_extras_subpkg -n python3-fonttools graphite +%endif +%if %{with interpolatable_extra} +%pyproject_extras_subpkg -n python3-fonttools interpolatable +%endif +%pyproject_extras_subpkg -n python3-fonttools lxml +%if %{with pathops_extra} +%pyproject_extras_subpkg -n python3-fonttools pathops +%endif +%if %{with plot_extra} +%pyproject_extras_subpkg -n python3-fonttools plot +%endif +%if %{with repacker_extra} +%pyproject_extras_subpkg -n python3-fonttools repacker +%endif +%if %{with symfont_extra} +%pyproject_extras_subpkg -n python3-fonttools symfont +%endif +%pyproject_extras_subpkg -n python3-fonttools type1 +%if %{with ufo_extra} +%pyproject_extras_subpkg -n python3-fonttools ufo +%endif +%if %{with unicode_extra} +%pyproject_extras_subpkg -n python3-fonttools unicode +%endif +%if %{with woff_extra} +%pyproject_extras_subpkg -n python3-fonttools woff +%endif %prep %autosetup -p1 -rm -rf *.egg-info -sed -i '1d' Lib/fontTools/mtiLib/__init__.py +# Remove shebang +sed -r -i '1{/^#!/d}' Lib/fontTools/mtiLib/__init__.py -# Remove version limit from lxml -sed -i 's/"lxml >=.*",/"lxml",/' setup.py -sed -i 's/lxml==.*/lxml/' requirements.txt +%generate_buildrequires +export FONTTOOLS_WITH_CYTHON=1 +# We use tox to get things like pytest, but we add extras manually since not +# all dependencies from requirements.txt might be satisfiable and not all +# extras might be packaged; plus, requirements.txt pins exact versions. +%{pyproject_buildrequires \ + %{?with_graphite_extra:-x graphite} \ + %{?with_interpolatable_extra:-x interpolatable} \ + -x lxml \ + %{?with_pathops_extra:-x pathops} \ + %{?with_plot_extra:-x plot} \ + %{?with_repacker_extra:-x repacker} \ + %{?with_symfont_extra:-x symfont} \ + -x type1 \ + %{?with_ufo_extra:-x ufo} \ + %{?with_unicode_extra:-x unicode} \ + %{?with_woff_extra:-x woff} \ + } %build export FONTTOOLS_WITH_CYTHON=1 -%py3_build +%pyproject_wheel %install -%{__python3} setup.py install --skip-build --root %{buildroot} +%pyproject_install +%pyproject_save_files -l fontTools + +%check +# - fontTools.misc.symfont requires python3dist(sympy), i.e., the symfont extra +# - fontTools.pens.freetypePen requires python3dist(freetype-py) +# - fontTools.pens.quartzPen only works on Darwin +# - fontTools.pens.reportLabPen requires python3dist(reportlab), and it is not +# worth adding the BuildRequires just for the import check +# - fontTools.ttLib.removeOverlaps requires python3dist(skia-pathops), i.e., the +# pathops extra +# - fontTools.ufoLib(.*) requires python3dist(fs), i.e., the ufo extra +# - fontTools.varLib.plot requires python3dist(matplotlib), i.e., the plot +# extra +%{pyproject_check_import \ + %{?!with_symfont_extra:-e fontTools.misc.symfont} \ + %{?!have_freetype_pen:-e fontTools.pens.freetypePen} \ + -e fontTools.pens.quartzPen \ + -e fontTools.pens.reportLabPen \ + %{?!with_pathops_extra:-e fontTools.ttLib.removeOverlaps} \ + %{?!with_ufo_extra:-e fontTools.ufoLib*} \ + %{?!with_plot_extra:-e fontTools.varLib.plot} \ + %{?!with_interpolatable_extra:-e fontTools.varLib.interpolatable*} \ + %{nil}} %if %{with tests} -%check -PYTHONPATH=%{buildroot}%{python3_sitearch} %{python3} -m pytest --ignore Tests/otlLib/optimize_test.py --ignore Tests/varLib/merger_test.py --ignore Tests/varLib/varLib_test.py --ignore Tests/svgLib/path/path_test.py +%if %{without ufo_extra} +# These tests pertain to the interpolatable extra, but also require the ufo +# extra (even though the interpolatable extra as a whole does not): +k="${k-}${k+ and }not (InterpolatableTest and test_designspace)" +k="${k-}${k+ and }not (InterpolatableTest and test_interpolatable_ufo)" +k="${k-}${k+ and }not (InterpolatableTest and test_sparse_designspace)" +k="${k-}${k+ and }not (InterpolatableTest and test_sparse_interpolatable_ufos)" +%endif + +# Below test is randomly failing on any arch, mostly the arch on which build runs +k="${k-}${k+ and }not (test_ttcompile_timestamp_calcs)" + +%pytest ${ignore-} -k "${k-}" -rs -v %endif %files @@ -93,13 +197,134 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} %{python3} -m pytest --ignore Tests/o %{_bindir}/fonttools %{_mandir}/man1/ttx.1* -%files -n python3-fonttools -%license LICENSE +%files -n python3-fonttools -f %{pyproject_files} %doc NEWS.rst README.rst -%{python3_sitearch}/fontTools -%{python3_sitearch}/%{name}-%{version}-py%{python3_version}.egg-info %changelog +* Tue Dec 16 2025 Parag Nemade - 4.61.1-1 +- Update to 4.61.1 version (#2421833) + +* Wed Dec 10 2025 Yaakov Selkowitz - 4.61.0-2 +- Conditionalize unicode extra + +* Tue Dec 09 2025 Parag Nemade - 4.61.0-1 +- Update to 4.61.0 version (#2419183) + +* Thu Oct 02 2025 Parag Nemade - 4.60.1-1 +- Update to 4.60.1 version (#2400374) + +* Fri Sep 19 2025 Python Maint - 4.60.0-2 +- Rebuilt for Python 3.14.0rc3 bytecode + +* Wed Sep 17 2025 Parag Nemade - 4.60.0-1 +- Update to 4.60.0 version (#2396057) + +* Thu Aug 28 2025 Parag Nemade - 4.59.2-1 +- Update to 4.59.2 version (#2391330) + +* Fri Aug 15 2025 Python Maint - 4.59.1-2 +- Rebuilt for Python 3.14.0rc2 bytecode + +* Fri Aug 15 2025 Parag Nemade - 4.59.1-1 +- Update to 4.59.1 version (#2388618) + +* Wed Jul 23 2025 Fedora Release Engineering - 4.59.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Fri Jul 18 2025 Parag Nemade - 4.59.0-2 +- Skip failing test test_ttcompile_timestamp_calcs + +* Wed Jul 16 2025 Parag Nemade - 4.59.0-1 +- Update to 4.59.0 version (#2381317) + +* Fri Jul 04 2025 Parag Nemade - 4.58.5-1 +- Update to 4.58.5 version (#2376209) + +* Mon Jun 16 2025 Benjamin A. Beasley - 4.58.4-1 +- Update to 4.58.4 version (#2370864) +- No longer bootstrapping (build with tests enabled) + +* Sun Jun 15 2025 Python Maint - 4.58.1-3 +- Bootstrap for Python 3.14 + +* Tue Jun 03 2025 Python Maint - 4.58.1-2 +- Bootstrap for Python 3.14 + +* Thu May 29 2025 Parag Nemade - 4.58.1-1 +- Update to 4.58.1 version (#2368984) + +* Mon May 12 2025 Parag Nemade - 4.58.0-1 +- Update to 4.58.0 version (#2365442) + +* Fri Apr 04 2025 Parag Nemade - 4.57.0-1 +- Update to 4.57.0 version (#2357231) + +* Sun Mar 16 2025 Benjamin A. Beasley - 4.56.0-2 +- Enable the repacker extra in F42+ + +* Sat Feb 08 2025 Parag Nemade - 4.56.0-1 +- Update to 4.56.0 version (#2342588) + +* Sat Jan 25 2025 Parag Nemade - 4.55.6-1 +- Update to 4.55.6 version (#2341748) + +* Thu Jan 23 2025 Parag Nemade - 4.55.5-1 +- Update to 4.55.5 version (#2341748) + +* Wed Jan 22 2025 Parag Nemade - 4.55.4-1 +- Update to 4.55.4 version (#2339159) + +* Thu Jan 16 2025 Fedora Release Engineering - 4.55.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Sun Jan 12 2025 Romain Geissler - 4.55.3-3 +- Build the graphite subpackage on EPEL 10 now that python-lz4 is available. + +* Wed Dec 18 2024 Romain Geissler - 4.55.3-2 +- Update extra dependencies for EPEL. + +* Sun Dec 15 2024 Parag Nemade - 4.55.3-1 +- Update to 4.55.3 version (#2331592) + +* Sat Dec 07 2024 Parag Nemade - 4.55.2-1 +- Update to 4.55.2 version (#2330109) + +* Fri Nov 15 2024 Parag Nemade - 4.55.0-1 +- Update to 4.55.0 version (#2326307) + +* Tue Nov 05 2024 Yaakov Selkowitz - 4.54.1-3 +- Avoid tox dependency + +* Fri Oct 11 2024 Benjamin A. Beasley - 4.54.1-2 +- Port to pyproject-rpm-macros (modern Python guidelines) + +* Wed Sep 25 2024 Parag Nemade - 4.54.1-1 +- Update to 4.54.1 version (#2314462) + +* Wed Jul 17 2024 Fedora Release Engineering - 4.53.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Mon Jul 08 2024 Parag Nemade - 4.53.1-1 +- Update to 4.53.1 version (#2296086) + +* Thu Jun 27 2024 Parag Nemade - 4.53.0-1 +- Update to 4.53.0 version (#2284160) + +* Mon Jun 17 2024 Python Maint - 4.52.4-3 +- Rebuilt for Python 3.13 + +* Fri Jun 07 2024 Python Maint - 4.52.4-2 +- Bootstrap for Python 3.13 + +* Tue May 28 2024 Parag Nemade - 4.52.4-1 +- Update to 4.52.4 version (#2283255) + +* Tue May 28 2024 Parag Nemade - 4.51.0-2 +- Generate extra subpackages only for Fedora release + +* Wed Apr 10 2024 Parag Nemade - 4.51.0-1 +- Update to 4.51.0 version (#2273774) + * Sat Mar 16 2024 Parag Nemade - 4.50.0-1 - Update to 4.50.0 version (#2269759) diff --git a/plans/fonttools.fmf b/plans/fonttools.fmf new file mode 100644 index 0000000..c1627f9 --- /dev/null +++ b/plans/fonttools.fmf @@ -0,0 +1,5 @@ +summary: Basic smoke test +discover: + how: fmf +execute: + how: tmt diff --git a/sources b/sources index 0c55ddf..0fbd73d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (fonttools-4.50.0.tar.gz) = a169f18077f2c4f0ad8a46569a30b3e35ca2343e9f3d43cd362dafa26085f545dd9a42e7edb3054f9d37e1576117aa34a0c2b4adabc9fc29c076e69d3fdd66ee +SHA512 (fonttools-4.61.1.tar.gz) = 3bdf3b1a72268ca9966550db53a25b8a7e9a1438abef9009d09a76e8d718691fdd248f87521c65df59b07728262a4405aee7a94aa2af616d744f7ee815f29c2d diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 0000000..a72312a --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,22 @@ +test: ./runtests.sh +duration: 10m +framework: beakerlib +require: + - fonttools + - python3-fonttools + - rpm-build + - python3-pytest + - python3-brotli + - python3-scipy + - python3-pluggy + - python3-packaging + - python3-attrs + - python3-pyparsing + - python3-gobject + - python3-fs + - python3-lxml + - python3-ufoLib2 + - python3-zopfli + - atk-devel + - pango-devel + - gtk3-devel diff --git a/tests/runtests.sh b/tests/runtests.sh new file mode 100755 index 0000000..ccb2426 --- /dev/null +++ b/tests/runtests.sh @@ -0,0 +1,37 @@ +#!/bin/bash +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +NAME=fonttools + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm ${NAME} + rlShowPackageVersion ${NAME} + rlRun -t -l "VERSION=$(rpm -q ${NAME} --queryformat='%{version}')" 0 "Get VERSION" + rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory" + rlRun "pushd $tmp" + rlFetchSrcForInstalled "${NAME}" + rlRun "rpm --define '_topdir $tmp' -i *src.rpm" + rlRun -t -l "mkdir BUILD" 0 "Creating BUILD directory" + rlRun -t -l "rpmbuild --noclean --nodeps --define '_topdir $tmp' -bp $tmp/SPECS/*spec" + if [ -d BUILD/${NAME}-${VERSION}-build ]; then + rlRun -t -l "pushd BUILD/${NAME}-${VERSION}-build/${NAME}-${VERSION}" + else + rlRun -t -l "pushd BUILD/${NAME}-${VERSION}" + fi + rlPhaseEnd + + rlPhaseStartTest + rlRun "set -o pipefail" + rlRun "python3 -m pytest --ignore Tests/otlLib/optimize_test.py --ignore Tests/varLib/merger_test.py --ignore Tests/varLib/varLib_test.py --ignore Tests/svgLib/path/path_test.py" + rlRun "retval=$?" + rlRun "echo $retval" + rlRun "popd" 0 + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $tmp" 0 "Remove tmp directory" + rlPhaseEnd +rlJournalEnd + diff --git a/tests/smoke/runtest.sh b/tests/smoke/runtest.sh deleted file mode 100644 index 40b7b96..0000000 --- a/tests/smoke/runtest.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -cd ../source -python3 -m pytest --ignore Tests/otlLib/optimize_test.py --ignore Tests/varLib/merger_test.py --ignore Tests/varLib/varLib_test.py diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 82cae4c..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -- hosts: localhost - tags: - - classic - roles: - - role: standard-test-source - -- hosts: localhost - tags: - - classic - roles: - - role: standard-test-basic - tests: - - smoke - required_packages: - - python3-pytest - - python3-brotli - - python3-scipy - - python3-pluggy - - python3-packaging - - python3-attrs - - python3-pyparsing - - python3-gobject - - python3-fs - - python3-lxml - - atk-devel - - pango-devel - - gtk3-devel