pixelflux/pyproject.toml

154 lines
4.8 KiB
TOML

[build-system]
requires = ["setuptools>=61.0", "wheel", "setuptools-rust"]
build-backend = "setuptools.build_meta"
[tool.cibuildwheel]
archs = [ "x86_64", "aarch64" ]
manylinux-x86_64-image = "manylinux_2_34"
manylinux-aarch64-image = "manylinux_2_34"
[tool.cibuildwheel.environment]
LD_LIBRARY_PATH = "/usr/local/lib:/usr/local/lib64"
PATH = "$HOME/.cargo/bin:$PATH"
[tool.cibuildwheel.linux]
before-all = """
set -euxo pipefail
# --- MANYLINUX (RPM-based) ---
if command -v dnf; then
dnf localinstall -y --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-9.noarch.rpm && \
dnf localinstall -y --nogpgcheck https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-9.noarch.rpm && \
dnf localinstall -y --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
dnf install -y \
curl \
clang \
pixman-devel \
libX11-devel \
libXext-devel \
libXcursor-devel \
libev-devel \
libXcomposite-devel \
libva-devel \
libdrm-devel \
libinput-devel \
libxkbcommon-devel \
mesa-libgbm-devel \
wayland-devel \
systemd-devel \
git \
make \
gcc \
nasm \
cmake \
gcc-c++ \
rust-toolset && \
\
(cd /tmp && \
git clone --branch stable --depth 1 https://code.videolan.org/videolan/x264.git && \
cd x264 && \
./configure --prefix=/usr/local --enable-shared --disable-cli && \
make -j$(nproc) && \
make install) && \
\
if [ "$(uname -m)" = "aarch64" ]; then \
dnf install -y libyuv-devel; \
else \
(cd /tmp && \
git clone --branch stable --depth 1 https://chromium.googlesource.com/libyuv/libyuv && \
cd libyuv && \
mkdir build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_POLICY_VERSION_MINIMUM=3.5 && \
make -j$(nproc) && \
make install); \
fi && \
\
(cd /tmp && \
git clone --branch 3.1.1 --depth 1 https://github.com/libjpeg-turbo/libjpeg-turbo.git && \
cd libjpeg-turbo && \
mkdir build && cd build && \
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release && \
make -j$(nproc) && \
make install) && \
\
(cd /tmp && \
git clone --branch n8.0 --depth 1 https://git.ffmpeg.org/ffmpeg.git && \
cd ffmpeg && \
./configure \
--prefix=/usr/local \
--enable-shared \
--disable-static \
--disable-programs \
--enable-gpl \
--enable-libx264 \
--extra-cflags="-I/usr/local/include" \
--extra-ldflags="-L/usr/local/lib" && \
make -j$(nproc) && \
make install) && \
\
ldconfig
# --- ALPINE (APK-based) ---
elif command -v apk; then
apk add --no-cache \
build-base \
clang \
rust \
cargo \
clang20-libclang \
pixman-dev \
libx11-dev \
libxext-dev \
libxcursor-dev \
libxfixes-dev \
jpeg-dev \
libev-dev \
x264-dev \
libyuv \
libyuv-dev \
libxcomposite-dev \
libva-dev \
libdrm-dev \
libinput-dev \
libxkbcommon-dev \
mesa-dev \
wayland-dev \
eudev-dev \
musl-dev \
ffmpeg-dev
else
echo "Unsupported package manager"
exit 1
fi
"""
repair-wheel-command = """
auditwheel repair -w {dest_dir} {wheel} \
--exclude libva.so.2 \
--exclude libva-drm.so.2 \
--exclude libva-x11.so.2 \
--exclude libdrm.so.2 \
--exclude libgbm.so.1 \
--exclude libEGL.so.1 \
--exclude libgobject-2.0.so.0 \
--exclude libglib-2.0.so.0 \
--exclude libgmodule-2.0.so.0 \
--exclude libffi.so.6 \
--exclude libffi.so.7 \
--exclude libffi.so.8 \
--exclude libwayland-server.so.0 \
--exclude libxkbcommon.so.0 \
--exclude libpixman-1.so.0 \
--exclude liblzma.so.5 \
--exclude libz.so.1 \
--exclude libstdc++.so.6 \
--exclude libgcc_s.so.1 \
--exclude libX11.so.6 \
--exclude libXext.so.6 \
--exclude libXfixes.so.3 \
--exclude libxcb.so.1 \
--exclude libxcb-dri3.so.0 \
--exclude libxcb-shm.so.0 \
--exclude libxcb-render.so.0
"""