public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jerry James <loganjerry@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/python-pydata-sphinx-theme] rawhide: Yet another attempt at unbundling the fonts
Date: Tue, 28 Jul 2026 16:54:26 GMT [thread overview]
Message-ID: <178525766686.1.14060291655915739291.rpms-python-pydata-sphinx-theme-c6c3c33fb973@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/python-pydata-sphinx-theme
Branch : rawhide
Commit : c6c3c33fb97388d1d578f7b340475b9eb48442b5
Author : Jerry James <loganjerry@gmail.com>
Date : 2026-07-28T10:53:47-06:00
Stats : +21/-24 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/python-pydata-sphinx-theme/c/c6c3c33fb97388d1d578f7b340475b9eb48442b5?branch=rawhide
Log:
Yet another attempt at unbundling the fonts
- Thanks to Corentin Noël for this approach
---
diff --git a/python-pydata-sphinx-theme.spec b/python-pydata-sphinx-theme.spec
index eba09e4..8508443 100644
--- a/python-pydata-sphinx-theme.spec
+++ b/python-pydata-sphinx-theme.spec
@@ -26,8 +26,6 @@ Source2: pydata-sphinx-theme-%{version}-vendor-licenses.txt
# docs/_static/gallery.yaml for a list of images to download.
Source3: pydata-gallery.tar.xz
%endif
-# Fedora-only patch: unbundle the fontawesome fonts
-Patch: %{name}-fontawesome.patch
BuildArch: noarch
BuildSystem: pyproject
@@ -35,8 +33,6 @@ BuildOption(install): -L pydata_sphinx_theme
BuildOption(generate_buildrequires): -x test%{?with_docs:,doc}
BuildRequires: babel
-BuildRequires: fontawesome-fonts-all
-BuildRequires: fontawesome-fonts-web
BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: nodejs-devel
@@ -44,8 +40,6 @@ BuildRequires: /usr/bin/node
BuildRequires: /usr/bin/npm
BuildRequires: yarnpkg
-Provides: bundled(npm(bootstrap)) = 5.3.8
-
%if %{without docs}
Obsoletes: %{name}-doc < 0.13.0-1
%endif
@@ -74,7 +68,8 @@ See https://pydata-sphinx-theme.readthedocs.io/ for documentation.}
Summary: Bootstrap-based Sphinx theme from the PyData community
Requires: fontawesome-fonts-all
Requires: fontawesome-fonts-web
-Provides: bundled(js-bootstrap) = 5.3.8
+
+Provides: bundled(npm(bootstrap)) = 5.3.8
%if %{without docs}
Obsoletes: %{name}-doc < 0.13.0-1
@@ -126,23 +121,25 @@ nodeenv --node=system --prebuilt --clean-src $PWD/.nodeenv
sed -i '/\.gitignore/d' %{pyproject_files}
rm %{themedir}/.gitignore
-# More work is required to fully unbundle the fontawesome fonts
-sed -i 's,pydata_sphinx_theme/\.\.,,g' \
- %{themedir}/scripts/fontawesome.js.map
-sed -e 's,pydata_sphinx_theme/\.\./\.\./\.\./\.\./\.\.,,g' \
- -e 's,url(\\"\.\./webfonts/fa-solid-900\.woff2\\"),local("fontawesome-7-free-fonts/Font Awesome 7 Free-Solid-900") format("opentype"),g' \
- -e 's,url(\\"\.\./webfonts/fa-regular-400\.woff2\\"),local("fontawesome-7-free-fonts/Font Awesome 7 Free-Regular-400") format("opentype"),g' \
- -e 's,url(\\"\.\./webfonts/fa-brands-400\.woff2\\"),local("fontawesome-7-brands-fonts/Font Awesome 7 Brands-Regular-400") format("opentype"),g' \
- -e "s,url('#{v\.\$font-path}/fa-solid-900\.woff2')"',local("fontawesome-7-free-fonts/Font Awesome 7 Free-Solid-900") format("opentype"),g' \
- -e "s,url('#{v\.\$font-path}/fa-regular-400\.woff2')"',local("fontawesome-7-free-fonts/Font Awesome 7 Free-Regular-400") format("opentype"),g' \
- -e "s,url('#{v\.\$font-path}/fa-brands-400\.woff2')"',local("fontawesome-7-brands-fonts/Font Awesome 7 Brands-Regular-400") format("opentype"),g' \
- -i %{themedir}/styles/pydata-sphinx-theme.css.map
-sed -e 's,url([.-/[:alnum:]]*fa-solid-900\.woff2),local("fontawesome-7-free-fonts/Font Awesome 7 Free-Solid-900") format("opentype"),g' \
- -e 's,url([.-/[:alnum:]]*fa-regular-400\.woff2),local("fontawesome-7-free-fonts/Font Awesome 7 Free-Regular-400") format("opentype"),g' \
- -e 's,url([.-/[:alnum:]]*fa-brands-400\.woff2),local("fontawesome-7-brands-fonts/Font Awesome 7 Brands-Regular-400") format("opentype"),g' \
- -i %{themedir}/styles/pydata-sphinx-theme.css
-sed -i '/vendor/d' %{pyproject_files}
-rm -fr %{themedir}/vendor
+# Clean up build-host paths leaking into the source maps
+sed -i 's|pydata_sphinx_theme/\.\.||g' %{themedir}/scripts/fontawesome.js.map
+sed -i 's|pydata_sphinx_theme/\.\./\.\./\.\./\.\./\.\.||g' \
+ %{themedir}/styles/pydata-sphinx-theme.css.map
+
+# Unbundle the FontAwesome fonts: webpack already vendors the woff2 files
+# referenced by the (Fedora-patched) SCSS/JS imports into
+# vendor/fontawesome/webfonts/, copying them from the system
+# fontawesome-fonts-web package. Replace those copies with symlinks back to
+# that package instead of shipping duplicate binaries. The CSS/JS keep
+# referencing them with the same relative url()/path, so nothing else needs to
+# change; Sphinx dereferences the symlinks (real files, real bytes) when it
+# copies the static assets into a project's own build output, so the generated
+# documentation stays fully self-contained.
+for font in fa-brands-400.woff2 fa-regular-400.woff2 fa-solid-900.woff2; do
+ rm -f %{themedir}/vendor/fontawesome/webfonts/$font
+ ln -s %{_datadir}/fontawesome/webfonts/$font \
+ %{themedir}/vendor/fontawesome/webfonts/$font
+done
%if %{with docs}
# We need an installed tree before documentation building works properly
reply other threads:[~2026-07-28 16:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178525766686.1.14060291655915739291.rpms-python-pydata-sphinx-theme-c6c3c33fb973@fedoraproject.org \
--to=loganjerry@gmail.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox