post_install() {
INSTALLED_NUMPY_VERSION=$(dpkg --list python-numpy | grep python-numpy | awk '{print $3; exit;}')
if [ "${INSTALLED_NUMPY_VERSION%%-*}" != "2.4.3" ]; then
echo "WARNING: opencv-python is compiled with numpy 2.4.3, but numpy ${INSTALLED_NUMPY_VERSION%%-*} is installed. Please report it to https://github.com/termux/termux-packages if any bug happens."
fi
if [ -f "/data/data/com.termux/files/usr/bin/py3compile" ]; then
LD_PRELOAD='' "/data/data/com.termux/files/usr/bin/py3compile" -p "opencv-python" "/data/data/com.termux/files/usr/lib/python3.13/"
fi
exit 0
}
post_upgrade() {
post_install
}
pre_remove() {
if [ -f "/data/data/com.termux/files/usr/bin/py3clean" ]; then
LD_PRELOAD='' "/data/data/com.termux/files/usr/bin/py3clean" -p "opencv-python"
fi
exit 0
}
