|
| 1 | + |
| 2 | +_realname=av |
| 3 | +pkgbase=mingw-w64-python-${_realname} |
| 4 | +pkgname=${MINGW_PACKAGE_PREFIX}-python-${_realname} |
| 5 | +pkgver=14.3.0 |
| 6 | +pkgrel=1 |
| 7 | +pkgdesc='Pythonic bindings for FFmpeg (mingw-w64)' |
| 8 | +arch=('any') |
| 9 | +mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') |
| 10 | +url='https://pyav.basswood-io.com' |
| 11 | +license=('spdx:BSD-3-Clause') |
| 12 | +msys2_repository_url="https://github.com/PyAV-Org/PyAV" |
| 13 | +msys2_references=( |
| 14 | + 'aur: python-av' |
| 15 | +) |
| 16 | +depends=( |
| 17 | + ${MINGW_PACKAGE_PREFIX}-ffmpeg |
| 18 | + ${MINGW_PACKAGE_PREFIX}-python |
| 19 | + ${MINGW_PACKAGE_PREFIX}-python-pillow |
| 20 | + ${MINGW_PACKAGE_PREFIX}-python-numpy) |
| 21 | +makedepends=("${MINGW_PACKAGE_PREFIX}-cython" |
| 22 | + "${MINGW_PACKAGE_PREFIX}-python-build" |
| 23 | + "${MINGW_PACKAGE_PREFIX}-python-installer" |
| 24 | + "${MINGW_PACKAGE_PREFIX}-python-pip" |
| 25 | + "${MINGW_PACKAGE_PREFIX}-python-setuptools" |
| 26 | + "${MINGW_PACKAGE_PREFIX}-python-virtualenv") |
| 27 | +options=('!strip') |
| 28 | +source=("https://github.com/PyAV-Org/PyAV/archive/refs/tags/v${pkgver}.tar.gz" |
| 29 | + "001-makefile-vars.patch") |
| 30 | +sha256sums=('9b281e52835a8c19e60a77ad94c6181b05db68d5eb5f66ee9f8222a24c01a4c3' |
| 31 | + 'dd0d5871fa65d185c690e3e6bc2629d4f31a5e93e653fce4655d932b6a3f7f70') |
| 32 | + |
| 33 | +apply_patch_with_msg() { |
| 34 | + for _patch in "$@" |
| 35 | + do |
| 36 | + msg2 "Applying $_patch" |
| 37 | + patch -Nbp1 -i "${srcdir}/$_patch" |
| 38 | + done |
| 39 | +} |
| 40 | + |
| 41 | +prepare() { |
| 42 | + cd "${srcdir}"/PyAV-${pkgver} |
| 43 | + |
| 44 | + apply_patch_with_msg \ |
| 45 | + 001-makefile-vars.patch |
| 46 | + |
| 47 | +} |
| 48 | + |
| 49 | +build() { |
| 50 | + cp -r "PyAV-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}" |
| 51 | + |
| 52 | + PYAV_PYTHON=python \ |
| 53 | + source scripts/activate.sh |
| 54 | + |
| 55 | + python.exe -m pip install --upgrade pip setuptools cython |
| 56 | + |
| 57 | + make |
| 58 | + |
| 59 | + #${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation |
| 60 | +} |
| 61 | + |
| 62 | +package() { |
| 63 | + cd "${srcdir}/python-build-${MSYSTEM}" |
| 64 | + |
| 65 | + MSYS2_ARG_CONV_EXCL="--prefix=" \ |
| 66 | + ${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \ |
| 67 | + --destdir="${pkgdir}" dist/*.whl |
| 68 | + |
| 69 | + install -Dm644 LICENSE.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE" |
| 70 | +} |
0 commit comments