diff options
Diffstat (limited to 'media-gfx/zbar/files')
-rw-r--r-- | media-gfx/zbar/files/zbar-0.10-errors.patch | 10 | ||||
-rw-r--r-- | media-gfx/zbar/files/zbar-0.10-no-v4l1-check.patch | 74 | ||||
-rw-r--r-- | media-gfx/zbar/files/zbar-0.10-python-crash.patch | 19 | ||||
-rw-r--r-- | media-gfx/zbar/files/zbar-0.10-v4l2-uvcvideo.patch | 49 | ||||
-rw-r--r-- | media-gfx/zbar/files/zbar-0.10_p20121015-ImageMagick-7.diff | 24 |
5 files changed, 176 insertions, 0 deletions
diff --git a/media-gfx/zbar/files/zbar-0.10-errors.patch b/media-gfx/zbar/files/zbar-0.10-errors.patch new file mode 100644 index 000000000000..63328ce664bb --- /dev/null +++ b/media-gfx/zbar/files/zbar-0.10-errors.patch @@ -0,0 +1,10 @@ +--- zbar-0.10/include/zbar/Exception.h ++++ zbar-0.10/include/zbar/Exception.h +@@ -32,6 +32,7 @@ + + #include <exception> + #include <new> ++#include <cstddef> + + namespace zbar { + diff --git a/media-gfx/zbar/files/zbar-0.10-no-v4l1-check.patch b/media-gfx/zbar/files/zbar-0.10-no-v4l1-check.patch new file mode 100644 index 000000000000..b25827a0b998 --- /dev/null +++ b/media-gfx/zbar/files/zbar-0.10-no-v4l1-check.patch @@ -0,0 +1,74 @@ +--- zbar-0.10/configure.ac ++++ zbar-0.10/configure.ac +@@ -147,19 +147,13 @@ + with_video="no" + AS_IF([test "x$enable_video" != "xno"], + [AS_IF([test "x$win32" = "xno"], +- [AC_CHECK_HEADERS([linux/videodev.h], [with_video="v4l1"], +- [AC_MSG_FAILURE([test for video support failed! +-rebuild your kernel to include video4linux support or +-configure --disable-video to skip building video support.])]) +- AC_CHECK_HEADERS([linux/videodev2.h], [with_video="v4l2"], ++ [AC_CHECK_HEADERS([linux/videodev2.h], [with_video="v4l2"], + [AC_MSG_WARN([v4l2 API not detected, upgrade your kernel!])])], + [AC_CHECK_HEADERS([vfw.h], [with_video="vfw"], + [AC_MSG_FAILURE([test for VfW video support failed! + configure --disable-video to skip building vidoe support.])])]) + ]) + AM_CONDITIONAL([HAVE_VIDEO], [test "x$enable_video" != "xno"]) +-AM_CONDITIONAL([HAVE_V4L1], +- [test "x$with_video" = "xv4l1" || test "x$with_video" = "xv4l2"]) + AM_CONDITIONAL([HAVE_V4L2], [test "x$with_video" = "xv4l2"]) + + dnl X +--- zbar-0.10/zbar/Makefile.am.inc ++++ zbar-0.10/zbar/Makefile.am.inc +@@ -53,12 +53,9 @@ + zbar_libzbar_la_SOURCES += zbar/processor/posix.h zbar/processor/posix.c + endif + +-if HAVE_V4L1 +-zbar_libzbar_la_SOURCES += zbar/video/v4l1.c + if HAVE_V4L2 + zbar_libzbar_la_SOURCES += zbar/video/v4l2.c + endif +-endif + if WIN32 + if HAVE_VIDEO + zbar_libzbar_la_SOURCES += zbar/video/vfw.c +--- zbar-0.10/zbar/video/v4l2.c ++++ zbar-0.10/zbar/video/v4l2.c +@@ -39,6 +39,9 @@ + # include <sys/mman.h> + #endif + #include <linux/videodev2.h> ++#include <sys/stat.h> ++#include <unistd.h> ++#include <fcntl.h> + + #include "video.h" + #include "image.h" +@@ -507,3 +507,23 @@ + vdo->dq = v4l2_dq; + return(0); + } ++ ++int _zbar_video_open (zbar_video_t *vdo, ++ const char *dev) ++{ ++ vdo->fd = open(dev, O_RDWR); ++ if(vdo->fd < 0) ++ return(err_capture_str(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, ++ "opening video device '%s'", dev)); ++ zprintf(1, "opened camera device %s (fd=%d)\n", dev, vdo->fd); ++ ++ int rc = -1; ++ if(vdo->intf != VIDEO_V4L1) ++ rc = _zbar_v4l2_probe(vdo); ++ ++ if(rc && vdo->fd >= 0) { ++ close(vdo->fd); ++ vdo->fd = -1; ++ } ++ return(rc); ++} diff --git a/media-gfx/zbar/files/zbar-0.10-python-crash.patch b/media-gfx/zbar/files/zbar-0.10-python-crash.patch new file mode 100644 index 000000000000..a6f7a96e34db --- /dev/null +++ b/media-gfx/zbar/files/zbar-0.10-python-crash.patch @@ -0,0 +1,19 @@ +https://sourceforge.net/p/zbar/patches/37/ + +fix from Debian for crashes when importing the python module. +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702499 + +this doesn't happen on some arches as the data naturally ends up with zero +data after the structure, but on some (like arm), it isn't so we crash when +python walks the list. + +--- a/python/imagescanner.c ++++ b/python/imagescanner.c +@@ -68,6 +68,7 @@ imagescanner_get_results (zbarImageScanner *self, + + static PyGetSetDef imagescanner_getset[] = { + { "results", (getter)imagescanner_get_results, }, ++ { NULL }, + }; + + static PyObject* diff --git a/media-gfx/zbar/files/zbar-0.10-v4l2-uvcvideo.patch b/media-gfx/zbar/files/zbar-0.10-v4l2-uvcvideo.patch new file mode 100644 index 000000000000..4fde95e2b563 --- /dev/null +++ b/media-gfx/zbar/files/zbar-0.10-v4l2-uvcvideo.patch @@ -0,0 +1,49 @@ +--- zbar-0.10/zbar/video/v4l2.c 2009-10-23 18:16:44.000000000 +0000 ++++ zbar-0.10/zbar/video/v4l2.c 2015-03-07 05:46:36.000000000 +0000 +@@ -241,6 +241,21 @@ + return(0); + } + ++static int v4l2_request_buffers (zbar_video_t *vdo) ++{ ++ struct v4l2_requestbuffers rb; ++ memset(&rb, 0, sizeof(rb)); ++ rb.count = vdo->num_images; ++ rb.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ++ rb.memory = V4L2_MEMORY_USERPTR; ++ if(ioctl(vdo->fd, VIDIOC_REQBUFS, &rb) < 0) ++ return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, ++ "requesting video frame buffers (VIDIOC_REQBUFS)")); ++ if(rb.count) ++ vdo->num_images = rb.count; ++ return(0); ++} ++ + static int v4l2_set_format (zbar_video_t *vdo, + uint32_t fmt) + { +@@ -308,6 +323,8 @@ + return(-1); + if(vdo->iomode == VIDEO_MMAP) + return(v4l2_mmap_buffers(vdo)); ++ if(vdo->iomode == VIDEO_USERPTR) ++ return(v4l2_request_buffers(vdo)); + return(0); + } + +@@ -337,8 +354,13 @@ + else { + if(!vdo->iomode) + vdo->iomode = VIDEO_USERPTR; +- if(rb.count) +- vdo->num_images = rb.count; ++ /* releasing buffers ++ * lest the driver may later refuse to change format ++ */ ++ rb.count = 0; ++ if (ioctl(vdo->fd, VIDIOC_REQBUFS, &rb) < 0) ++ zprintf(0, "WARNING: releasing video buffers failed: error %d\n", ++ errno); + } + return(0); + } diff --git a/media-gfx/zbar/files/zbar-0.10_p20121015-ImageMagick-7.diff b/media-gfx/zbar/files/zbar-0.10_p20121015-ImageMagick-7.diff new file mode 100644 index 000000000000..a56ab7d913b0 --- /dev/null +++ b/media-gfx/zbar/files/zbar-0.10_p20121015-ImageMagick-7.diff @@ -0,0 +1,24 @@ +diff -r -U3 zbar-0.10_p20121015_orig/configure.ac zbar-0.10_p20121015/configure.ac +--- zbar-0.10_p20121015_orig/configure.ac 2016-08-28 16:59:23.969753652 +0200 ++++ zbar-0.10_p20121015/configure.ac 2016-08-28 17:17:15.384494517 +0200 +@@ -324,7 +324,7 @@ + dnl double check ImageMagick install (bug #2582232) + CPPFLAGS_save="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $MAGICK_CFLAGS" +- AC_CHECK_HEADER([wand/MagickWand.h], ++ AC_CHECK_HEADER([MagickWand/MagickWand.h], + [have_IM="yes"], + [have_IM="broken"]) + CPPFLAGS="$CPPFLAGS_save"])]) +diff -r -U3 zbar-0.10_p20121015_orig/zbarimg/zbarimg.c zbar-0.10_p20121015/zbarimg/zbarimg.c +--- zbar-0.10_p20121015_orig/zbarimg/zbarimg.c 2015-08-05 11:10:32.000000000 +0200 ++++ zbar-0.10_p20121015/zbarimg/zbarimg.c 2016-08-28 17:10:39.532787196 +0200 +@@ -44,7 +44,7 @@ + #endif + + #ifdef HAVE_IMAGEMAGICK +-# include <wand/MagickWand.h> ++# include <MagickWand/MagickWand.h> + + /* ImageMagick frequently changes API names - just use the original + * (more stable?) names to match GraphicsMagick |