build-style/python3-pep517.sh: improve default wheel selection

When naming wheels, hyphens are converted to underscores in package
names. Recognizing this in the build style eliminates manual definition
of `make_install_target` in several templates.
This commit is contained in:
Andrew J. Hesford 2022-05-16 10:26:50 -04:00
parent 506157517d
commit 950151c572
1 changed files with 5 additions and 1 deletions

View File

@ -23,7 +23,11 @@ do_check() {
do_install() {
# As with do_build, no need to accommodate cross compilation here
: ${make_install_target:=${pkgname#python3-}-${version}-*-*-*.whl}
if [ -z "${make_install_target}" ]; then
# Default wheel name normalizes hyphens to underscores
local wheelbase="${pkgname#python3-}"
make_install_target="${wheelbase//-/_}-${version}-*-*-*.whl"
fi
# If do_build was overridden, make sure the TMPDIR exists
mkdir -p build