Skip to content

Commit

Permalink
Merge branch 'void-linux:master' into spotify-player
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierfortier1 authored Dec 16, 2024
2 parents af8d663 + 0fa8253 commit b7631f8
Show file tree
Hide file tree
Showing 1,753 changed files with 12,955 additions and 4,124 deletions.
7 changes: 7 additions & 0 deletions Manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -1639,6 +1639,13 @@ written in Python) or just single Python file ones that live in `/usr/bin`.
If `python_version` is set to `ignore`, python-containing shebangs will not be rewritten.
Use this only if a package should not be using a system version of python.

- `python_extras`: Python module extras to consider when verifying Python module dependencies.
Can be used to ensure additional dependency sets are checked. Example: `python_extras="all"`.

- `nopyprovides`: if set, don't create `provides` entries for Python modules in the package.

- `nopyverifydeps`: if set, don't verify Python module dependencies.

Also, a set of useful variables are defined to use in the templates:

| Variable | Value |
Expand Down
2 changes: 1 addition & 1 deletion common/build-helper/meson.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ esac
# Tell meson to run binaries with qemu if desired
_MESON_EXE_WRAPPER=""
if [[ "${build_helper}" = *qemu* ]]; then
_MESON_EXE_WRAPPER="exe_wrapper = '/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static'"
_MESON_EXE_WRAPPER="exe_wrapper = '/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}'"
fi

# Record cross-compiling information in cross file.
Expand Down
2 changes: 2 additions & 0 deletions common/build-helper/python3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
if [ -n "$CROSS_BUILD" ]; then
export PYPREFIX="$XBPS_CROSS_BASE"
export CFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc} -I${XBPS_CROSS_BASE}/usr/include"
export CXXFLAGS+=" -I${XBPS_CROSS_BASE}/${py3_inc} -I${XBPS_CROSS_BASE}/usr/include"
export LDFLAGS+=" -L${XBPS_CROSS_BASE}/${py3_lib} -L${XBPS_CROSS_BASE}/usr/lib"
export CC="${XBPS_CROSS_TRIPLET}-gcc -pthread $CFLAGS $LDFLAGS"
export CXX="${XBPS_CROSS_TRIPLET}-g++ -pthread $CXXFLAGS $LDFLAGS"
export LDSHARED="${CC} -shared $LDFLAGS"
export PYTHON_CONFIG="${XBPS_CROSS_BASE}/usr/bin/python3-config"
export PYTHONPATH="${XBPS_CROSS_BASE}/${py3_lib}"
Expand Down
3 changes: 3 additions & 0 deletions common/environment/build-style/python3-module.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
lib32disabled=yes
if [ -z "$nopyprovides" ] || [ -z "$noverifypydeps" ]; then
hostmakedepends+=" python3-packaging-bootstrap"
fi
makedepends+=" python3"
build_helper+=" python3"
5 changes: 4 additions & 1 deletion common/environment/build-style/python3-pep517.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
hostmakedepends+=" python3-build python3-installer"
lib32disabled=yes
hostmakedepends+=" python3-build python3-installer"
if [ -z "$nopyprovides" ] || [ -z "$noverifypydeps" ]; then
hostmakedepends+=" python3-packaging-bootstrap"
fi
build_helper+=" python3"
6 changes: 6 additions & 0 deletions common/environment/setup-subpkg/subpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ unset -v nostrip nostrip_files
# hooks/post-install/14-fix-permissions
unset -v nocheckperms nofixperms

# hooks/pre-pkg/04-generate-provides
unset -v nopyprovides

# hooks/pre-pkg/04-generate-runtime-deps
unset -v noverifyrdeps skiprdeps allow_unknown_shlibs shlib_requires

Expand All @@ -20,6 +23,9 @@ unset -v lib32depends lib32disabled lib32files lib32mode lib32symlinks
# hooks/pre-pkg/06-shlib-provides
unset -v noshlibprovides shlib_provides

# hooks/pre-pkg/06-verify-python-deps
unset -v noverifypydeps python_extras

# xbps-triggers: system-accounts
unset -v system_accounts system_groups

