Files
omarchy-pkgs/pkgbuilds/python-mediapipe/PKGBUILD
T
Ryan Hughes 2fad766013 Add Link Studio to the fast ring
Package Link Studio 1.0.2 with its AUR-only MediaPipe and sounddevice dependencies. Wire Link Studio to GitHub release checksums, keep all three packages on the fast ring, and make MediaPipe's Bazel bootstrap a checksummed makepkg source.
2026-09-01 01:55:23 -04:00

88 lines
2.8 KiB
Bash

# Maintainer: robertfoster
# Maintainer: Hu Butui <hot123tea123@gmail.com>
_pkgname=mediapipe
_bazel_version=7.4.1
pkgname=python-mediapipe
pkgver=1.0.0
pkgrel=2.1
pkgdesc="A cross-platform, customizable ML solutions for live and streaming media"
arch=('x86_64')
url="https://github.com/google-ai-edge/mediapipe"
license=("Apache-2.0")
depends=(
absl-py
gcc-libs
glibc
libglvnd
opencv
opengl-driver
python-attrs
python-flatbuffers
python-matplotlib
python-numpy
python-opencv
python-pillow
python-protobuf
python-scipy
python-six
python-sounddevice
python-tensorflow
)
makedepends=(
patchelf
python-build
python-installer
python-setuptools
python-wheel
)
source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/google-ai-edge/mediapipe/archive/refs/tags/v${pkgver}.tar.gz"
"bazel-${_bazel_version}-linux-x86_64::https://github.com/bazelbuild/bazel/releases/download/${_bazel_version}/bazel-${_bazel_version}-linux-x86_64"
"0004-use-opencv-headers.patch"
"0005-set-hermetic-python-version-and-disable-odml-converter.patch"
"0006-opencv5-geometry-header.patch"
"0007-bump-rules-java.patch"
)
sha256sums=('6343314dad0f4112610807ca723eee63feea00711dc2be9360928b6f0a5eba12'
'c97f02133adce63f0c28678ac1f21d65fa8255c80429b588aeeba8a1fac6202b'
'd18e88a217a00dc77cf2bfaa1d33b5fbc912deed5df686b0d2455fb0db75a677'
'62cbd43346e7a7705127656a74bec44852e5bbfc006c4723005fdd23af5258db'
'fb082d88d9cca47534ae01fca676a3afdb909bfc82d52c97cf0eaedf34571d5f'
'bdead49ac5370dc84d9facee962bf2def5d9055d7339a37b2ba3f3b4bb02f811')
prepare() {
# bazel in the ArchLinux is not working
mkdir -p ${srcdir}/bin
install -Dm755 "${srcdir}/bazel-${_bazel_version}-linux-x86_64" \
"${srcdir}/bin/bazel"
export PATH=${srcdir}/bin:${PATH}
cd "${srcdir}/${_pkgname}-${pkgver}"
patch -p1 -i "${srcdir}/0004-use-opencv-headers.patch"
patch -p1 -i "${srcdir}/0005-set-hermetic-python-version-and-disable-odml-converter.patch"
patch -p1 -i "${srcdir}/0006-opencv5-geometry-header.patch"
patch -p1 -i "${srcdir}/0007-bump-rules-java.patch"
# set __version__
sed -i "s/__version__ = 'dev'/__version__ = '$pkgver'/" setup.py
# set link_opencv to True
sed -i "s/self.link_opencv = False/self.link_opencv = True/g" setup.py
}
build() {
cd "${srcdir}/${_pkgname}-${pkgver}"
# enable building with GPU support, using opengl-driver
# opengl-driver is provided by mesa or nvidia-utils
MEDIAPIPE_DISABLE_GPU=0 \
python -m build --wheel --no-isolation
}
package() {
cd "${srcdir}/${_pkgname}-${pkgver}"
python -m installer --destdir="${pkgdir}" dist/*.whl
# remove rpath and fix permission
find ${pkgdir} -type f -name "*.so" -exec patchelf --remove-rpath {} \;
find ${pkgdir} -type f -name "*.so" -exec chmod 755 {} \;
}
# vim:set ts=2 sw=2 et: