template 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # Template file for 'opencv'
  2. pkgname=opencv
  3. version=3.4.10
  4. revision=2
  5. build_style=cmake
  6. configure_args="-DENABLE_PRECOMPILED_HEADERS=OFF -DWITH_OPENMP=ON
  7. -DWITH_OPENCL=ON -DENABLE_CXX11=ON -DOPENCV_SKIP_PYTHON_LOADER=ON
  8. -DOPENCV_PYTHON3_INSTALL_PATH=/${py3_sitelib}
  9. -DOPENCV_PYTHON_INSTALL_PATH=/${py2_sitelib}"
  10. hostmakedepends="pkg-config eigen python-numpy python3-numpy"
  11. makedepends="ffmpeg-devel libpng-devel libjpeg-turbo-devel tiff-devel
  12. jasper-devel ocl-icd-devel libgomp-devel libopenexr-devel gtk+3-devel
  13. libgphoto2-devel gst-plugins-base1-devel openblas-devel
  14. python-numpy python3-numpy python-devel python3-devel"
  15. short_desc="Computer vision and machine learning software library"
  16. maintainer="Orphaned <orphan@voidlinux.org>"
  17. license="BSD-3-Clause"
  18. homepage="https://opencv.org"
  19. distfiles="https://github.com/opencv/${pkgname}/archive/${version}.tar.gz"
  20. checksum=1ed6f5b02a7baf14daca04817566e7c98ec668cec381e0edf534fa49f10f58a2
  21. if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
  22. makedepends+=" libatomic-devel"
  23. fi
  24. if [ -z "$XBPS_CHECK_PKGS" ]; then
  25. # opencv by default builds tests that only seem to be used in make check
  26. configure_args+=" -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF"
  27. fi
  28. if [ "$CROSS_BUILD" ]; then
  29. # Tell opencv where to find python and numpy
  30. _npincdir="numpy/core/include"
  31. configure_args+=" -DPYTHON2_INCLUDE_PATH=${XBPS_CROSS_BASE}/${py2_inc}
  32. -DPYTHON2_NUMPY_INCLUDE_DIRS=${XBPS_CROSS_BASE}/${py2_sitelib}/${_npincdir}
  33. -DPYTHON3_INCLUDE_PATH=${XBPS_CROSS_BASE}/${py3_inc}
  34. -DPYTHON3_NUMPY_INCLUDE_DIRS=${XBPS_CROSS_BASE}/${py3_sitelib}/${_npincdir}"
  35. fi
  36. # Liberation
  37. # Some of the code is taken from:
  38. # https://git.parabola.nu/abslibre.git/tree/libre/opencv/PKGBUILD
  39. post_patch() {
  40. # remove nonfree Milky icons
  41. rm -rv modules/highgui/src/files_Qt/Milky
  42. # remove nonfree lena.png and lena.jpg images
  43. rm -v $(find . -iname '*lena*')
  44. }
  45. post_install() {
  46. vlicense LICENSE
  47. }
  48. libopencv_package() {
  49. short_desc+=" - library files"
  50. pkg_install() {
  51. vmove usr/lib/*.so.*
  52. }
  53. }
  54. libopencv-devel_package() {
  55. short_desc+=" - development files"
  56. depends="libopencv>=${version}_${revision}"
  57. pkg_install() {
  58. vmove usr/include
  59. vmove usr/lib/pkgconfig
  60. vmove usr/lib/*.so
  61. vmove usr/share/OpenCV
  62. }
  63. }
  64. libopencv-python_package() {
  65. short_desc+=" - Python2 bindings"
  66. depends="python-numpy"
  67. pkg_install() {
  68. vmove usr/lib/python2.7
  69. }
  70. }
  71. libopencv-python3_package() {
  72. short_desc+=" - Python3 bindings"
  73. depends="python3-numpy"
  74. pkg_install() {
  75. vmove usr/lib/python3*
  76. }
  77. }