summaryrefslogtreecommitdiff
path: root/graphics/opencv/patches
diff options
context:
space:
mode:
authorjperkin <jperkin@pkgsrc.org>2013-06-12 10:13:58 +0000
committerjperkin <jperkin@pkgsrc.org>2013-06-12 10:13:58 +0000
commita364f0c957a8bc0a98942026fc652df813747e60 (patch)
treee7abbf24f1edbc61f60e9a223c1f9ec532b54307 /graphics/opencv/patches
parentddc3baaffeb3d4cbdc615d96f3e5a5a9d513ea2c (diff)
downloadpkgsrc-a364f0c957a8bc0a98942026fc652df813747e60.tar.gz
Add patches required for SunOS support.
Diffstat (limited to 'graphics/opencv/patches')
-rw-r--r--graphics/opencv/patches/patch-modules_contrib_src_inputoutput.cpp66
-rw-r--r--graphics/opencv/patches/patch-modules_flann_include_opencv2_flann_defines.h16
-rw-r--r--graphics/opencv/patches/patch-modules_ts_src_ts.cpp15
3 files changed, 97 insertions, 0 deletions
diff --git a/graphics/opencv/patches/patch-modules_contrib_src_inputoutput.cpp b/graphics/opencv/patches/patch-modules_contrib_src_inputoutput.cpp
new file mode 100644
index 00000000000..793df328e89
--- /dev/null
+++ b/graphics/opencv/patches/patch-modules_contrib_src_inputoutput.cpp
@@ -0,0 +1,66 @@
+$NetBSD: patch-modules_contrib_src_inputoutput.cpp,v 1.1 2013/06/12 10:13:58 jperkin Exp $
+
+SunOS does not have dirent d_type.
+
+--- modules/contrib/src/inputoutput.cpp.orig 2012-10-17 22:55:38.000000000 +0000
++++ modules/contrib/src/inputoutput.cpp
+@@ -5,6 +5,9 @@
+ #include <windows.h>
+ #include <tchar.h>
+ #else
++#ifdef __sun
++ #include <sys/stat.h>
++#endif
+ #include <dirent.h>
+ #endif
+
+@@ -47,6 +50,10 @@ namespace cv
+ (void)addPath;
+ DIR *dp;
+ struct dirent *dirp;
++#ifdef __sun
++ struct stat sb;
++ char buf[PATH_MAX];
++#endif
+ if((dp = opendir(path.c_str())) == NULL)
+ {
+ return list;
+@@ -54,7 +61,13 @@ namespace cv
+
+ while ((dirp = readdir(dp)) != NULL)
+ {
++#ifdef __sun
++ snprintf(buf, PATH_MAX, "%s/%s", path.c_str(), dirp->d_name);
++ stat(buf, &sb);
++ if (S_ISREG(sb.st_mode))
++#else
+ if (dirp->d_type == DT_REG)
++#endif
+ {
+ if (exten.compare("*") == 0)
+ list.push_back(static_cast<std::string>(dirp->d_name));
+@@ -105,6 +118,10 @@ namespace cv
+ (void)addPath;
+ DIR *dp;
+ struct dirent *dirp;
++#ifdef __sun
++ struct stat sb;
++ char buf[PATH_MAX];
++#endif
+ if((dp = opendir(path_f.c_str())) == NULL)
+ {
+ return list;
+@@ -112,7 +129,13 @@ namespace cv
+
+ while ((dirp = readdir(dp)) != NULL)
+ {
++#ifdef __sun
++ snprintf(buf, PATH_MAX, "%s/%s", path.c_str(), dirp->d_name);
++ stat(buf, &sb);
++ if (S_ISDIR(sb.st_mode) &&
++#else
+ if (dirp->d_type == DT_DIR &&
++#endif
+ strcmp(dirp->d_name, ".") != 0 &&
+ strcmp(dirp->d_name, "..") != 0 )
+ {
diff --git a/graphics/opencv/patches/patch-modules_flann_include_opencv2_flann_defines.h b/graphics/opencv/patches/patch-modules_flann_include_opencv2_flann_defines.h
new file mode 100644
index 00000000000..af6cf08a695
--- /dev/null
+++ b/graphics/opencv/patches/patch-modules_flann_include_opencv2_flann_defines.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-modules_flann_include_opencv2_flann_defines.h,v 1.1 2013/06/12 10:13:58 jperkin Exp $
+
+Avoid CS conflict on SunOS.
+
+--- modules/flann/include/opencv2/flann/defines.h.orig 2012-09-27 22:55:06.000000000 +0000
++++ modules/flann/include/opencv2/flann/defines.h
+@@ -71,6 +71,9 @@
+ #define FLANN_PLATFORM_32_BIT
+ #endif
+
++#ifdef __sun
++#undef CS
++#endif
+
+ #undef FLANN_ARRAY_LEN
+ #define FLANN_ARRAY_LEN(a) (sizeof(a)/sizeof(a[0]))
diff --git a/graphics/opencv/patches/patch-modules_ts_src_ts.cpp b/graphics/opencv/patches/patch-modules_ts_src_ts.cpp
new file mode 100644
index 00000000000..c417f021588
--- /dev/null
+++ b/graphics/opencv/patches/patch-modules_ts_src_ts.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-modules_ts_src_ts.cpp,v 1.1 2013/06/12 10:13:58 jperkin Exp $
+
+Avoid std::string conflict.
+
+--- modules/ts/src/ts.cpp.orig 2012-07-25 22:55:31.000000000 +0000
++++ modules/ts/src/ts.cpp
+@@ -557,7 +557,7 @@ void TS::vprintf( int streams, const cha
+ for( int i = 0; i < MAX_IDX; i++ )
+ if( (streams & (1 << i)) )
+ {
+- output_buf[i] += std::string(str);
++ output_buf[i] += ::std::string(str);
+ // in the new GTest-based framework we do not use
+ // any output files (except for the automatically generated xml report).
+ // if a test fails, all the buffers are printed, so we do not want to duplicate the information and