mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-07-16 04:17:25 +00:00
opencv: don't download during configure
OpenCV downloads data files during the CMake configure phase, which
is bad because fetching should only happen in do_fetch (and if proxies
are needed, won't be set in do_configure).
The recipe attempts to solve this already by having the repositories in
SRC_URI and moving the files to the correct place before do_configure().
However they are written to ${B} which is then wiped in do_configure so
they're not used.
The OpenCV download logic has a download cache with specially formatted
filenames, so take the downloaded files and populate the cache.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
This commit is contained in:
committed by
Armin Kuster
parent
a90c217a79
commit
18933cb8d8
@@ -51,10 +51,28 @@ PV = "4.1.0"
|
|||||||
|
|
||||||
S = "${WORKDIR}/git"
|
S = "${WORKDIR}/git"
|
||||||
|
|
||||||
|
# OpenCV wants to download more files during configure. We download these in
|
||||||
|
# do_fetch and construct a source cache in the format it expects
|
||||||
|
OPENCV_DLDIR = "${WORKDIR}/downloads"
|
||||||
|
|
||||||
do_unpack_extra() {
|
do_unpack_extra() {
|
||||||
tar xzf ${WORKDIR}/ipp/ippicv/${IPP_FILENAME} -C ${WORKDIR}
|
tar xzf ${WORKDIR}/ipp/ippicv/${IPP_FILENAME} -C ${WORKDIR}
|
||||||
cp ${WORKDIR}/vgg/*.i ${WORKDIR}/contrib/modules/xfeatures2d/src
|
|
||||||
cp ${WORKDIR}/boostdesc/*.i ${WORKDIR}/contrib/modules/xfeatures2d/src
|
md5() {
|
||||||
|
# Return the MD5 of $1
|
||||||
|
echo $(md5sum $1 | cut -d' ' -f1)
|
||||||
|
}
|
||||||
|
cache() {
|
||||||
|
TAG=$1
|
||||||
|
shift
|
||||||
|
mkdir --parents ${OPENCV_DLDIR}/$TAG
|
||||||
|
for F in $*; do
|
||||||
|
DEST=${OPENCV_DLDIR}/$TAG/$(md5 $F)-$(basename $F)
|
||||||
|
test -e $DEST || ln -s $F $DEST
|
||||||
|
done
|
||||||
|
}
|
||||||
|
cache xfeatures2d/boostdesc ${WORKDIR}/boostdesc/*.i
|
||||||
|
cache xfeatures2d/vgg ${WORKDIR}/vgg/*.i
|
||||||
}
|
}
|
||||||
addtask unpack_extra after do_unpack before do_patch
|
addtask unpack_extra after do_unpack before do_patch
|
||||||
|
|
||||||
@@ -65,6 +83,7 @@ EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \
|
|||||||
-DOPENCV_ICV_HASH=${IPP_MD5} \
|
-DOPENCV_ICV_HASH=${IPP_MD5} \
|
||||||
-DIPPROOT=${WORKDIR}/ippicv_lnx \
|
-DIPPROOT=${WORKDIR}/ippicv_lnx \
|
||||||
-DOPENCV_GENERATE_PKGCONFIG=ON \
|
-DOPENCV_GENERATE_PKGCONFIG=ON \
|
||||||
|
-DOPENCV_DOWNLOAD_PATH=${OPENCV_DLDIR} \
|
||||||
${@bb.utils.contains("TARGET_CC_ARCH", "-msse3", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1", "", d)} \
|
${@bb.utils.contains("TARGET_CC_ARCH", "-msse3", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1", "", d)} \
|
||||||
${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.1", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1", "", d)} \
|
${@bb.utils.contains("TARGET_CC_ARCH", "-msse4.1", "-DENABLE_SSE=1 -DENABLE_SSE2=1 -DENABLE_SSE3=1 -DENABLE_SSSE3=1 -DENABLE_SSE41=1", "", d)} \
|
||||||
${@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)} \
|
${@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)} \
|
||||||
|
|||||||
Reference in New Issue
Block a user