diff options
Diffstat (limited to 'recipes-support/opencv/opencv/download.patch')
-rw-r--r-- | recipes-support/opencv/opencv/download.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/recipes-support/opencv/opencv/download.patch b/recipes-support/opencv/opencv/download.patch new file mode 100644 index 00000000..33ac4831 --- /dev/null +++ b/recipes-support/opencv/opencv/download.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From b18a280fab06a680d9f831bf8b462647f3cb6214 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ross Burton <ross.burton@intel.com> | ||
3 | Date: Thu, 9 Jan 2020 16:24:24 +0000 | ||
4 | Subject: [PATCH] opencv: abort configure if we need to download | ||
5 | |||
6 | This CMake module will download files during do_configure. This is bad as it | ||
7 | means we can't do offline builds. | ||
8 | |||
9 | Add an option to disallow downloads by emitting a fatal error. | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
13 | |||
14 | --- | ||
15 | cmake/OpenCVDownload.cmake | 6 ++++++ | ||
16 | 1 file changed, 6 insertions(+) | ||
17 | |||
18 | diff --git a/cmake/OpenCVDownload.cmake b/cmake/OpenCVDownload.cmake | ||
19 | index 63cf6d3238..4acf477f70 100644 | ||
20 | --- a/cmake/OpenCVDownload.cmake | ||
21 | +++ b/cmake/OpenCVDownload.cmake | ||
22 | @@ -14,6 +14,7 @@ | ||
23 | # RELATIVE_URL - if set, then URL is treated as a base, and FILENAME will be appended to it | ||
24 | # Note: uses OPENCV_DOWNLOAD_PATH folder as cache, default is <opencv>/.cache | ||
25 | |||
26 | +set(OPENCV_ALLOW_DOWNLOADS ON CACHE BOOL "Allow downloads") | ||
27 | set(HELP_OPENCV_DOWNLOAD_PATH "Cache directory for downloaded files") | ||
28 | if(DEFINED ENV{OPENCV_DOWNLOAD_PATH}) | ||
29 | set(OPENCV_DOWNLOAD_PATH "$ENV{OPENCV_DOWNLOAD_PATH}" CACHE PATH "${HELP_OPENCV_DOWNLOAD_PATH}") | ||
30 | @@ -156,6 +157,11 @@ function(ocv_download) | ||
31 | |||
32 | # Download | ||
33 | if(NOT EXISTS "${CACHE_CANDIDATE}") | ||
34 | + if(NOT OPENCV_ALLOW_DOWNLOADS) | ||
35 | + message(FATAL_ERROR "Not going to download ${DL_FILENAME}") | ||
36 | + return() | ||
37 | + endif() | ||
38 | + | ||
39 | ocv_download_log("#cmake_download \"${CACHE_CANDIDATE}\" \"${DL_URL}\"") | ||
40 | foreach(try ${OPENCV_DOWNLOAD_TRIES_LIST}) | ||
41 | ocv_download_log("#try ${try}") | ||