mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-21 19:20:08 +02:00
opencv: recipe for version 3.2.0 (#1272)
This commit is contained in:
216
media-libs/opencv/opencv-3.2.0.recipe
Normal file
216
media-libs/opencv/opencv-3.2.0.recipe
Normal file
@@ -0,0 +1,216 @@
|
||||
SUMMARY="Open Source Computer Vision Library"
|
||||
DESCRIPTION="A collection of algorithms and sample code for various \
|
||||
computer vision problems."
|
||||
HOMEPAGE="http://opencv.org/"
|
||||
COPYRIGHT="2000-2016, Intel Corporation
|
||||
2009-2011, Willow Garage Inc.
|
||||
2009-2016, NVIDIA Corporation
|
||||
2010-2013, Advanced Micro Devices, Inc.
|
||||
2015-2016, OpenCV Foundation
|
||||
2015-2016, Itseez Inc."
|
||||
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="b9d62dfffb8130d59d587627703d5f3e6252dce4a94c1955784998da7a39dd35"
|
||||
SOURCE_DIR="opencv-$portVersion"
|
||||
PATCHES="opencv-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="?x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="?x86"
|
||||
|
||||
PROVIDES="
|
||||
opencv$secondaryArchSuffix = $portVersion compat >= 3
|
||||
cmd:opencv_annotation$secondaryArchSuffix= $portVersion
|
||||
cmd:opencv_createsamples$secondaryArchSuffix= $portVersion
|
||||
cmd:opencv_traincascade$secondaryArchSuffix= $portVersion
|
||||
cmd:opencv_version$secondaryArchSuffix= $portVersion
|
||||
cmd:opencv_visualisation$secondaryArchSuffix= $portVersion
|
||||
lib:libopencv_calib3d$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
lib:libopencv_core$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
lib:libopencv_features2d$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
lib:libopencv_flann$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
lib:libopencv_highgui$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
lib:libopencv_imgcodecs$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
lib:libopencv_imgproc$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
lib:libopencv_ml$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
lib:libopencv_objdetect$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
lib:libopencv_photo$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
lib:libopencv_shape$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
lib:libopencv_stitching$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
lib:libopencv_superres$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
lib:libopencv_video$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
lib:libopencv_videoio$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
lib:libopencv_videostab$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libavcodec$secondaryArchSuffix
|
||||
lib:libavformat$secondaryArchSuffix
|
||||
lib:libavresample$secondaryArchSuffix
|
||||
lib:libavutil$secondaryArchSuffix
|
||||
lib:libgdal$secondaryArchSuffix
|
||||
# lib:libGL$secondaryArchSuffix
|
||||
# lib:libGLU$secondaryArchSuffix
|
||||
lib:libgphoto2$secondaryArchSuffix
|
||||
lib:libilmimf$secondaryArchSuffix #openexr
|
||||
lib:libjasper$secondaryArchSuffix
|
||||
lib:libjpeg$secondaryArchSuffix
|
||||
lib:liblapack$secondaryArchSuffix
|
||||
lib:libopenblas$secondaryArchSuffix
|
||||
lib:libpng16$secondaryArchSuffix
|
||||
lib:libQt5Concurrent$secondaryArchSuffix
|
||||
lib:libQt5Core$secondaryArchSuffix
|
||||
lib:libQt5Gui$secondaryArchSuffix
|
||||
lib:libQt5Test$secondaryArchSuffix
|
||||
lib:libQt5Widgets$secondaryArchSuffix
|
||||
lib:libswscale$secondaryArchSuffix
|
||||
lib:libtiff$secondaryArchSuffix
|
||||
lib:libwebp$secondaryArchSuffix
|
||||
lib:libz$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
opencv${secondaryArchSuffix}_devel = $portVersion compat >= 3
|
||||
devel:libopencv_calib3d$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
devel:libopencv_core$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
devel:libopencv_features2d$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
devel:libopencv_flann$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
devel:libopencv_highgui$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
devel:libopencv_imgcodecs$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
devel:libopencv_imgproc$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
devel:libopencv_ml$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
devel:libopencv_objdetect$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
devel:libopencv_photo$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
devel:libopencv_shape$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
devel:libopencv_stitching$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
devel:libopencv_superres$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
devel:libopencv_video$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
devel:libopencv_videoio$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
devel:libopencv_videostab$secondaryArchSuffix = 3.2.0 compat >= 3
|
||||
"
|
||||
REQUIRES_devel="
|
||||
opencv$secondaryArchSuffix == $portVersion base
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:eigen$secondaryArchSuffix
|
||||
devel:libavcodec$secondaryArchSuffix
|
||||
devel:libavformat$secondaryArchSuffix
|
||||
devel:libavresample$secondaryArchSuffix
|
||||
devel:libavutil$secondaryArchSuffix
|
||||
devel:libgdal$secondaryArchSuffix
|
||||
# devel:libGL$secondaryArchSuffix
|
||||
# devel:libGLU$secondaryArchSuffix
|
||||
devel:libgphoto2$secondaryArchSuffix
|
||||
devel:libilmimf$secondaryArchSuffix #openexr
|
||||
devel:libjasper$secondaryArchSuffix
|
||||
devel:libjpeg$secondaryArchSuffix
|
||||
devel:liblapack$secondaryArchSuffix
|
||||
devel:libopenblas$secondaryArchSuffix
|
||||
devel:libpng16$secondaryArchSuffix
|
||||
devel:libQt5Concurrent$secondaryArchSuffix
|
||||
devel:libQt5Core$secondaryArchSuffix
|
||||
devel:libQt5Gui$secondaryArchSuffix
|
||||
devel:libQt5Test$secondaryArchSuffix
|
||||
devel:libQt5Widgets$secondaryArchSuffix
|
||||
devel:libswscale$secondaryArchSuffix
|
||||
devel:libtiff$secondaryArchSuffix
|
||||
devel:libwebp$secondaryArchSuffix
|
||||
devel:libz$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
# cmd:ant
|
||||
cmd:cmake
|
||||
cmd:doxygen
|
||||
cmd:f2py2
|
||||
cmd:f2py3
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
# cmd:javac
|
||||
# cmd:jni
|
||||
cmd:ld$secondaryArchSuffix
|
||||
cmd:make
|
||||
# cmd:matlab # maybe later
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
cmd:python2
|
||||
cmd:python3
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
mkdir -p build_haiku && cd build_haiku
|
||||
|
||||
cmake .. \
|
||||
-DWITH_GDAL=ON \
|
||||
-DWITH_IPP=OFF \
|
||||
-DWITH_OPENGL=OFF \
|
||||
-DWITH_QT=ON \
|
||||
-DWITH_EIGEN=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DENABLE_BUILD_HARDENING=OFF \
|
||||
-DBUILD_WITH_DEBUG_INFO=OFF \
|
||||
-DCMAKE_SKIP_RPATH=ON \
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=$prefix
|
||||
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
cd build_haiku
|
||||
|
||||
make install
|
||||
|
||||
mkdir -p $developDir $dataDir
|
||||
mv $prefix/include $includeDir
|
||||
mv $prefix/share/* $dataDir
|
||||
rmdir $prefix/share
|
||||
|
||||
mkdir -p $libDir/cmake/OpenCV
|
||||
mv $dataDir/OpenCV/*.cmake $libDir/cmake/OpenCV/.
|
||||
|
||||
prepareInstalledDevelLibs libopencv_calib3d \
|
||||
libopencv_core \
|
||||
libopencv_features2d \
|
||||
libopencv_flann \
|
||||
libopencv_highgui \
|
||||
libopencv_imgcodecs \
|
||||
libopencv_imgproc \
|
||||
libopencv_ml \
|
||||
libopencv_objdetect \
|
||||
libopencv_photo \
|
||||
libopencv_shape \
|
||||
libopencv_stitching \
|
||||
libopencv_superres \
|
||||
libopencv_video \
|
||||
libopencv_videoio \
|
||||
libopencv_videostab
|
||||
|
||||
# Cleanup
|
||||
# fixPkgconfig don't know about this variables
|
||||
sed -i 's,^includedir_old=\(.*\),includedir_old=${prefix}/'${relativeIncludeDir}'/opencv,' \
|
||||
$libDir/pkgconfig/opencv.pc
|
||||
sed -i 's,^includedir_new=\(.*\),includedir_new=${prefix}/'${relativeIncludeDir}',' \
|
||||
$libDir/pkgconfig/opencv.pc
|
||||
|
||||
fixPkgconfig
|
||||
|
||||
# fixCmake
|
||||
# No idea, whats wrong here, but it is required
|
||||
sed -i 's,\/include,/'${relativeIncludeDir}',g' \
|
||||
$libDir/cmake/OpenCV/OpenCVConfig.cmake
|
||||
sed -i 's,\/lib\/,\/,g' \
|
||||
$libDir/cmake/OpenCV/OpenCVModules-release.cmake
|
||||
|
||||
# devel package
|
||||
packageEntries devel \
|
||||
$developDir \
|
||||
$libDir/cmake
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
cd build_haiku
|
||||
make test
|
||||
}
|
||||
112
media-libs/opencv/patches/opencv-3.2.0.patchset
Normal file
112
media-libs/opencv/patches/opencv-3.2.0.patchset
Normal file
@@ -0,0 +1,112 @@
|
||||
From 2c12c6a1cba8a063d210fa477dc61f9872ad6117 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
|
||||
Date: Fri, 7 Apr 2017 14:10:49 +0200
|
||||
Subject: Haiku is like BSD but with nicer icons (no -lrt -ldl)
|
||||
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index cc45f6f..5abc755 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -520,7 +520,7 @@ if(UNIX)
|
||||
CHECK_INCLUDE_FILE(pthread.h HAVE_LIBPTHREAD)
|
||||
if(ANDROID)
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} dl m log)
|
||||
- elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|DragonFly|OpenBSD")
|
||||
+ elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD|DragonFly|OpenBSD|Haiku")
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} m pthread)
|
||||
elseif(EMSCRIPTEN)
|
||||
# no need to link to system libs with emscripten
|
||||
--
|
||||
2.12.2
|
||||
|
||||
|
||||
From f7de64ae96e89b6b161442609e54e191ebc4919c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
|
||||
Date: Fri, 7 Apr 2017 14:14:46 +0200
|
||||
Subject: Haiku build fix
|
||||
|
||||
|
||||
diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp
|
||||
index 3c8f39d..8039398 100644
|
||||
--- a/modules/core/src/system.cpp
|
||||
+++ b/modules/core/src/system.cpp
|
||||
@@ -64,7 +64,7 @@ Mutex* __initialization_mutex_initializer = &getInitializationMutex();
|
||||
# endif
|
||||
#endif
|
||||
|
||||
-#if defined ANDROID || defined __linux__ || defined __FreeBSD__
|
||||
+#if defined ANDROID || defined __linux__ || defined __FreeBSD__ || defined __HAIKU__
|
||||
# include <unistd.h>
|
||||
# include <fcntl.h>
|
||||
# include <elf.h>
|
||||
@@ -198,7 +198,7 @@ std::wstring GetTempFileNameWinRT(std::wstring prefix)
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
-#if defined __linux__ || defined __APPLE__ || defined __EMSCRIPTEN__ || defined __FreeBSD__
|
||||
+#if defined __linux__ || defined __APPLE__ || defined __EMSCRIPTEN__ || defined __FreeBSD__ || defined __HAIKU__
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
--
|
||||
2.12.2
|
||||
|
||||
|
||||
From e6632eafd03dc6a052499a6a20a03f1e4e97a9ab Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
|
||||
Date: Fri, 7 Apr 2017 15:36:17 +0200
|
||||
Subject: FFMPEG test fix for Haiku
|
||||
|
||||
|
||||
diff --git a/cmake/checks/ffmpeg_test.cpp b/cmake/checks/ffmpeg_test.cpp
|
||||
index 7b49c38..23a5aab 100644
|
||||
--- a/cmake/checks/ffmpeg_test.cpp
|
||||
+++ b/cmake/checks/ffmpeg_test.cpp
|
||||
@@ -1,5 +1,9 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+ #define __STDC_CONSTANT_MACROS
|
||||
+#endif
|
||||
+
|
||||
extern "C" {
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libavcodec/avcodec.h>
|
||||
--
|
||||
2.12.2
|
||||
|
||||
|
||||
From 7125a2bbd158a9f66944641c93bd3082ffb8e439 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
|
||||
Date: Thu, 29 Jun 2017 10:46:03 +0200
|
||||
Subject: Disable stack protector for Haiku
|
||||
|
||||
|
||||
diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake
|
||||
index 5bb0479..f1eca10 100644
|
||||
--- a/cmake/OpenCVCompilerOptions.cmake
|
||||
+++ b/cmake/OpenCVCompilerOptions.cmake
|
||||
@@ -398,6 +398,20 @@ if(NOT OPENCV_FP16_DISABLE AND NOT IOS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
+# ----------------------------------------------------------------------------
|
||||
+# NO STACK PROTECTOR FOR HAIKU
|
||||
+# ----------------------------------------------------------------------------
|
||||
+
|
||||
+if(${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
|
||||
+ set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -fno-stack-protector")
|
||||
+ set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} -fno-stack-protector")
|
||||
+ set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} -fno-stack-protector")
|
||||
+ set(OPENCV_EXTRA_FLAGS_DEBUG "${OPENCV_EXTRA_FLAGS_DEBUG} -fno-stack-protector")
|
||||
+ set(OPENCV_EXTRA_EXE_LINKER_FLAGS "${OPENCV_EXTRA_EXE_LINKER_FLAGS} -fno-stack-protector")
|
||||
+ set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE} -fno-stack-protector")
|
||||
+ set(OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG "${OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG} -fno-stack-protector")
|
||||
+endif()
|
||||
+
|
||||
#combine all "extra" options
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OPENCV_EXTRA_FLAGS} ${OPENCV_EXTRA_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPENCV_EXTRA_FLAGS} ${OPENCV_EXTRA_CXX_FLAGS}")
|
||||
--
|
||||
2.12.2
|
||||
Reference in New Issue
Block a user