Compare commits

...
Sign in to create a new pull request.

6 commits

Author SHA1 Message Date
Jerry James
6d8ab9e534 Version 0.21.0 2026-08-25 19:28:13 -06:00
Jerry James
21b12885c3 Remove the yarnpkg dependency 2026-08-25 19:28:05 -06:00
Jerry James
3bfdee9970 Yet another attempt at unbundling the fonts
- Thanks to Corentin Noël for this approach
2026-07-28 11:33:00 -06:00
Jerry James
2fe9a38ce0 Correct paths to FontAwesome fonts 2026-07-14 17:10:11 -06:00
Jerry James
38a5e0c997 Version 0.20.0
- Work harder to unbundle the FontAwesome fonts
2026-07-10 14:57:18 -06:00
Jerry James
282f52a259 Version 0.19.0 2026-06-15 12:08:40 -06:00
4 changed files with 34 additions and 35 deletions

View file

@ -18,7 +18,6 @@ echo "PATH: $PKG_PATH"
cleanup_tmpdir() {
popd 2>/dev/null
rm -rf $PKG_TMPDIR
rm -rf /tmp/yarn--*
}
trap cleanup_tmpdir SIGINT
@ -41,25 +40,26 @@ tar -xf $PKG_TARBALL -C $PKG_TMPDIR
cd $PKG_PATH
export YARN_CACHE_FOLDER="$PWD/.package-cache"
echo ">>>>>> Install npm modules"
yarn install --frozen-lockfile
export npm_config_cache="$PWD/.package-cache"
rm package-lock.json
npm install
if [ $? -ne 0 ]; then
echo "ERROR: yarn install failed"
echo "ERROR: npm install failed"
cleanup_and_exit 1
fi
echo ">>>>>> Package vendor files"
rm -f $PKG_DIR/${PKG_NAME}-${PKG_VERSION}-vendor.tar.xz
XZ_OPT="-9e -T$(nproc)" tar cJf $PKG_DIR/${PKG_NAME}-${PKG_VERSION}-vendor.tar.xz .package-cache
XZ_OPT="-9e -T$(nproc)" tar cJf $PKG_DIR/${PKG_NAME}-${PKG_VERSION}-vendor.tar.xz .package-cache node_modules
if [ $? -ne 0 ]; then
cleanup_and_exit 1
fi
yarn add license-checker
yarn license-checker --summary | sed "s#$PKG_PATH#/tmp/#g" > $PKG_DIR/${PKG_NAME}-${PKG_VERSION}-vendor-licenses.txt
npm add license-checker
node_modules/.bin/license-checker --summary | sed "s#$PKG_PATH#/tmp/#g" > $PKG_DIR/${PKG_NAME}-${PKG_VERSION}-vendor-licenses.txt
cd -
rm -rf .package-cache node_modules
rm -rf .package-cache node_modules /tmp/node-compile-cache
cleanup_and_exit 0

View file

@ -1,11 +1,9 @@
yarn run v1.22.22
$ /tmp/node_modules/.bin/license-checker --summary
├─ MIT: 346
├─ MIT: 345
├─ ISC: 38
├─ BSD-2-Clause: 19
├─ BSD-3-Clause: 8
├─ Apache-2.0: 7
├─ CC0-1.0: 4
├─ CC0-1.0: 3
├─ MIT-0: 2
├─ (CC-BY-4.0 AND OFL-1.1 AND MIT): 1
├─ Python-2.0: 1
@ -17,4 +15,3 @@ $ /tmp/node_modules/.bin/license-checker --summary
├─ (MIT AND CC-BY-3.0): 1
└─ 0BSD: 1
Done in 0.68s.

View file

@ -6,7 +6,7 @@
%global giturl https://github.com/pydata/pydata-sphinx-theme
Name: python-pydata-sphinx-theme
Version: 0.18.0
Version: 0.21.0
Release: %autorelease
Summary: Bootstrap-based Sphinx theme from the PyData community
@ -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,16 +33,11 @@ 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
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
@ -74,7 +67,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
@ -116,8 +110,7 @@ sed -i 's,^\(node-version = \)".*",\1"%{nodejs_version}",' pyproject.toml
sed -i 's/\(sphinx\)\[test\]/\1/' pyproject.toml
%build -p
export YARN_CACHE_FOLDER="$PWD/.package-cache"
yarn install --offline
export npm_config_cache="$PWD/.package-cache"
nodeenv --node=system --prebuilt --clean-src $PWD/.nodeenv
%install -a
@ -126,16 +119,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 \
# 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
sed -e 's,url.*fa-solid-900\.woff2.*format("truetype"),local("fontawesome-free-fonts/Font Awesome 6 Free-Solid-900") format("opentype"),g' \
-e 's,url.*fa-regular-400\.woff2.*format("truetype"),local("fontawesome-free-fonts/Font Awesome 6 Free-Regular-400") format("opentype"),g' \
-e 's,url.*fa-brands-400\.woff2.*format("truetype"),local("fontawesome-brands-fonts/Font Awesome 6 Brands-Regular-400") format("opentype"),g' \
-i %{themedir}/styles/pydata-sphinx-theme.css
sed -i '/vendor/d' %{pyproject_files}
rm -fr %{themedir}/vendor
# 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

View file

@ -1,2 +1,2 @@
SHA512 (pydata-sphinx-theme-0.18.0.tar.gz) = ecd6d9e138007ca7c42807d3fad9d275abc1531f3360beeae18d8b960825a2704de1c136c6bc49e74f82a7bf29094fcee5c43da551d6b99831b4f8e82156dcfd
SHA512 (pydata-sphinx-theme-0.18.0-vendor.tar.xz) = 925d7589105d314176ae051e8342b2d65b63d1a941cde3a83700118d5823843e9a0c15fbc55da1dc2f0db5f9c6805af74702c77d3ef932fdcb679d2849adcafa
SHA512 (pydata-sphinx-theme-0.21.0.tar.gz) = 3dd6b67130f7426b4a7175ee73ceab0f228633ed52914031cb9f6ae45afd59da40efa665d98c9a967ed78885ec3c919a5c6d60d5d4766dfab4f673cdf8b3d2d5
SHA512 (pydata-sphinx-theme-0.21.0-vendor.tar.xz) = 4be3365d486dfc3613620af61b1d360448bae06dd44dd56e9336990c2bfd88e7a3b330c9671969b483a09ce5bd9f47951a1d35145df5ae1a3d8c94c81ae45843