From patchwork Thu Jan 9 16:21:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 182761 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp3329835och; Sun, 12 Jan 2020 08:19:25 -0800 (PST) X-Google-Smtp-Source: APXvYqzYwjtIalTvIMWyDURNoJjc/ZJYpNWfqWst7BHd2eTT0uKqgvwBE75c0vuZbNV+3QBj7HTJ X-Received: by 2002:a63:a43:: with SMTP id z3mr16644840pgk.232.1578845856978; Sun, 12 Jan 2020 08:17:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578845856; cv=none; d=google.com; s=arc-20160816; b=w3gY9xPg4tF3g254tVMq3SUuKJMvgm/kLucFp4+2B4m5kU35t3M9tLxhCr6xX0QWHc AqG4c5TUCkl4rBB5RB+ZiLec5dqsm6M131+vGBENoWNyE+TjcQxdP6Gbn4KbDYl3OIiX y9pgC4oiDk5EBG48NZcHsqB655MIhW4QiIX8lzr7H96LAN2FoLb+lDB8BHQn7Hw1DKtw WGCUEINZa49IyBvrpy5biw3Ie7FPXMt/+AbGcXNC+/PI083ABU70oMHwHjVEM27z6OKP qQJjniW77yc+tZCN4PVmQn6bCaSV/8C+ufgEgb5Rg/PLyJrJue79y9hJbD8VdVn3EX+I Lk+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=n67iuNMfl34GTYmlVUWb9A2OAwgLh73g20eLcv+iiKE=; b=XkhlOJgZa0uP8PRPlFXVxeDt6PFqciYV5hTHHKG+sbN0aa7WK2oeN64xgX/IHnfWed XKrVZMr2bTGTgrqDd2NZO65GE2p2S9fmpROsUpWei5aZqb80U+2DFvtcI9xjedgvAHFf H1+IapoJVKSf2xcga7groWFUvjqrXhOzp24Vo8uEhod2MMrr3Ub7l/NKjj3+6HAsSuYs yDydK7hR8Y2RUh6tY1Sxnn2mLzAlGAWsIPNJTJ1YXygSXvtcpRG7+DZRXXfMC2qsLXkU fwDCS7d54P/v/0EtRlUd/WMVDK88Bv9myVpo/HYmD8my1w8kS6OuDcda4oP14/x25c/u E71A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=PDx7vWMz; spf=pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-devel-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id x190si9380553pfd.228.2020.01.12.08.17.36 for ; Sun, 12 Jan 2020 08:17:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=PDx7vWMz; spf=pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-devel-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 5CE017FEF9; Thu, 9 Jan 2020 16:21:50 +0000 (UTC) X-Original-To: openembedded-devel@lists.openembedded.org Delivered-To: openembedded-devel@lists.openembedded.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mail.openembedded.org (Postfix) with ESMTP id 407447FE07 for ; Thu, 9 Jan 2020 16:21:48 +0000 (UTC) Received: by mail-wr1-f65.google.com with SMTP id y11so8034768wrt.6 for ; Thu, 09 Jan 2020 08:21:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Z8j3pEzUjWAIMG4BjPYjuVC247I05KtSNrA8sltuMDQ=; b=PDx7vWMztCKUvooD3/mj5Btlp5qVVsJ0pZho+jdwk9H8Ypj9qyDR1P2UBWhhEhcChs n5Ve2dif3c6xRm1qj5Xl+uMnkceKOnBcosuesNCz9SZlNc1qoBVmbVAi2JtSuqw64TJr 2jBwFUKpMvXrL9x+AZz8k1efeaATQaknSbUO3A/AJSieAjH4SbiOeyAxQN94f09OqtX6 JSScGVkdH9xqSau+iFN7ci0neQUTBYzBkB3b06oyqENRZy3sOcyEE+BC2J34Ff4G0JPD vU5zPHNnn+5Q4HckAaOXCC27VOL34/HCFd7ee/qxNBPo2jycHDHVjvfMzGd+GUl3ErHP N6LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=Z8j3pEzUjWAIMG4BjPYjuVC247I05KtSNrA8sltuMDQ=; b=tLybvga1F4cOqWMAL733WosEQq2OhFvUQwSAjU+2O+DQX7cktNjEQbBJRlbxdIV0Kv EZ9A0zFlVzBkClyLS+f3RycQHxUFJMCPjpXrHMsdllf6jWVtj/9ozJsJ3Srvys7GXkTY f8y8jyhTVwYexoZaV+vNYUn8mkIUMWeQDUGaMn4OR+twlGYO54gq5NAXMaTaWvXY5FIZ PKMB5dxtWXOl5M41SedJezQclRNrVs2rH31HUuE9mVqReGHOWzZY+NOMH2gEp18YSmu6 zLjC4/hsJXsdP0wdoLwPFIel2qfeTvyFRFjd2oOksl3TfB5rhu9EUq6EMj2zr1z8olVf P15w== X-Gm-Message-State: APjAAAXZbXTA8DEbbvy+PYWREtyk7+gOUT9kAGkrbH1hwOl3BHUgFBNA zGUgaa38QUu7sALdJTUv0yNaK70cCKw= X-Received: by 2002:a5d:410e:: with SMTP id l14mr11411406wrp.238.1578586908467; Thu, 09 Jan 2020 08:21:48 -0800 (PST) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id d14sm8655010wru.9.2020.01.09.08.21.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2020 08:21:47 -0800 (PST) From: Ross Burton To: openembedded-devel@lists.openembedded.org Date: Thu, 9 Jan 2020 16:21:38 +0000 Message-Id: <20200109162141.20579-1-ross.burton@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [oe] [PATCH 1/4] opencv: don't download during configure X-BeenThere: openembedded-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Using the OpenEmbedded metadata to build Distributions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-devel-bounces@lists.openembedded.org Errors-To: openembedded-devel-bounces@lists.openembedded.org 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 --- .../recipes-support/opencv/opencv_4.1.0.bb | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) -- 2.20.1 -- _______________________________________________ Openembedded-devel mailing list Openembedded-devel@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-devel diff --git a/meta-oe/recipes-support/opencv/opencv_4.1.0.bb b/meta-oe/recipes-support/opencv/opencv_4.1.0.bb index 5e89db0977..cfc7854e1d 100644 --- a/meta-oe/recipes-support/opencv/opencv_4.1.0.bb +++ b/meta-oe/recipes-support/opencv/opencv_4.1.0.bb @@ -51,10 +51,28 @@ PV = "4.1.0" 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() { 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 @@ -65,6 +83,7 @@ EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \ -DOPENCV_ICV_HASH=${IPP_MD5} \ -DIPPROOT=${WORKDIR}/ippicv_lnx \ -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", "-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)} \