From 59bb2f15d317d6c73b9744323436400b6ebb9268 Mon Sep 17 00:00:00 2001 From: miqlas <5569059+extrowerk@users.noreply.github.com> Date: Tue, 26 Dec 2017 20:17:35 +0100 Subject: [PATCH] OpenCV: bump version (#1959) --- ...pencv-3.3.1.recipe => opencv-3.4.0.recipe} | 87 +++++----- .../opencv/patches/opencv-3.4.0.patchset | 153 ++++++++++++++++++ 2 files changed, 199 insertions(+), 41 deletions(-) rename media-libs/opencv/{opencv-3.3.1.recipe => opencv-3.4.0.recipe} (69%) create mode 100644 media-libs/opencv/patches/opencv-3.4.0.patchset diff --git a/media-libs/opencv/opencv-3.3.1.recipe b/media-libs/opencv/opencv-3.4.0.recipe similarity index 69% rename from media-libs/opencv/opencv-3.3.1.recipe rename to media-libs/opencv/opencv-3.4.0.recipe index bfabc7a59..16d3b438b 100644 --- a/media-libs/opencv/opencv-3.3.1.recipe +++ b/media-libs/opencv/opencv-3.4.0.recipe @@ -12,8 +12,8 @@ LICENSE="BSD (3-clause)" REVISION="1" SOURCE_URI="https://github.com/opencv/opencv/archive/$portVersion.tar.gz" SOURCE_FILENAME="opencv-$portVersion.tar.gz" -CHECKSUM_SHA256="5dca3bb0d661af311e25a72b04a7e4c22c47c1aa86eb73e70063cd378a2aa6ee" -SOURCE_DIR="opencv-$portVersion" +CHECKSUM_SHA256="678cc3d2d1b3464b512b084a8cca1fad7de207c7abdf2caa1fed636c13e916da" +PATCHES="opencv-$portVersion.patchset" ARCHITECTURES="?x86 x86_64" SECONDARY_ARCHITECTURES="?x86" @@ -24,31 +24,35 @@ if [ "$targetArchitecture" = x86_gcc2 ]; then commandSuffix= fi +portVersionCompat="$portVersion compat >= ${portVersion%%.*}" +libVersion="$portVersion" +libVersionCompat="$libVersion compat >= ${libVersion%%.*}" + PROVIDES=" - opencv$secondaryArchSuffix = $portVersion compat >= 3 + opencv$secondaryArchSuffix = $portVersionCompat cmd:opencv_annotation$commandSuffix= $portVersion cmd:opencv_createsamples$commandSuffix= $portVersion cmd:opencv_interactive_calibration$commandSuffix= $portVersion cmd:opencv_traincascade$commandSuffix= $portVersion cmd:opencv_version$commandSuffix= $portVersion cmd:opencv_visualisation$commandSuffix= $portVersion - lib:libopencv_calib3d$secondaryArchSuffix = 3.3.1 compat >= 3 - lib:libopencv_core$secondaryArchSuffix = 3.3.1 compat >= 3 - lib:libopencv_dnn$secondaryArchSuffix = 3.3.1 compat >= 3 - lib:libopencv_features2d$secondaryArchSuffix = 3.3.1 compat >= 3 - lib:libopencv_flann$secondaryArchSuffix = 3.3.1 compat >= 3 - lib:libopencv_highgui$secondaryArchSuffix = 3.3.1 compat >= 3 - lib:libopencv_imgcodecs$secondaryArchSuffix = 3.3.1 compat >= 3 - lib:libopencv_imgproc$secondaryArchSuffix = 3.3.1 compat >= 3 - lib:libopencv_ml$secondaryArchSuffix = 3.3.1 compat >= 3 - lib:libopencv_objdetect$secondaryArchSuffix = 3.3.1 compat >= 3 - lib:libopencv_photo$secondaryArchSuffix = 3.3.1 compat >= 3 - lib:libopencv_shape$secondaryArchSuffix = 3.3.1 compat >= 3 - lib:libopencv_stitching$secondaryArchSuffix = 3.3.1 compat >= 3 - lib:libopencv_superres$secondaryArchSuffix = 3.3.1 compat >= 3 - lib:libopencv_video$secondaryArchSuffix = 3.3.1 compat >= 3 - lib:libopencv_videoio$secondaryArchSuffix = 3.3.1 compat >= 3 - lib:libopencv_videostab$secondaryArchSuffix = 3.3.1 compat >= 3 + lib:libopencv_calib3d$secondaryArchSuffix = $libVersionCompat + lib:libopencv_core$secondaryArchSuffix = $libVersionCompat + lib:libopencv_dnn$secondaryArchSuffix = $libVersionCompat + lib:libopencv_features2d$secondaryArchSuffix = $libVersionCompat + lib:libopencv_flann$secondaryArchSuffix = $libVersionCompat + lib:libopencv_highgui$secondaryArchSuffix = $libVersionCompat + lib:libopencv_imgcodecs$secondaryArchSuffix = $libVersionCompat + lib:libopencv_imgproc$secondaryArchSuffix = $libVersionCompat + lib:libopencv_ml$secondaryArchSuffix = $libVersionCompat + lib:libopencv_objdetect$secondaryArchSuffix = $libVersionCompat + lib:libopencv_photo$secondaryArchSuffix = $libVersionCompat + lib:libopencv_shape$secondaryArchSuffix = $libVersionCompat + lib:libopencv_stitching$secondaryArchSuffix = $libVersionCompat + lib:libopencv_superres$secondaryArchSuffix = $libVersionCompat + lib:libopencv_video$secondaryArchSuffix = $libVersionCompat + lib:libopencv_videoio$secondaryArchSuffix = $libVersionCompat + lib:libopencv_videostab$secondaryArchSuffix = $libVersionCompat " REQUIRES=" haiku$secondaryArchSuffix @@ -83,24 +87,24 @@ REQUIRES=" " PROVIDES_devel=" - opencv${secondaryArchSuffix}_devel = $portVersion compat >= 3 - devel:libopencv_calib3d$secondaryArchSuffix = 3.3.1 compat >= 3 - devel:libopencv_core$secondaryArchSuffix = 3.3.1 compat >= 3 - devel:libopencv_dnn$secondaryArchSuffix = 3.3.1 compat >= 3 - devel:libopencv_features2d$secondaryArchSuffix = 3.3.1 compat >= 3 - devel:libopencv_flann$secondaryArchSuffix = 3.3.1 compat >= 3 - devel:libopencv_highgui$secondaryArchSuffix = 3.3.1 compat >= 3 - devel:libopencv_imgcodecs$secondaryArchSuffix = 3.3.1 compat >= 3 - devel:libopencv_imgproc$secondaryArchSuffix = 3.3.1 compat >= 3 - devel:libopencv_ml$secondaryArchSuffix = 3.3.1 compat >= 3 - devel:libopencv_objdetect$secondaryArchSuffix = 3.3.1 compat >= 3 - devel:libopencv_photo$secondaryArchSuffix = 3.3.1 compat >= 3 - devel:libopencv_shape$secondaryArchSuffix = 3.3.1 compat >= 3 - devel:libopencv_stitching$secondaryArchSuffix = 3.3.1 compat >= 3 - devel:libopencv_superres$secondaryArchSuffix = 3.3.1 compat >= 3 - devel:libopencv_video$secondaryArchSuffix = 3.3.1 compat >= 3 - devel:libopencv_videoio$secondaryArchSuffix = 3.3.1 compat >= 3 - devel:libopencv_videostab$secondaryArchSuffix = 3.3.1 compat >= 3 + opencv${secondaryArchSuffix}_devel = $portVersionCompat + devel:libopencv_calib3d$secondaryArchSuffix = $libVersionCompat + devel:libopencv_core$secondaryArchSuffix = $libVersionCompat + devel:libopencv_dnn$secondaryArchSuffix = $libVersionCompat + devel:libopencv_features2d$secondaryArchSuffix = $libVersionCompat + devel:libopencv_flann$secondaryArchSuffix = $libVersionCompat + devel:libopencv_highgui$secondaryArchSuffix = $libVersionCompat + devel:libopencv_imgcodecs$secondaryArchSuffix = $libVersionCompat + devel:libopencv_imgproc$secondaryArchSuffix = $libVersionCompat + devel:libopencv_ml$secondaryArchSuffix = $libVersionCompat + devel:libopencv_objdetect$secondaryArchSuffix = $libVersionCompat + devel:libopencv_photo$secondaryArchSuffix = $libVersionCompat + devel:libopencv_shape$secondaryArchSuffix = $libVersionCompat + devel:libopencv_stitching$secondaryArchSuffix = $libVersionCompat + devel:libopencv_superres$secondaryArchSuffix = $libVersionCompat + devel:libopencv_video$secondaryArchSuffix = $libVersionCompat + devel:libopencv_videoio$secondaryArchSuffix = $libVersionCompat + devel:libopencv_videostab$secondaryArchSuffix = $libVersionCompat " REQUIRES_devel=" opencv$secondaryArchSuffix == $portVersion base @@ -187,6 +191,7 @@ BUILD() -DCMAKE_BUILD_TYPE=Release \ -DENABLE_BUILD_HARDENING=OFF \ -DCMAKE_SKIP_RPATH=ON \ + -DENABLE_PIC=OFF \ -DCMAKE_INSTALL_PREFIX:PATH=$prefix make $jobArgs @@ -236,7 +241,7 @@ INSTALL() # fixCmake sed -i 's,\/include,/'${relativeIncludeDir}',g' \ $libDir/cmake/OpenCV/OpenCVConfig.cmake - sed -i 's,\/..\/..\/,\/..\/..\/..\/,g' \ + sed -i 's|/\.\./\.\./|&../|g' \ $libDir/cmake/OpenCV/OpenCVConfig.cmake sed -i 's,\/lib\/,\/,g' \ $libDir/cmake/OpenCV/OpenCVModules-release.cmake @@ -249,6 +254,6 @@ INSTALL() TEST() { - cd build_haiku - make test + LIBRARY_PATH="$sourceDir/build_haiku/lib${LIBRARY_PATH:+:$LIBRARY_PATH}" \ + make -C build_haiku test $jobArgs } diff --git a/media-libs/opencv/patches/opencv-3.4.0.patchset b/media-libs/opencv/patches/opencv-3.4.0.patchset new file mode 100644 index 000000000..7242d3806 --- /dev/null +++ b/media-libs/opencv/patches/opencv-3.4.0.patchset @@ -0,0 +1,153 @@ +From 9cc93465114e8ce1841ab1e0a5a78b2b6e4a2f19 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= +Date: Sun, 24 Dec 2017 20:20:10 +0100 +Subject: Disable PIC for Haiku + + +diff --git a/cmake/OpenCVCompilerDefenses.cmake b/cmake/OpenCVCompilerDefenses.cmake +index 7d1ba0b..ca3522b 100644 +--- a/cmake/OpenCVCompilerDefenses.cmake ++++ b/cmake/OpenCVCompilerDefenses.cmake +@@ -66,7 +66,11 @@ else() + # not supported + endif() + +-set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) ++if(NOT HAIKU) ++ set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) ++else() ++ set(CMAKE_POSITION_INDEPENDENT_CODE FALSE) ++endif() + if(NOT CMAKE_CXX_FLAGS MATCHES "-fPIC") + ocv_add_defense_compiler_flag("-fPIC") + endif() +-- +2.15.0 + + +From 4f6dc7e4b42e6bf18ffa36f8b98d404c5768d747 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= +Date: Mon, 25 Dec 2017 17:29:17 +0100 +Subject: Haiku have filesystem support + + +diff --git a/modules/core/include/opencv2/core/utils/filesystem.private.hpp b/modules/core/include/opencv2/core/utils/filesystem.private.hpp +index 28b1747..7e2b98b 100644 +--- a/modules/core/include/opencv2/core/utils/filesystem.private.hpp ++++ b/modules/core/include/opencv2/core/utils/filesystem.private.hpp +@@ -10,7 +10,7 @@ + # if defined(__EMSCRIPTEN__) || defined(__native_client__) + /* no support */ + # elif defined __ANDROID__ || defined __linux__ || defined _WIN32 || \ +- defined __FreeBSD__ || defined __bsdi__ ++ defined __FreeBSD__ || defined __bsdi__ || defined __HAIKU__ + # define OPENCV_HAVE_FILESYSTEM_SUPPORT 1 + # elif defined(__APPLE__) + # include +-- +2.15.0 + + +From 6737ad323f30faaf5bafe5af109f314c5519e8bf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= +Date: Mon, 25 Dec 2017 17:58:25 +0100 +Subject: Basic Haiku support + + +diff --git a/modules/core/src/parallel.cpp b/modules/core/src/parallel.cpp +index 8ead516..d743f96 100644 +--- a/modules/core/src/parallel.cpp ++++ b/modules/core/src/parallel.cpp +@@ -52,7 +52,8 @@ + #undef abs + #endif + +-#if defined __linux__ || defined __APPLE__ || defined __GLIBC__ ++#if defined __linux__ || defined __APPLE__ || defined __GLIBC__ \ ++ || defined __HAIKU__ + #include + #include + #include +@@ -672,7 +673,7 @@ int cv::getNumberOfCPUs(void) + #elif defined __ANDROID__ + static int ncpus = getNumberOfCPUsImpl(); + return ncpus; +-#elif defined __linux__ || defined __GLIBC__ ++#elif defined __linux__ || defined __GLIBC__ || defined __HAIKU__ + return (int)sysconf( _SC_NPROCESSORS_ONLN ); + #elif defined __APPLE__ + int numCPU=0; +diff --git a/modules/core/src/utils/filesystem.cpp b/modules/core/src/utils/filesystem.cpp +index 266a92f..1f25bf9 100644 +--- a/modules/core/src/utils/filesystem.cpp ++++ b/modules/core/src/utils/filesystem.cpp +@@ -33,7 +33,7 @@ + #include + #include + #include +-#elif defined __linux__ || defined __APPLE__ ++#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ + #include + #include + #include +@@ -156,7 +156,7 @@ cv::String getcwd() + sz = GetCurrentDirectoryA((DWORD)buf.size(), (char*)buf); + return cv::String((char*)buf, (size_t)sz); + #endif +-#elif defined __linux__ || defined __APPLE__ ++#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ + for(;;) + { + char* p = ::getcwd((char*)buf, buf.size()); +@@ -190,7 +190,7 @@ bool createDirectory(const cv::String& path) + #else + int result = _mkdir(path.c_str()); + #endif +-#elif defined __linux__ || defined __APPLE__ ++#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ + int result = mkdir(path.c_str(), 0777); + #else + int result = -1; +@@ -305,7 +305,7 @@ private: + Impl& operator=(const Impl&); // disabled + }; + +-#elif defined __linux__ || defined __APPLE__ ++#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ + + struct FileLock::Impl + { +@@ -419,7 +419,7 @@ cv::String getCacheDirectory(const char* sub_directory_name, const char* configu + default_cache_path = "/tmp/"; + CV_LOG_WARNING(NULL, "Using world accessible cache directory. This may be not secure: " << default_cache_path); + } +-#elif defined __linux__ ++#elif defined __linux__ || defined __HAIKU__ + // https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html + if (default_cache_path.empty()) + { +diff --git a/modules/videoio/src/cap_ffmpeg_impl.hpp b/modules/videoio/src/cap_ffmpeg_impl.hpp +index fb12902..8ab77a3 100644 +--- a/modules/videoio/src/cap_ffmpeg_impl.hpp ++++ b/modules/videoio/src/cap_ffmpeg_impl.hpp +@@ -101,7 +101,7 @@ extern "C" { + long tv_nsec; + }; + #endif +-#elif defined __linux__ || defined __APPLE__ ++#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ + #include + #include + #include +@@ -298,7 +298,7 @@ static int get_number_of_cpus(void) + GetSystemInfo( &sysinfo ); + + return (int)sysinfo.dwNumberOfProcessors; +-#elif defined __linux__ ++#elif defined __linux__ || defined __HAIKU__ + return (int)sysconf( _SC_NPROCESSORS_ONLN ); + #elif defined __APPLE__ + int numCPU=0; +-- +2.15.0 +