2024-12-20 02:04:31 +01:00
|
|
|
# vim: set ts=4 sw=4 ft=bash et:
|
2024-12-15 02:15:06 +01:00
|
|
|
#
|
|
|
|
# This hook executes the following tasks:
|
|
|
|
# - Generates provides file with provides entries for xbps-create(1)
|
|
|
|
|
|
|
|
generate_python_provides() {
|
|
|
|
local py3_bin="${XBPS_MASTERDIR}/usr/bin/python3"
|
|
|
|
|
|
|
|
if [ -z "$nopyprovides" ] && [ -d "${PKGDESTDIR}/${py3_sitelib}" ] && [ -x "${py3_bin}" ]; then
|
|
|
|
PYTHONPATH="${XBPS_MASTERDIR}/${py3_sitelib}-bootstrap" "${py3_bin}" \
|
|
|
|
"${XBPS_COMMONDIR}"/scripts/parse-py-metadata.py \
|
|
|
|
-S "${PKGDESTDIR}/${py3_sitelib}" -v "${pkgver}" provides
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
hook() {
|
|
|
|
# include explicit values from the template
|
2024-12-20 02:04:31 +01:00
|
|
|
local -a _provides=($provides)
|
2024-12-15 02:15:06 +01:00
|
|
|
|
|
|
|
# get the canonical python package names for each python module
|
2024-12-20 02:04:31 +01:00
|
|
|
mapfile -t -O "${#_provides[@]}" _provides < <( generate_python_provides )
|
2024-12-15 02:15:06 +01:00
|
|
|
|
|
|
|
if [ "${#_provides[@]}" -gt 0 ]; then
|
|
|
|
echo " ${_provides[*]}"
|
|
|
|
echo "${_provides[*]}" > "${XBPS_STATEDIR}/${pkgname}-provides"
|
|
|
|
fi
|
|
|
|
}
|