Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | SUMMARY = "Opencv : The Open Computer Vision Library" |
| 2 | HOMEPAGE = "http://opencv.org/" |
| 3 | SECTION = "libs" |
| 4 | |
Andrew Geissler | 4b7c115 | 2020-11-30 19:55:29 -0600 | [diff] [blame] | 5 | LICENSE = "Apache-2.0" |
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 7 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 8 | ARM_INSTRUCTION_SET:armv4 = "arm" |
| 9 | ARM_INSTRUCTION_SET:armv5 = "arm" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 10 | |
| 11 | DEPENDS = "libtool swig-native bzip2 zlib glib-2.0 libwebp" |
| 12 | |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 13 | SRCREV_opencv = "69357b1e88680658a07cffde7678a4d697469f03" |
| 14 | SRCREV_contrib = "f5d7f6712d4ff229ba4f45cf79dfd11c557d56fd" |
Andrew Geissler | 7f40b71 | 2020-05-15 14:09:53 -0500 | [diff] [blame] | 15 | SRCREV_ipp = "a56b6ac6f030c312b2dce17430eef13aed9af274" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 16 | SRCREV_boostdesc = "34e4206aef44d50e6bbcd0ab06354b52e7466d26" |
| 17 | SRCREV_vgg = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d" |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 18 | SRCREV_face = "8afa57abc8229d611c4937165d20e2a2d9fc5a12" |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 19 | SRCREV_wechat-qrcode = "a8b69ccc738421293254aec5ddb38bd523503252" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 20 | |
| 21 | def ipp_filename(d): |
| 22 | import re |
| 23 | arch = d.getVar('TARGET_ARCH') |
| 24 | if re.match("i.86$", arch): |
Andrew Geissler | 7f40b71 | 2020-05-15 14:09:53 -0500 | [diff] [blame] | 25 | return "ippicv_2020_lnx_ia32_20191018_general.tgz" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 26 | else: |
Andrew Geissler | 7f40b71 | 2020-05-15 14:09:53 -0500 | [diff] [blame] | 27 | return "ippicv_2020_lnx_intel64_20191018_general.tgz" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 28 | |
| 29 | def ipp_md5sum(d): |
| 30 | import re |
| 31 | arch = d.getVar('TARGET_ARCH') |
| 32 | if re.match("i.86$", arch): |
Andrew Geissler | 7f40b71 | 2020-05-15 14:09:53 -0500 | [diff] [blame] | 33 | return "ad189a940fb60eb71f291321322fe3e8" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 34 | else: |
Andrew Geissler | 7f40b71 | 2020-05-15 14:09:53 -0500 | [diff] [blame] | 35 | return "7421de0095c7a39162ae13a6098782f9" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 36 | |
| 37 | IPP_FILENAME = "${@ipp_filename(d)}" |
| 38 | IPP_MD5 = "${@ipp_md5sum(d)}" |
| 39 | |
| 40 | SRCREV_FORMAT = "opencv_contrib_ipp_boostdesc_vgg" |
| 41 | SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 42 | git://github.com/opencv/opencv_contrib.git;destsuffix=contrib;name=contrib \ |
Andrew Geissler | 7f40b71 | 2020-05-15 14:09:53 -0500 | [diff] [blame] | 43 | git://github.com/opencv/opencv_3rdparty.git;branch=ippicv/master_20191018;destsuffix=ipp;name=ipp \ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 44 | git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=boostdesc;name=boostdesc \ |
| 45 | git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=vgg;name=vgg \ |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 46 | git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=face;name=face \ |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 47 | git://github.com/WeChatCV/opencv_3rdparty.git;branch=wechat_qrcode;destsuffix=wechat_qrcode;name=wechat-qrcode \ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 48 | file://0001-3rdparty-ippicv-Use-pre-downloaded-ipp.patch \ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 49 | file://0003-To-fix-errors-as-following.patch \ |
| 50 | file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \ |
| 51 | file://0001-Dont-use-isystem.patch \ |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 52 | file://download.patch \ |
Andrew Geissler | c87764f | 2020-06-27 00:16:32 -0500 | [diff] [blame] | 53 | file://0001-Make-ts-module-external.patch \ |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 54 | file://0001-sfm-link-with-Glog_LIBS.patch;patchdir=../contrib \ |
Patrick Williams | 93c203f | 2021-10-06 16:15:23 -0500 | [diff] [blame] | 55 | file://0001-Use-the-one-argument-version-of-SetTotalBytesLimit.patch \ |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 56 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 57 | SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=../contrib" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 58 | |
| 59 | S = "${WORKDIR}/git" |
| 60 | |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 61 | # OpenCV wants to download more files during configure. We download these in |
| 62 | # do_fetch and construct a source cache in the format it expects |
| 63 | OPENCV_DLDIR = "${WORKDIR}/downloads" |
| 64 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 65 | do_unpack_extra() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 66 | tar xzf ${WORKDIR}/ipp/ippicv/${IPP_FILENAME} -C ${WORKDIR} |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 67 | |
| 68 | md5() { |
| 69 | # Return the MD5 of $1 |
| 70 | echo $(md5sum $1 | cut -d' ' -f1) |
| 71 | } |
| 72 | cache() { |
| 73 | TAG=$1 |
| 74 | shift |
| 75 | mkdir --parents ${OPENCV_DLDIR}/$TAG |
| 76 | for F in $*; do |
| 77 | DEST=${OPENCV_DLDIR}/$TAG/$(md5 $F)-$(basename $F) |
| 78 | test -e $DEST || ln -s $F $DEST |
| 79 | done |
| 80 | } |
| 81 | cache xfeatures2d/boostdesc ${WORKDIR}/boostdesc/*.i |
| 82 | cache xfeatures2d/vgg ${WORKDIR}/vgg/*.i |
| 83 | cache data ${WORKDIR}/face/*.dat |
Andrew Geissler | e34f896 | 2021-04-15 15:53:51 -0500 | [diff] [blame] | 84 | cache wechat_qrcode ${WORKDIR}/wechat_qrcode/*.caffemodel |
| 85 | cache wechat_qrcode ${WORKDIR}/wechat_qrcode/*.prototxt |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 86 | } |
| 87 | addtask unpack_extra after do_unpack before do_patch |
| 88 | |
Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 89 | CMAKE_VERBOSE = "VERBOSE=1" |
| 90 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 91 | EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \ |
| 92 | -DWITH_1394=OFF \ |
| 93 | -DENABLE_PRECOMPILED_HEADERS=OFF \ |
| 94 | -DCMAKE_SKIP_RPATH=ON \ |
| 95 | -DOPENCV_ICV_HASH=${IPP_MD5} \ |
| 96 | -DIPPROOT=${WORKDIR}/ippicv_lnx \ |
Brad Bishop | 868407c | 2019-11-04 13:24:47 -0500 | [diff] [blame] | 97 | -DOPENCV_GENERATE_PKGCONFIG=ON \ |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 98 | -DOPENCV_DOWNLOAD_PATH=${OPENCV_DLDIR} \ |
| 99 | -DOPENCV_ALLOW_DOWNLOADS=OFF \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 100 | ${@bb.utils.contains("TARGET_CC_ARCH", "-msse3", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1", "", d)} \ |
| 101 | ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.1", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1", "", d)} \ |
| 102 | ${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.2", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1 -DENABLE_SSE42=1", "", d)} \ |
| 103 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 104 | EXTRA_OECMAKE:append:x86 = " -DX86=ON" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 105 | |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 106 | PACKAGECONFIG ??= "gapi python3 eigen jpeg png tiff v4l libv4l gstreamer samples tbb gphoto2 \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 107 | ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \ |
| 108 | ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "libav", "", d)}" |
| 109 | |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 110 | # TBB does not build for powerpc so disable that package config |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 111 | PACKAGECONFIG:remove:powerpc = "tbb" |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 112 | # tbb now needs getcontect/setcontext which is not there for all arches on musl |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 113 | PACKAGECONFIG:remove:libc-musl:riscv64 = "tbb" |
| 114 | PACKAGECONFIG:remove:libc-musl:riscv32 = "tbb" |
William A. Kennington III | b95905d | 2021-06-02 12:40:56 -0700 | [diff] [blame] | 115 | |
Brad Bishop | e42b3e3 | 2020-01-15 22:08:42 -0500 | [diff] [blame] | 116 | PACKAGECONFIG[gapi] = "-DWITH_ADE=ON -Dade_DIR=${STAGING_LIBDIR},-DWITH_ADE=OFF,ade" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 117 | PACKAGECONFIG[amdblas] = "-DWITH_OPENCLAMDBLAS=ON,-DWITH_OPENCLAMDBLAS=OFF,libclamdblas," |
| 118 | PACKAGECONFIG[amdfft] = "-DWITH_OPENCLAMDFFT=ON,-DWITH_OPENCLAMDFFT=OFF,libclamdfft," |
| 119 | PACKAGECONFIG[dnn] = "-DBUILD_opencv_dnn=ON -DPROTOBUF_UPDATE_FILES=ON -DBUILD_PROTOBUF=OFF,-DBUILD_opencv_dnn=OFF,protobuf protobuf-native," |
| 120 | PACKAGECONFIG[eigen] = "-DWITH_EIGEN=ON,-DWITH_EIGEN=OFF,libeigen gflags glog," |
| 121 | PACKAGECONFIG[freetype] = "-DBUILD_opencv_freetype=ON,-DBUILD_opencv_freetype=OFF,freetype," |
| 122 | PACKAGECONFIG[gphoto2] = "-DWITH_GPHOTO2=ON,-DWITH_GPHOTO2=OFF,libgphoto2," |
| 123 | PACKAGECONFIG[gstreamer] = "-DWITH_GSTREAMER=ON,-DWITH_GSTREAMER=OFF,gstreamer1.0 gstreamer1.0-plugins-base," |
| 124 | PACKAGECONFIG[gtk] = "-DWITH_GTK=ON,-DWITH_GTK=OFF,gtk+3," |
| 125 | PACKAGECONFIG[jasper] = "-DWITH_JASPER=ON,-DWITH_JASPER=OFF,jasper," |
| 126 | PACKAGECONFIG[java] = "-DJAVA_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native fastjar-native openjdk-8-native," |
| 127 | PACKAGECONFIG[jpeg] = "-DWITH_JPEG=ON,-DWITH_JPEG=OFF,jpeg," |
| 128 | PACKAGECONFIG[libav] = "-DWITH_FFMPEG=ON,-DWITH_FFMPEG=OFF,libav," |
| 129 | PACKAGECONFIG[libv4l] = "-DWITH_LIBV4L=ON,-DWITH_LIBV4L=OFF,v4l-utils," |
| 130 | PACKAGECONFIG[opencl] = "-DWITH_OPENCL=ON,-DWITH_OPENCL=OFF,opencl-headers virtual/opencl-icd," |
| 131 | PACKAGECONFIG[oracle-java] = "-DJAVA_INCLUDE_PATH=${ORACLE_JAVA_HOME}/include -DJAVA_INCLUDE_PATH2=${ORACLE_JAVA_HOME}/include/linux -DJAVA_AWT_INCLUDE_PATH=${ORACLE_JAVA_HOME}/include -DJAVA_AWT_LIBRARY=${ORACLE_JAVA_HOME}/lib/amd64/libjawt.so -DJAVA_JVM_LIBRARY=${ORACLE_JAVA_HOME}/lib/amd64/server/libjvm.so,,ant-native oracle-jse-jdk oracle-jse-jdk-native," |
| 132 | PACKAGECONFIG[png] = "-DWITH_PNG=ON,-DWITH_PNG=OFF,libpng," |
| 133 | PACKAGECONFIG[python2] = "-DPYTHON2_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include,,python-numpy," |
| 134 | PACKAGECONFIG[python3] = "-DPYTHON3_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include,,python3-numpy," |
| 135 | PACKAGECONFIG[samples] = "-DBUILD_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON,-DBUILD_EXAMPLES=OFF,," |
| 136 | PACKAGECONFIG[tbb] = "-DWITH_TBB=ON,-DWITH_TBB=OFF,tbb," |
Andrew Geissler | 97771a3 | 2021-03-05 15:23:11 -0600 | [diff] [blame] | 137 | PACKAGECONFIG[tests] = "-DBUILD_TESTS=ON,-DBUILD_TESTS=OFF,," |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 138 | PACKAGECONFIG[text] = "-DBUILD_opencv_text=ON,-DBUILD_opencv_text=OFF,tesseract," |
| 139 | PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff," |
| 140 | PACKAGECONFIG[v4l] = "-DWITH_V4L=ON,-DWITH_V4L=OFF,v4l-utils," |
| 141 | |
| 142 | inherit pkgconfig cmake |
| 143 | |
| 144 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'distutils3-base', '', d)} |
| 145 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python2', 'distutils-base', '', d)} |
| 146 | |
| 147 | export PYTHON_CSPEC="-I${STAGING_INCDIR}/${PYTHON_DIR}" |
| 148 | export PYTHON="${STAGING_BINDIR_NATIVE}/${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3', 'python', d)}" |
| 149 | export ORACLE_JAVA_HOME="${STAGING_DIR_NATIVE}/usr/bin/java" |
| 150 | export JAVA_HOME="${STAGING_DIR_NATIVE}/usr/lib/jvm/openjdk-8-native" |
| 151 | export ANT_DIR="${STAGING_DIR_NATIVE}/usr/share/ant/" |
| 152 | |
| 153 | TARGET_CC_ARCH += "-I${S}/include " |
| 154 | |
| 155 | PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'samples', '${PN}-samples', '', d)} \ |
| 156 | ${@bb.utils.contains('PACKAGECONFIG', 'oracle-java', '${PN}-java', '', d)} \ |
| 157 | ${@bb.utils.contains('PACKAGECONFIG', 'java', '${PN}-java', '', d)} \ |
| 158 | ${@bb.utils.contains('PACKAGECONFIG', 'python2', 'python-${BPN}', '', d)} \ |
| 159 | ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'python3-${BPN}', '', d)} \ |
| 160 | ${PN}-apps" |
| 161 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 162 | python populate_packages:prepend () { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 163 | cv_libdir = d.expand('${libdir}') |
| 164 | do_split_packages(d, cv_libdir, '^lib(.*)\.so$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev', allow_links=True) |
| 165 | do_split_packages(d, cv_libdir, '^lib(.*)\.la$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev') |
| 166 | do_split_packages(d, cv_libdir, '^lib(.*)\.a$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev') |
| 167 | do_split_packages(d, cv_libdir, '^lib(.*)\.so\.*', 'lib%s', 'OpenCV %s library', extra_depends='', allow_links=True) |
| 168 | |
| 169 | pn = d.getVar('PN') |
| 170 | metapkg = pn + '-dev' |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 171 | d.setVar('ALLOW_EMPTY:' + metapkg, "1") |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 172 | blacklist = [ metapkg ] |
| 173 | metapkg_rdepends = [ ] |
| 174 | packages = d.getVar('PACKAGES').split() |
| 175 | for pkg in packages[1:]: |
| 176 | if not pkg in blacklist and not pkg in metapkg_rdepends and pkg.endswith('-dev'): |
| 177 | metapkg_rdepends.append(pkg) |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 178 | d.setVar('RRECOMMENDS:' + metapkg, ' '.join(metapkg_rdepends)) |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 179 | |
| 180 | metapkg = pn |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 181 | d.setVar('ALLOW_EMPTY:' + metapkg, "1") |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 182 | blacklist = [ metapkg, "libopencv-ts" ] |
| 183 | metapkg_rdepends = [ ] |
| 184 | for pkg in packages[1:]: |
| 185 | if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.endswith('-doc') and not pkg.endswith('-locale') and not pkg.endswith('-staticdev'): |
| 186 | metapkg_rdepends.append(pkg) |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 187 | d.setVar('RDEPENDS:' + metapkg, ' '.join(metapkg_rdepends)) |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 188 | } |
| 189 | |
| 190 | PACKAGES_DYNAMIC += "^libopencv-.*" |
| 191 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 192 | FILES:${PN} = "" |
| 193 | FILES:${PN}-dbg += "${datadir}/OpenCV/java/.debug/* ${datadir}/OpenCV/samples/bin/.debug/*" |
| 194 | FILES:${PN}-dev = "${includedir} ${libdir}/pkgconfig ${libdir}/cmake/opencv4/*.cmake" |
| 195 | FILES:${PN}-staticdev += "${libdir}/opencv4/3rdparty/*.a" |
| 196 | FILES:${PN}-apps = "${bindir}/* ${datadir}/opencv4 ${datadir}/licenses" |
| 197 | FILES:${PN}-java = "${datadir}/OpenCV/java" |
| 198 | FILES:${PN}-samples = "${datadir}/opencv4/samples/" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 199 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 200 | INSANE_SKIP:${PN}-java = "libdir" |
| 201 | INSANE_SKIP:${PN}-dbg = "libdir" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 202 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 203 | ALLOW_EMPTY:${PN} = "1" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 204 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 205 | SUMMARY:python-opencv = "Python bindings to opencv" |
| 206 | FILES:python-opencv = "${PYTHON_SITEPACKAGES_DIR}/*" |
| 207 | RDEPENDS:python-opencv = "python-core python-numpy" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 208 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 209 | SUMMARY:python3-opencv = "Python bindings to opencv" |
| 210 | FILES:python3-opencv = "${PYTHON_SITEPACKAGES_DIR}/*" |
| 211 | RDEPENDS:python3-opencv = "python3-core python3-numpy" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 212 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 213 | RDEPENDS:${PN}-apps = "bash" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 214 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 215 | do_compile:prepend() { |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 216 | # remove the build host info to improve reproducibility |
| 217 | if [ -f ${WORKDIR}/build/modules/core/version_string.inc ]; then |
| 218 | sed -i "s#${WORKDIR}#/workdir#g" ${WORKDIR}/build/modules/core/version_string.inc |
| 219 | fi |
| 220 | } |
| 221 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 222 | do_install:append() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 223 | # Move Python files into correct library folder (for multilib build) |
| 224 | if [ "$libdir" != "/usr/lib" -a -d ${D}/usr/lib ]; then |
| 225 | mv ${D}/usr/lib/* ${D}/${libdir}/ |
| 226 | rm -rf ${D}/usr/lib |
| 227 | fi |
Andrew Geissler | ac970dd | 2021-02-12 15:32:45 -0600 | [diff] [blame] | 228 | # remove build host path to improve reproducibility |
| 229 | if [ -f ${D}${libdir}/cmake/opencv4/OpenCVModules.cmake ]; then |
| 230 | sed -e 's@${STAGING_DIR_HOST}@@g' \ |
| 231 | -i ${D}${libdir}/cmake/opencv4/OpenCVModules.cmake |
| 232 | fi |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 233 | } |