Files
python-pydata-sphinx-theme/prepare_vendor.sh

81 lines
2.4 KiB
Bash
Raw Permalink Normal View History

- Refresh npm dependencies * update brace-expansion to 1.1.12 CVE-2025-5889, gh#juliangruber/brace-expansion#65, bsc#1244343 - Update to version 0.16.1: * Bump: 0.16.1rc0 -> 0.16.1 * Updates for file src/pydata_sphinx_theme/locale/en/LC_MESSAGES/sphinx.po in es (#2079) * Updates for file src/pydata_sphinx_theme/locale/en/LC_MESSAGES/sphinx.po in fr (#2075) * bump: 0.16.0 -> 0.16.1rc0 * i18n - Update localisation files (#2072) * Match Sphinx toggle button and Sphinx Design hover and focus styles (#2061) * Import Bootstrap after importing our variable overrides (#2066) * Higher contrast table hover stripe (light mode) (#2062) * Restore focus ring Sphinx Design dropdowns (#2060) * DOC - Update documentation regarding formatting files (#2057) * [pre-commit.ci] pre-commit autoupdate hooks (#2064) * Remove hover striping from all but `.dataframe` tables (#2059) * Fix colour variables (#2058) * update revs to ignore in blame (#2056) * automatic changes from b633898 and 9c5a3d5 * update pre-commit hooks / linter config * ~Revert "LINT - Run updated pre-commit hooks (#2049)" (#2054) * fix wrong switcher JSON loaded for dev docs (#2048) * BUG - Fix i18n files and compilation for distribution (#2042) * MAINT - update from Twitter -> X (#2052) * added itom to projects using this theme (#2037) * LINT - Run updated pre-commit hooks (#2049) * DOC - Add design system documentation (#2046) * ENH - When using the copybutton in code blocks, exclude copying the prompt (#2036) * DOCS - Update accessibility docs (#2039) * [pre-commit.ci] pre-commit autoupdate hooks (#2005) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydata-sphinx-theme?expand=0&rev=17
2025-06-11 10:01:54 +00:00
#!/bin/bash
# Script based on the fedora package
# https://src.fedoraproject.org/rpms/python-pydata-sphinx-theme/blob/rawhide/f/prepare_vendor.sh
PKG_DIR="$(pwd)"
PKG_PATH=pydata-sphinx-theme
PKG_NAME=python-pydata-sphinx-theme
PKG_VERSION=0.16.1
cleanup_tmpdir() {
popd 2>/dev/null
rm -rf /tmp/yarn--*
rm -rf /tmp/core-js-banners
}
trap cleanup_tmpdir SIGINT
cleanup_and_exit() {
cleanup_tmpdir
if test "$1" = 0 -o -z "$1" ; then
exit 0
else
exit $1
fi
}
cd $PKG_PATH
export YARN_CACHE_FOLDER=".package-cache"
echo ">>>>>> Install npm modules"
yarn install --frozen-lockfile
if [ $? -ne 0 ]; then
echo "ERROR: yarn install failed"
cleanup_and_exit 1
fi
echo ">>>>>> Cleanup object dirs"
find node_modules/ -type d -name "*.o.d" -execdir rm {} +
find node_modules/ -type d -name "__pycache__" -execdir rm {} +
echo ">>>>>> Cleanup object files"
find node_modules/ -name "*.node" -execdir rm {} +
find node_modules/ -name "*.dll" | grep -v signal-client | xargs rm -f
find node_modules/ -name "*.dylib" -delete
find node_modules/ -name "*.so" -delete
find node_modules/ -name "*.o" -delete
find node_modules/ -name "*.a" -delete
find node_modules/ -name "*.snyk-*.flag" -delete
echo ">>>>>> Cleanup build info"
find node_modules/ -name "builderror.log" -delete
find node_modules/ -name "yarn-error.log" -delete
find node_modules/ -name "yarn.lock" -delete
find node_modules/ -name ".deps" -type d -execdir rm {} +
find node_modules/ -name "Makefile" -delete
find node_modules/ -name "*.target.mk" -delete
find node_modules/ -name "config.gypi" -delete
find node_modules/ -name "package.json" -exec sed -i "s#$PKG_PATH#/tmp#g" {} \;
echo ">>>>>> Cleanup yarn tarballs"
find node_modules/ -name ".yarn-tarball.tgz" -delete
echo ">>>>>> Cleanup source maps"
find node_modules/ -name "*.js.map" -delete
find node_modules/ -name "*.ts.map" -delete
find node_modules/ -name "*.mjs.map" -delete
find node_modules/ -name "*.cjs.map" -delete
find node_modules/ -name "*.css.map" -delete
find node_modules/ -name "*.min.map" -delete
echo ">>>>>> Package vendor files"
rm -f ${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
yarn add license-checker
yarn license-checker --summary | sed "s#$PKG_PATH#/tmp#g" > $PKG_DIR/${PKG_NAME}-${PKG_VERSION}-vendor-licenses.txt
rm -rf .package-cache
cd -
cleanup_and_exit 0