summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>2015-08-20 12:10:52 +0200
committerMartin Jansa <Martin.Jansa@gmail.com>2015-08-31 20:09:30 +0200
commite5abd3c3fb72556dd6fdce126fe7b81ed1285401 (patch)
treeb74f12bdb3923332316cc15de5fd4136f38dced3
parent7f478ed5cb7f8ab22b8c96a2d9d20e60ae230a09 (diff)
downloadmeta-openembedded-e5abd3c3fb72556dd6fdce126fe7b81ed1285401.tar.gz
Opencv: Add OpenCV 3.0
-Support for new PACKAGECONFIGS -Merge with opencv-samples Since it is not backward compatible with 2.x and cannot be installed in parallel it has a DEFAULT_PREFERENCE of -1. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Acked-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta-oe/recipes-support/opencv/opencv_3.0.bb129
1 files changed, 129 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/opencv/opencv_3.0.bb b/meta-oe/recipes-support/opencv/opencv_3.0.bb
new file mode 100644
index 000000000..575709c2d
--- /dev/null
+++ b/meta-oe/recipes-support/opencv/opencv_3.0.bb
@@ -0,0 +1,129 @@
1SUMMARY = "Opencv : The Open Computer Vision Library"
2HOMEPAGE = "http://opencv.org/"
3SECTION = "libs"
4
5LICENSE = "BSD-3-Clause"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=0ea90d28b4de883d7af5e6711f14f7bf"
7
8ARM_INSTRUCTION_SET = "arm"
9
10DEFAULT_PREFERENCE = "-1"
11
12DEPENDS = "python-numpy libtool swig swig-native python bzip2 zlib glib-2.0"
13
14SRCREV_opencv = "424c2bddb39dae97dc4639a24eaa0e0c8fbb8e69"
15SRCREV_contrib = "844c30e8b2f2f4b34b96a169fafe9beea3c45e87"
16SRCREV_FORMAT = "opencv"
17SRC_URI = "git://github.com/Itseez/opencv.git;name=opencv \
18 git://github.com/Itseez/opencv_contrib.git;destsuffix=contrib;name=contrib"
19
20PV = "3.0+git${SRCPV}"
21
22S = "${WORKDIR}/git"
23
24EXTRA_OECMAKE = "-DPYTHON2_NUMPY_INCLUDE_DIRS:PATH=${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/numpy/core/include \
25 -DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \
26 -DWITH_1394=OFF \
27 -DCMAKE_SKIP_RPATH=ON \
28 ${@bb.utils.contains("TARGET_CC_ARCH", "-msse3", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1", "", d)} \
29 ${@base_conditional("libdir", "/usr/lib64", "-DLIB_SUFFIX=64", "", d)} \
30 ${@base_conditional("libdir", "/usr/lib32", "-DLIB_SUFFIX=32", "", d)} \
31"
32
33PACKAGECONFIG ??= "eigen jpeg png tiff v4l libv4l gstreamer samples tbb \
34 ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk", "", d)} \
35 ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "libav", "", d)}"
36PACKAGECONFIG[eigen] = "-DWITH_EIGEN=ON,-DWITH_EIGEN=OFF,libeigen,"
37PACKAGECONFIG[gtk] = "-DWITH_GTK=ON,-DWITH_GTK=OFF,gtk+3,"
38PACKAGECONFIG[jpeg] = "-DWITH_JPEG=ON,-DWITH_JPEG=OFF,jpeg,"
39PACKAGECONFIG[libav] = "-DWITH_FFMPEG=ON,-DWITH_FFMPEG=OFF,libav,"
40PACKAGECONFIG[png] = "-DWITH_PNG=ON,-DWITH_PNG=OFF,libpng,"
41PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff,"
42PACKAGECONFIG[v4l] = "-DWITH_V4L=ON,-DWITH_V4L=OFF,v4l-utils,"
43PACKAGECONFIG[libv4l] = "-DWITH_LIBV4L=ON,-DWITH_LIBV4L=OFF,v4l-utils,"
44PACKAGECONFIG[jasper] = "-DWITH_JASPER=ON,-DWITH_JASPER=OFF,jasper,"
45PACKAGECONFIG[amdblas] = "-DWITH_OPENCLAMDBLAS=ON,-DWITH_OPENCLAMDBLAS=OFF,libclamdblas,"
46PACKAGECONFIG[amdfft] = "-DWITH_OPENCLAMDFFT=ON,-DWITH_OPENCLAMDFFT=OFF,libclamdfft,"
47PACKAGECONFIG[opencl] = "-DWITH_OPENCL=ON,-DWITH_OPENCL=OFF,opencl-headers,"
48PACKAGECONFIG[gstreamer] = "-DWITH_GSTREAMER=ON,-DWITH_GSTREAMER=OFF,gstreamer1.0 gstreamer1.0-plugins-base,"
49PACKAGECONFIG[oracle-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 oracle-jse-jdk oracle-jse-jdk-native,"
50PACKAGECONFIG[samples] = "-DBUILD_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON,-DBUILD_EXAMPLES=OFF,,"
51PACKAGECONFIG[tbb] = "-DWITH_TBB=ON,-DWITH_TBB=OFF,tbb,"
52
53inherit distutils-base pkgconfig cmake
54
55export BUILD_SYS
56export HOST_SYS
57export PYTHON_CSPEC="-I${STAGING_INCDIR}/${PYTHON_DIR}"
58export PYTHON="${STAGING_BINDIR_NATIVE}/python"
59export JAVA_HOME="${STAGING_DIR_NATIVE}/usr/bin/java"
60export ANT_DIR="${STAGING_DIR_NATIVE}/usr/share/ant/"
61
62TARGET_CC_ARCH += "-I${S}/include "
63
64PACKAGES += "${PN}-java-dbg ${PN}-java ${PN}-samples-dbg ${PN}-samples ${PN}-apps python-opencv"
65
66python populate_packages_prepend () {
67 cv_libdir = d.expand('${libdir}')
68 cv_libdir_dbg = d.expand('${libdir}/.debug')
69 do_split_packages(d, cv_libdir, '^lib(.*)\.so$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev', allow_links=True)
70 do_split_packages(d, cv_libdir, '^lib(.*)\.la$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
71 do_split_packages(d, cv_libdir, '^lib(.*)\.a$', 'lib%s-dev', 'OpenCV %s development package', extra_depends='${PN}-dev')
72 do_split_packages(d, cv_libdir, '^lib(.*)\.so\.*', 'lib%s', 'OpenCV %s library', extra_depends='', allow_links=True)
73
74 pn = d.getVar('PN', 1)
75 metapkg = pn + '-dev'
76 d.setVar('ALLOW_EMPTY_' + metapkg, "1")
77 blacklist = [ metapkg ]
78 metapkg_rdepends = [ ]
79 packages = d.getVar('PACKAGES', 1).split()
80 for pkg in packages[1:]:
81 if not pkg in blacklist and not pkg in metapkg_rdepends and pkg.endswith('-dev'):
82 metapkg_rdepends.append(pkg)
83 d.setVar('RRECOMMENDS_' + metapkg, ' '.join(metapkg_rdepends))
84
85 blacklist = [ metapkg ]
86 metapkg = pn
87 metapkg_rdepends = [ ]
88 for pkg in packages[1:]:
89 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') :
90 metapkg_rdepends.append(pkg)
91 bb.data.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends), d)
92
93}
94
95PACKAGES_DYNAMIC += "^libopencv-.*"
96
97FILES_${PN} = ""
98FILES_${PN}-apps = "${bindir}/* ${datadir}/OpenCV"
99FILES_${PN}-dbg += "${libdir}/.debug"
100FILES_${PN}-dev = "${includedir} ${libdir}/pkgconfig"
101FILES_${PN}-doc = "${datadir}/OpenCV/doc"
102FILES_${PN}-java = "${datadir}/OpenCV/java"
103FILES_${PN}-java-dbg = "${datadir}/OpenCV/java/.debug/"
104FILES_${PN}-samples = "${datadir}/OpenCV/samples/"
105FILES_${PN}-samples-dbg = "${datadir}/OpenCV/samples/bin/.debug"
106
107INSANE_SKIP_${PN}-apps = "staticdev"
108INSANE_SKIP_${PN}-java = "libdir"
109INSANE_SKIP_${PN}-java-dbg = "libdir"
110
111ALLOW_EMPTY_${PN} = "1"
112
113SUMMARY_python-opencv = "Python bindings to opencv"
114FILES_python-opencv = "${PYTHON_SITEPACKAGES_DIR}/*"
115RDEPENDS_python-opencv = "python-core python-numpy"
116
117do_install_append() {
118 cp ${S}/include/opencv/*.h ${D}${includedir}/opencv/
119 sed -i '/blobtrack/d' ${D}${includedir}/opencv/cvaux.h
120
121 # Move Python files into correct library folder (for multilib build)
122 if [ "$libdir" != "/usr/lib" ]; then
123 mv ${D}/usr/lib/* ${D}/${libdir}/
124 rm -rf ${D}/usr/lib
125 fi
126
127 install -d ${D}${datadir}/OpenCV/samples/bin/
128 cp -f bin/*-tutorial-* bin/*-example-* ${D}${datadir}/OpenCV/samples/bin/
129}