diff options
author | psykose <alice@ayaya.dev> | 2023-07-04 13:12:19 +0000 |
---|---|---|
committer | psykose <alice@ayaya.dev> | 2023-07-04 15:12:19 +0200 |
commit | 8143b4201081340155f38c5218821d126649a79b (patch) | |
tree | 033033ab43d958083b8b78f1beeb3f6dea96820a | |
parent | 02d7e5c2bfc30d7b5bef8086eacb945c50ff80b5 (diff) |
community/opencv: add a dummy name for opencv-python
ref #15062
-rw-r--r-- | community/opencv/APKBUILD | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/community/opencv/APKBUILD b/community/opencv/APKBUILD index 445d8c5e7af..d74a920bc51 100644 --- a/community/opencv/APKBUILD +++ b/community/opencv/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Bart Ribbers <bribbers@disroot.org> pkgname=opencv pkgver=4.8.0 -pkgrel=3 +pkgrel=4 pkgdesc="Open source computer vision and machine learning library" url="https://opencv.org/" # s390x blocked by vtk -> netcdf @@ -164,6 +164,22 @@ package() { .dist/*.whl DESTDIR="$pkgdir" cmake --install build python3 -m compileall -fq "$pkgdir"/usr/lib/python* + + # opencv's python metainfo names it "opencv", as expected. + # however, people usually don't use this, they use + # https://github.com/opencv/opencv-python + # which is installed with "pip install opencv-python", is + # exactly the same thing, and is named differently. + # so, to be satisfied with a system dependency, it has to follow + # that same name. + # we can trick pip into thinking both are installed by just copying the + # dist-info and changing the name. + cd "$pkgdir"/usr/lib/python*/site-packages + local distinfo="$(echo opencv-*.dist-info)" + cp -r "$distinfo" opencv-python-$pkgver.dist-info + sed -i \ + -e "s|Name: opencv|Name: opencv-python|" \ + opencv-python-$pkgver.dist-info/METADATA } samples() { |