Expand Down
2 changes: 1 addition & 1 deletion common/environment/setup/python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ py2_lib="usr/lib/python${py2_ver}"
py2_sitelib="${py2_lib}/site-packages"
py2_inc="usr/include/python${py2_ver}"

py3_ver="3.12"
py3_ver="3.13"
py3_abiver=""
py3_lib="usr/lib/python${py3_ver}"
py3_sitelib="${py3_lib}/site-packages"
Expand Down
22 changes: 12 additions & 10 deletions common/hooks/do-pkg/00-gen-pkg.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This hook generates a XBPS binary package from an installed package in destdir.

genpkg() {
local pkgdir="$1" arch="$2" desc="$3" pkgver="$4" binpkg="$5"
local pkgdir="$1" arch="$2" desc="$3" pkgver="$4" binpkg="$5" suffix="${6:-}"
local _preserve _deps _shprovides _shrequires _gitrevs _provides _conflicts
local _replaces _reverts _mutable_files _conf_files f
local _pkglock="$pkgdir/${binpkg}.lock"
Expand Down Expand Up @@ -34,21 +34,23 @@ genpkg() {
cd $pkgdir

_preserve=${preserve:+-p}
if [ -s ${XBPS_STATEDIR}/${pkgname}-rdeps ]; then
_deps="$(<${XBPS_STATEDIR}/${pkgname}-rdeps)"
if [ -s ${XBPS_STATEDIR}/${pkgname}${suffix}-rdeps ]; then
_deps="$(<${XBPS_STATEDIR}/${pkgname}${suffix}-rdeps)"
fi
if [ -s ${XBPS_STATEDIR}/${pkgname}-shlib-provides ]; then
_shprovides="$(<${XBPS_STATEDIR}/${pkgname}-shlib-provides)"
if [ -s ${XBPS_STATEDIR}/${pkgname}${suffix}-shlib-provides ]; then
_shprovides="$(<${XBPS_STATEDIR}/${pkgname}${suffix}-shlib-provides)"
fi
if [ -s ${XBPS_STATEDIR}/${pkgname}-shlib-requires ]; then
_shrequires="$(<${XBPS_STATEDIR}/${pkgname}-shlib-requires)"
if [ -s ${XBPS_STATEDIR}/${pkgname}${suffix}-provides ]; then
_provides="$(<${XBPS_STATEDIR}/${pkgname}${suffix}-provides)"
fi
if [ -s ${XBPS_STATEDIR}/${pkgname}${suffix}-shlib-requires ]; then
_shrequires="$(<${XBPS_STATEDIR}/${pkgname}${suffix}-shlib-requires)"
fi
if [ -s ${XBPS_STATEDIR}/gitrev ]; then
_gitrevs="$(<${XBPS_STATEDIR}/gitrev)"
fi

# Stripping whitespaces
local _provides="$(echo $provides)"
local _conflicts="$(echo $conflicts)"
local _replaces="$(echo $replaces)"
local _reverts="$(echo $reverts)"
Expand Down Expand Up @@ -142,7 +144,7 @@ hook() {
_desc="${short_desc} (debug files)"
binpkg=${_pkgver}.${arch}.xbps
PKGDESTDIR="${XBPS_DESTDIR}/${XBPS_CROSS_TRIPLET}/${pkgname}-dbg-${version}"
genpkg ${repo} ${arch} "${_desc}" ${_pkgver} ${binpkg}
genpkg ${repo} ${arch} "${_desc}" ${_pkgver} ${binpkg} -dbg
fi
# Generate 32bit pkg.
if [ "$XBPS_TARGET_MACHINE" != "i686" ]; then
Expand All @@ -161,6 +163,6 @@ hook() {
PKGDESTDIR="${XBPS_DESTDIR}/${pkgname}-32bit-${version}"
[ -n "${_provides}" ] && export provides="${_provides}"
[ -n "${_replaces}" ] && export replaces="${_replaces}"
genpkg ${repo} x86_64 "${_desc}" ${_pkgver} ${binpkg}
genpkg ${repo} x86_64 "${_desc}" ${_pkgver} ${binpkg} -32bit
fi
}
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ _EOF
if [ -d ${PKGDESTDIR}/usr/lib/python* ]; then
pycompile_version="$(find ${PKGDESTDIR}/usr/lib/python* -prune -type d | grep -o '[[:digit:]]\.[[:digit:]]\+$')"
if [ -z "${pycompile_module}" ]; then
pycompile_module="$(find ${PKGDESTDIR}/usr/lib/python*/site-packages -mindepth 1 -maxdepth 1 '!' -name '*.egg-info' '!' -name '*.dist-info' '!' -name '*.so' '!' -name '*.pth' -printf '%f ')"
pycompile_module="$(find ${PKGDESTDIR}/usr/lib/python*/site-packages* -mindepth 1 -maxdepth 1 '!' -name '*.egg-info' '!' -name '*.dist-info' '!' -name '*.so' '!' -name '*.pth' -printf '%f ')"
fi
fi

Expand Down
9 changes: 5 additions & 4 deletions common/hooks/post-install/98-shlib-provides.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ collect_sonames() {
local _pattern="^[[:alnum:]]+(.*)+\.so(\.[0-9]+)*$"
local _versioned_pattern="^[[:alnum:]]+(.*)+\.so(\.[0-9]+)+$"
local _tmpfile=$(mktemp) || exit 1
local _mainpkg="$2"
local _mainpkg="${2:-}"
local _suffix="${3:-}"
local _shlib_dir="${XBPS_STATEDIR}/shlib-provides"
local _no_soname=$(mktemp) || exit 1

Expand Down Expand Up @@ -50,8 +51,8 @@ collect_sonames() {
echo "$f" >> ${_tmpfile}
done
if [ -s "${_tmpfile}" ]; then
tr '\n' ' ' < "${_tmpfile}" > "${XBPS_STATEDIR}/${pkgname}-shlib-provides"
echo >> "${XBPS_STATEDIR}/${pkgname}-shlib-provides"
tr '\n' ' ' < "${_tmpfile}" > "${XBPS_STATEDIR}/${pkgname}${_suffix}-shlib-provides"
echo >> "${XBPS_STATEDIR}/${pkgname}${_suffix}-shlib-provides"
if [ "$_mainpkg" ]; then
cp "${_tmpfile}" "${_shlib_dir}/${pkgname}.soname"
fi
Expand Down Expand Up @@ -84,5 +85,5 @@ hook() {
# native pkg
collect_sonames ${PKGDESTDIR} $_mainpkg
# 32bit pkg
collect_sonames ${_destdir32}
collect_sonames ${_destdir32} "" -32bit
}
2 changes: 1 addition & 1 deletion common/hooks/pre-configure/02-script-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ hook() {
generic_wrapper3 libetpan-config
generic_wrapper3 giblib-config
python_wrapper python-config 2.7
python_wrapper python3-config 3.12
python_wrapper python3-config 3.13
apr_apu_wrapper apu-1-config
qemu_wrapper llvm-config
}
29 changes: 29 additions & 0 deletions common/hooks/pre-pkg/04-generate-provides.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# vim: set ts=4 sw=4 et:
#
# 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() {
local -a _provides=()

# include explicit values from the template
read -r -a _provides <<< "$provides"

# get the canonical python package names for each python module
mapfile -t _provides -O "${#_provides[@]}" < <( generate_python_provides )

if [ "${#_provides[@]}" -gt 0 ]; then
echo " ${_provides[*]}"
echo "${_provides[*]}" > "${XBPS_STATEDIR}/${pkgname}-provides"
fi
}
17 changes: 17 additions & 0 deletions common/hooks/pre-pkg/06-verify-python-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# vim: set ts=4 sw=4 et:
#
# This hook executes the following tasks:
# - Verifies python module dependencies from dist-info's METADATA and egg-info's PKG-INFO

hook() {
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 \
${NOCOLORS:+-C} ${XBPS_STRICT:+-s} -S "${PKGDESTDIR}/${py3_sitelib}" -v "${pkgver}" \
depends -e "${python_extras}" \
-V <( $XBPS_QUERY_XCMD -R -p provides -s "py3:" ) -D "${XBPS_STATEDIR}/${pkgname}-rdeps" \
|| msg_error "$pkgver: failed to verify python module dependencies\n"
fi
}
Loading

0 comments on commit b7631f8

Please sign in to comment.