From patchwork Thu Jan 9 16:24:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 182780 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp3385301och; Sun, 12 Jan 2020 09:29:23 -0800 (PST) X-Google-Smtp-Source: APXvYqxvzM5xe8dJrJVBmiwUzjTwKpdY8xd80Q5+UY2pwelRy6OKXfBYMzt8W4wff/Jj29b9XtxX X-Received: by 2002:a65:6842:: with SMTP id q2mr17124300pgt.345.1578848556432; Sun, 12 Jan 2020 09:02:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578848556; cv=none; d=google.com; s=arc-20160816; b=y01dsq61+xkL932Myr67DHgXUo2YLnbKBUb55psIP6BQ+UaiH8QXOEn724xEzUONW2 Ou8nCv6MLhyo+yWpx9EmOzjnhq+OXbtyfyGkoOOlBM79zTbcVtu29FDHFvRrP6XTGPjZ 8sMWCFqrtFLlsObgY9wzFhHYPyqjpb6pvR1Zky80aJctrPlLtcUuyPMpRwh2jABaaBN3 YS6tE9ZEOUH3ZxuTFWXxTBcMU4q7mBAsfIVuFwZFtlqoV+b3TFRv03c9kAODJsnqQOrm P4z5d006t1M1oEg99Fa+4ZHHQgJ+M5JGW6YztQKo+yOxaSsVFXc4wLyHrCufxUV0pn0d Gf/A== 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=tvXg208Gk5qMwxgQQwf+AnjHA8Ld/e9dLgU1CtgFk44=; b=duOlYZaMcTr535td+pUO9RkXRuB4vEmH+sC6D4JXgSKzuCwnjelqofg4LawuqvqulK wMg2cClYI1WKhbsJ8JRkrXVWL9fijb9noF3dwXCibzzOJ7AhEhbNfNFxqu5dBJm2F2Gu ceJRL3rRMqGvMWAvDSZeAdDGSW96dQsJjqR2rGAHRORxvRm5uwsbzupMkHLGbMiCBYkr boOT2smM/taj/f/MbUW4iJKrL/SFTomG9ezeccyCcKrQezHIQUrhDf1AqmrsrUvcRnGs Xk099nR3hrlQ+VQyxH3ldDF3MobEUYGkzxiDBFQpOhrcWkFI4L4e4khvgP9O4Z5qP0jU Y84A== 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=abDcJdu+; 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 a21si8754373plm.288.2020.01.12.09.02.36 for ; Sun, 12 Jan 2020 09:02: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=abDcJdu+; 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 728A07FEFA; Thu, 9 Jan 2020 16:24:31 +0000 (UTC) X-Original-To: openembedded-devel@lists.openembedded.org Delivered-To: openembedded-devel@lists.openembedded.org Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mail.openembedded.org (Postfix) with ESMTP id 41D617FEF3 for ; Thu, 9 Jan 2020 16:24:29 +0000 (UTC) Received: by mail-wr1-f48.google.com with SMTP id c9so8029321wrw.8 for ; Thu, 09 Jan 2020 08:24:30 -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=CUMzc9PdnQnbwpEtrtJZoIcfUr6JKbEeHIP8pyGVG+c=; b=abDcJdu+WT+HX3Zag+e1McmtXWQ0//Zc37OOh3E9FGewCVS8jn97lJQK7ltoLfm/a8 5bWDDoFeORQfx/KT15Cx/vVeT7X+HW6ayEhzczwpvYVOAciXix6eYHHV+2IdqrYfXdEb FYuvi9hln/ByVA2D99Fh+DF4w3gUR3/iyuCfRzvR6sIr9vhVBznm3eQEbSg5eDMYvxqI TwCBNm5yMX0d8h7wz02Wa9wOCrMUolAE/971+KJabdaNXKiQeI1Y/ZUQT/TO2lTiIzxP ydxfdLZoztkAaqJWTepayEON8WfkRRRhh2klIjnyOyd43ZecMzZqaIY+ZaRfdr8tAVi4 JU9A== 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=CUMzc9PdnQnbwpEtrtJZoIcfUr6JKbEeHIP8pyGVG+c=; b=cS63OHnGUZsB//sR4cqZdoCi7kzYBH5cW+SHmlpFSTzKb9N8XahSxU6NGHuHI1wtzT cPKIxLwtIsuqdZtdwIW+77KliXXl0KqqYOki8lCy1kdUV32WcF47K9DCLZ3LstGMOTMo tHrIcOhs/G9GmJvfxtUwF+fgm3Z9Wgi4V9b1aDCNz6tevgpT4lAjH2qWUYRveNYRFtVi UAf2vQn/zG72eATJb/sGjAXzCRUtEx47X1q7Ok6LRRq92oGR1ok+3UR3ewsP4AdIytME KEJr8B9+76vbzO8Zj9eQG4BRCLYrDBxyeEYFG6t9DCMc/Q0ZN/uZJe1m2ZETnaH6bmIM LOng== X-Gm-Message-State: APjAAAV+83TrdnMoCIGwvuP7i77KdS3mEh/ZeT7TKf4x5WV+RJdu+zuP 73bT8uVffimJMVlCBa7xvQRpM8MDcZM= X-Received: by 2002:adf:f80b:: with SMTP id s11mr11191347wrp.12.1578587069633; Thu, 09 Jan 2020 08:24:29 -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 x14sm3329872wmj.42.2020.01.09.08.24.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2020 08:24:29 -0800 (PST) From: Ross Burton To: openembedded-devel@lists.openembedded.org Date: Thu, 9 Jan 2020 16:24:24 +0000 Message-Id: <20200109162424.22107-1-ross.burton@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [oe] [PATCH v2] opencv: abort configure if we need to download 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's habit of downloading files during do_configure is bad form (as it becomes impossible to do offline builds), so add an option to error out if a download would be needed. Signed-off-by: Ross Burton --- .../opencv/opencv/download.patch | 32 +++++++++++++++++++ .../recipes-support/opencv/opencv_4.1.0.bb | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 meta-oe/recipes-support/opencv/opencv/download.patch -- 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/download.patch b/meta-oe/recipes-support/opencv/opencv/download.patch new file mode 100644 index 0000000000..fa8db88078 --- /dev/null +++ b/meta-oe/recipes-support/opencv/opencv/download.patch @@ -0,0 +1,32 @@ +This CMake module will download files during do_configure. This is bad as it +means we can't do offline builds. + +Add an option to disallow downloads by emitting a fatal error. + +Upstream-Status: Pending +Signed-off-by: Ross Burton + +diff --git a/cmake/OpenCVDownload.cmake b/cmake/OpenCVDownload.cmake +index cdc47ad2cb..74573f45a2 100644 +--- a/cmake/OpenCVDownload.cmake ++++ b/cmake/OpenCVDownload.cmake +@@ -14,6 +14,7 @@ + # RELATIVE_URL - if set, then URL is treated as a base, and FILENAME will be appended to it + # Note: uses OPENCV_DOWNLOAD_PATH folder as cache, default is /.cache + ++set(OPENCV_ALLOW_DOWNLOADS ON CACHE BOOL "Allow downloads") + set(HELP_OPENCV_DOWNLOAD_PATH "Cache directory for downloaded files") + if(DEFINED ENV{OPENCV_DOWNLOAD_PATH}) + set(OPENCV_DOWNLOAD_PATH "$ENV{OPENCV_DOWNLOAD_PATH}" CACHE PATH "${HELP_OPENCV_DOWNLOAD_PATH}") +@@ -153,6 +154,11 @@ function(ocv_download) + + # Download + if(NOT EXISTS "${CACHE_CANDIDATE}") ++ if(NOT OPENCV_ALLOW_DOWNLOADS) ++ message(FATAL_ERROR "Not going to download ${DL_FILENAME}") ++ return() ++ endif() ++ + ocv_download_log("#cmake_download \"${CACHE_CANDIDATE}\" \"${DL_URL}\"") + file(DOWNLOAD "${DL_URL}" "${CACHE_CANDIDATE}" + INACTIVITY_TIMEOUT 60 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 03e4f58dca..f679ccb05f 100644 --- a/meta-oe/recipes-support/opencv/opencv_4.1.0.bb +++ b/meta-oe/recipes-support/opencv/opencv_4.1.0.bb @@ -48,6 +48,7 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \ file://0003-To-fix-errors-as-following.patch \ file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \ file://0001-Dont-use-isystem.patch \ + file://download.patch \ " PV = "4.1.0" @@ -87,6 +88,7 @@ EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${WORKDIR}/contrib/modules \ -DIPPROOT=${WORKDIR}/ippicv_lnx \ -DOPENCV_GENERATE_PKGCONFIG=ON \ -DOPENCV_DOWNLOAD_PATH=${OPENCV_DLDIR} \ + -DOPENCV_ALLOW_DOWNLOADS=OFF \ ${@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)} \