ci: auto-detect package manager to use

This commit is contained in:
Matteo Bernardini
2025-09-03 11:27:46 +08:00
parent 1dfbc37135
commit 06e67cc533
2 changed files with 25 additions and 8 deletions

22
ci/setup_cibuildwheel.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/sh
# NOTE: ensure to use the correct package manager depending on the manylinux
# image used.
if which yum; then
yum install -y alsa-lib-devel
exit
fi
if which apk; then
apk add alsa-lib-dev
exit
fi
if which apt-get; then
apt-get install -y libasound2-dev
exit
fi
echo "Cannot install ALSA headers! No package manager detected"
exit 1

View File

@@ -56,15 +56,10 @@ ext-modules = [
]
[tool.cibuildwheel.linux]
# Use uv and build
[tool.cibuildwheel]
platform = "linux"
build-frontend = "build[uv]"
# NOTE: ensure to use the correct package manager depending on the manylinux
# image used. For AlmaLinux based images, use `yum`, for Debian based images
# use `apt`. `cibuildwheel` v3.1.4 defaults to manylinux_2_28, which is
# based on AlmaLinux 8.
before-all = "yum install -y alsa-lib-devel"
before-all = "ci/setup_cibuildwheel.sh"
[dependency-groups]