From 394f09e5e393bd333543e0d03417772376337ad9 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Sun, 24 Sep 2017 17:17:44 +0200 Subject: opencv: concatenate and unify patches --- src/opencv-1-fixes.patch | 110 ++++++++++++++++++++++++++++++++++---- src/opencv-2-fixes-cmake.patch | 64 ---------------------- src/opencv-3-fix-in-bad-dir.patch | 39 -------------- 3 files changed, 100 insertions(+), 113 deletions(-) delete mode 100644 src/opencv-2-fixes-cmake.patch delete mode 100644 src/opencv-3-fix-in-bad-dir.patch diff --git a/src/opencv-1-fixes.patch b/src/opencv-1-fixes.patch index 37b08e2..45bce44 100644 --- a/src/opencv-1-fixes.patch +++ b/src/opencv-1-fixes.patch @@ -5,33 +5,26 @@ Contains ad hoc patches for cross building. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Gregorio Litenstein Date: Thu, 31 Aug 2017 18:27:53 -0300 -Subject: [PATCH] Update patch-1 for opencv-3.3.0 +Subject: [PATCH] patch-1 for opencv-3.3.0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 1111111..2222222 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -36,7 +36,7 @@ if(NOT DEFINED CMAKE_INSTALL_PREFIX) +@@ -36,7 +36,6 @@ if(NOT DEFINED CMAKE_INSTALL_PREFIX) if(NOT CMAKE_TOOLCHAIN_FILE) # it _must_ go before project(OpenCV) in order to work if(WIN32) - set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory") -+ #set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory") else() set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation Directory") endif() - -diff --git a/CMakeLists.txt.orig b/CMakeLists.txt -index 1b6b95e5..15d86af2 100644 ---- a/CMakeLists.txt.orig -+++ b/CMakeLists.txt -@@ -44,7 +44,7 @@ if(NOT DEFINED CMAKE_INSTALL_PREFIX) +@@ -44,7 +43,6 @@ if(NOT DEFINED CMAKE_INSTALL_PREFIX) #Android: set output folder to ${CMAKE_BINARY_DIR} set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_BINARY_DIR} CACHE PATH "root for library output, set this to change where android libs are compiled to" ) # any crosscompiling - set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory") -+ #set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory") endif(NOT CMAKE_TOOLCHAIN_FILE) endif() @@ -141,3 +134,100 @@ index 1111111..2222222 100644 if(UNIX) #these variables are set by CHECK_MODULE macro foreach(P ${VIDEOIO_INCLUDE_DIRS}) + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Gregorio Litenstein +Date: Thu, 31 Aug 2017 18:32:39 -0300 +Subject: [PATCH] patch 2 for opencv-3.3.0 + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1111111..2222222 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -358,14 +358,7 @@ else() + ocv_update(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc) + endif() + +-if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows) +- if(DEFINED OpenCV_RUNTIME AND DEFINED OpenCV_ARCH) +- ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "${OpenCV_ARCH}/${OpenCV_RUNTIME}/") +- else() +- message(STATUS "Can't detect runtime and/or arch") +- ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "") +- endif() +-elseif(ANDROID) ++if(ANDROID) + ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "sdk/native/") + else() + ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "") +@@ -413,12 +406,8 @@ else() + ocv_update(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}") + + if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows) +- if(OpenCV_STATIC) +- ocv_update(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}") +- else() +- ocv_update(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}") +- endif() +- ocv_update(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}") ++ ocv_update(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}") ++ ocv_update(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}") + ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native) + ocv_update(OPENCV_JAR_INSTALL_PATH java) + ocv_update(OPENCV_OTHER_INSTALL_PATH etc) +@@ -462,15 +451,9 @@ if(INSTALL_TO_MANGLED_PATHS) + endif() + + +-if(WIN32) +- # Postfix of DLLs: +- set(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}") +- set(OPENCV_DEBUG_POSTFIX d) +-else() +- # Postfix of so's: +- set(OPENCV_DLLVERSION "") +- set(OPENCV_DEBUG_POSTFIX "") +-endif() ++# Postfix of so's and DLLs: ++set(OPENCV_DLLVERSION "") ++set(OPENCV_DEBUG_POSTFIX "") + + if(DEFINED CMAKE_DEBUG_POSTFIX) + set(OPENCV_DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}") + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Gregorio Litenstein +Date: Thu, 31 Aug 2017 18:35:23 -0300 +Subject: [PATCH] patch-3 for opencv-3.3.0 + +Originally From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Boris Nagaev +Date: Sun, 20 Dec 2015 18:14:56 +0300 +Subject: [PATCH] fix CMake error if a directory contains ++ + +See https://github.com/mxe/mxe/issues/1091 + +diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake +index 1111111..2222222 100644 +--- a/cmake/OpenCVModule.cmake ++++ b/cmake/OpenCVModule.cmake +@@ -491,12 +491,16 @@ function(__ocv_resolve_dependencies) + # process private deps + foreach(m ${OPENCV_MODULES_BUILD}) + foreach(d ${OPENCV_MODULE_${m}_PRIVATE_REQ_DEPS}) +- if(NOT (";${deps_${m}};" MATCHES ";${d};")) ++ # can't use MATCH because file paths can include regexp special chars ++ string(FIND ";${deps_${m}};" ";${d};" d_offset) ++ if(${d_offset} EQUAL -1) + list(APPEND deps_${m} ${d}) + endif() + endforeach() + foreach(d ${OPENCV_MODULE_${m}_PRIVATE_OPT_DEPS}) +- if(NOT (";${deps_${m}};" MATCHES ";${d};")) ++ # can't use MATCH because file paths can include regexp special chars ++ string(FIND ";${deps_${m}};" ";${d};" d_offset) ++ if(${d_offset} EQUAL -1) + if(HAVE_${d} OR TARGET ${d}) + list(APPEND deps_${m} ${d}) + endif() diff --git a/src/opencv-2-fixes-cmake.patch b/src/opencv-2-fixes-cmake.patch deleted file mode 100644 index 2b07b8c..0000000 --- a/src/opencv-2-fixes-cmake.patch +++ /dev/null @@ -1,64 +0,0 @@ -This file is part of MXE. See LICENSE.md for licensing information. - -Contains ad hoc patches for cross building. - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Gregorio Litenstein -Date: Thu, 31 Aug 2017 18:32:39 -0300 -Subject: [PATCH] Update patch 2 for opencv-3.3.0 - - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1111111..2222222 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -360,14 +360,7 @@ else() - ocv_update(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc) - endif() - --if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows) -- if(DEFINED OpenCV_RUNTIME AND DEFINED OpenCV_ARCH) -- ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "${OpenCV_ARCH}/${OpenCV_RUNTIME}/") -- else() -- message(STATUS "Can't detect runtime and/or arch") -- ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "") -- endif() --elseif(ANDROID) -+if(ANDROID) - ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "sdk/native/") - else() - ocv_update(OpenCV_INSTALL_BINARIES_PREFIX "") -@@ -415,12 +408,8 @@ else() - ocv_update(3P_LIBRARY_OUTPUT_PATH "${OpenCV_BINARY_DIR}/3rdparty/lib${LIB_SUFFIX}") - - if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows) -- if(OpenCV_STATIC) -- ocv_update(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}") -- else() -- ocv_update(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}") -- endif() -- ocv_update(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib${LIB_SUFFIX}") -+ ocv_update(OPENCV_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}") -+ ocv_update(OPENCV_3P_LIB_INSTALL_PATH "${OpenCV_INSTALL_BINARIES_PREFIX}lib${LIB_SUFFIX}") - ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH samples/native) - ocv_update(OPENCV_JAR_INSTALL_PATH java) - ocv_update(OPENCV_OTHER_INSTALL_PATH etc) -@@ -464,15 +453,9 @@ if(INSTALL_TO_MANGLED_PATHS) - endif() - - --if(WIN32) -- # Postfix of DLLs: -- set(OPENCV_DLLVERSION "${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}") -- set(OPENCV_DEBUG_POSTFIX d) --else() -- # Postfix of so's: -- set(OPENCV_DLLVERSION "") -- set(OPENCV_DEBUG_POSTFIX "") --endif() -+# Postfix of so's and DLLs: -+set(OPENCV_DLLVERSION "") -+set(OPENCV_DEBUG_POSTFIX "") - - if(DEFINED CMAKE_DEBUG_POSTFIX) - set(OPENCV_DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}") diff --git a/src/opencv-3-fix-in-bad-dir.patch b/src/opencv-3-fix-in-bad-dir.patch deleted file mode 100644 index 794c8e6..0000000 --- a/src/opencv-3-fix-in-bad-dir.patch +++ /dev/null @@ -1,39 +0,0 @@ -This file is part of MXE. See LICENSE.md for licensing information. - -Contains ad hoc patches for cross building. - -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Gregorio Litenstein -Date: Thu, 31 Aug 2017 18:35:23 -0300 -Subject: [PATCH] Update patch-3 for opencv-3.3.0 - -Originally From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Boris Nagaev -Date: Sun, 20 Dec 2015 18:14:56 +0300 -Subject: [PATCH] fix CMake error if a directory contains ++ - -See https://github.com/mxe/mxe/issues/1091 - -diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake -index 1111111..2222222 100644 ---- a/cmake/OpenCVModule.cmake -+++ b/cmake/OpenCVModule.cmake -@@ -491,12 +491,16 @@ function(__ocv_resolve_dependencies) - # process private deps - foreach(m ${OPENCV_MODULES_BUILD}) - foreach(d ${OPENCV_MODULE_${m}_PRIVATE_REQ_DEPS}) -- if(NOT (";${deps_${m}};" MATCHES ";${d};")) -+ # can't use MATCH because file paths can include regexp special chars -+ string(FIND ";${deps_${m}};" ";${d};" d_offset) -+ if(${d_offset} EQUAL -1) - list(APPEND deps_${m} ${d}) - endif() - endforeach() - foreach(d ${OPENCV_MODULE_${m}_PRIVATE_OPT_DEPS}) -- if(NOT (";${deps_${m}};" MATCHES ";${d};")) -+ # can't use MATCH because file paths can include regexp special chars -+ string(FIND ";${deps_${m}};" ";${d};" d_offset) -+ if(${d_offset} EQUAL -1) - if(HAVE_${d} OR TARGET ${d}) - list(APPEND deps_${m} ${d}) - endif() -- cgit v0.12