summaryrefslogtreecommitdiff
path: root/graphics/libv4l
diff options
context:
space:
mode:
authorhans <hans>2012-04-18 17:47:22 +0000
committerhans <hans>2012-04-18 17:47:22 +0000
commit2a90c39d429d5950814d1108e4c4524358c1ed47 (patch)
tree4c53e5a5bfe4ce88b3b932e0bacbe93ca20b1b0b /graphics/libv4l
parent39ef60fc443f6f190262426fe60b3c8c1483cddc (diff)
downloadpkgsrc-2a90c39d429d5950814d1108e4c4524358c1ed47.tar.gz
Make this build on SunOS 5.11.
Diffstat (limited to 'graphics/libv4l')
-rw-r--r--graphics/libv4l/Makefile4
-rw-r--r--graphics/libv4l/distinfo20
-rw-r--r--graphics/libv4l/patches/patch-aa10
-rw-r--r--graphics/libv4l/patches/patch-ab7
-rw-r--r--graphics/libv4l/patches/patch-ac11
-rw-r--r--graphics/libv4l/patches/patch-ad30
-rw-r--r--graphics/libv4l/patches/patch-ae16
-rw-r--r--graphics/libv4l/patches/patch-af8
-rw-r--r--graphics/libv4l/patches/patch-aj16
-rw-r--r--graphics/libv4l/patches/patch-ak20
-rw-r--r--graphics/libv4l/patches/patch-al11
11 files changed, 114 insertions, 39 deletions
diff --git a/graphics/libv4l/Makefile b/graphics/libv4l/Makefile
index 7ed14b27288..af049e7483a 100644
--- a/graphics/libv4l/Makefile
+++ b/graphics/libv4l/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2010/12/27 04:58:10 obache Exp $
+# $NetBSD: Makefile,v 1.7 2012/04/18 17:47:22 hans Exp $
DISTNAME= libv4l-0.4.3
PKGREVISION= 2
@@ -35,4 +35,6 @@ pre-configure:
PLIST_VARS= needs_videoio
+CPPFLAGS.SunOS+= -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1
+
.include "../../mk/bsd.pkg.mk"
diff --git a/graphics/libv4l/distinfo b/graphics/libv4l/distinfo
index 2e73ddd6070..9fa822e208f 100644
--- a/graphics/libv4l/distinfo
+++ b/graphics/libv4l/distinfo
@@ -1,17 +1,17 @@
-$NetBSD: distinfo,v 1.7 2011/01/07 15:20:45 obache Exp $
+$NetBSD: distinfo,v 1.8 2012/04/18 17:47:22 hans Exp $
SHA1 (libv4l-0.4.3.tar.gz) = 2539aa6b04650b97c9fc7ba95721f1e362a73031
RMD160 (libv4l-0.4.3.tar.gz) = 4f0435d955f15602ac093385607417fab71deb17
Size (libv4l-0.4.3.tar.gz) = 83022 bytes
-SHA1 (patch-aa) = a4be4c6f09f0a16affba135b10794e01d7c2541b
-SHA1 (patch-ab) = 8528622d992e977d6e28388335db0a7c29ab272f
-SHA1 (patch-ac) = e886846a68d20d9c3eed905f10143f5e9f9fa4a0
-SHA1 (patch-ad) = e5a3acfb8c2411bf76c4c43cbe09ba86a19afe84
-SHA1 (patch-ae) = afb8579ac122dc2f0958b3c3d711d3641cf3c0c0
-SHA1 (patch-af) = 88429670ab709d398d61002bddb4b210df9def6e
+SHA1 (patch-aa) = ab28c6400bbf8cf4e4e5ae6b258841574ec95ee3
+SHA1 (patch-ab) = 5ade487d6d64d280f3fdae8afad99fbd0b6e5eda
+SHA1 (patch-ac) = 5457af836909f1c9f759c6a780daeb13968ec91f
+SHA1 (patch-ad) = 1d2568e49182efcbde47c14911b6a04e088b2578
+SHA1 (patch-ae) = 1bdefe4897c6edbe4049c52d963f1769bd916750
+SHA1 (patch-af) = 5eba7f447789b2cfd42b1f73bde4dd3c1985a6b2
SHA1 (patch-ah) = d32f2e6aa694d4f0d04e8afbf462b3e61a31bbcc
SHA1 (patch-ai) = 8f22e4050d5e20981bfdd1fc51e572e42347c2b5
-SHA1 (patch-aj) = 2545189ac57f97ff181645132c25b32aa51f6a47
-SHA1 (patch-ak) = 7c9f3c4c5c080b0d7a19e9069e80e4884c737519
-SHA1 (patch-al) = a6eae236be7e16e03047d09b58a6f6d8baafd193
+SHA1 (patch-aj) = 868bd339adfc62925cee0bf1b1f445427e4c1474
+SHA1 (patch-ak) = 0465c3cc368609a3108f8d1aafcacf0ab3c61858
+SHA1 (patch-al) = 8d020ef01f9956b37f718a529306e5f13aaa03a3
SHA1 (patch-am) = 0baf169cb5177f99e0d37de5820aefaee3aa71dd
diff --git a/graphics/libv4l/patches/patch-aa b/graphics/libv4l/patches/patch-aa
index 71feccf30df..ff836db6c6c 100644
--- a/graphics/libv4l/patches/patch-aa
+++ b/graphics/libv4l/patches/patch-aa
@@ -1,8 +1,8 @@
-$NetBSD: patch-aa,v 1.3 2010/12/27 04:58:10 obache Exp $
+$NetBSD: patch-aa,v 1.4 2012/04/18 17:47:22 hans Exp $
--- include/libv4lconvert.h.orig 2008-09-08 14:33:17.000000000 -0400
+++ include/libv4lconvert.h 2008-09-08 14:34:03.000000000 -0400
-@@ -22,10 +22,16 @@
+@@ -22,10 +22,20 @@
/* These headers are not needed by us, but by linux/videodev2.h,
which is broken on some systems and doesn't include them itself :( */
#include <sys/time.h>
@@ -11,11 +11,15 @@ $NetBSD: patch-aa,v 1.3 2010/12/27 04:58:10 obache Exp $
#include <linux/ioctl.h>
/* end broken header workaround includes */
#include <linux/videodev2.h>
-+#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
++#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun)
+#include <sys/types.h>
+#include <sys/ioctl.h>
++#if defined(__sun)
++#include <sys/videodev2.h>
++#else
+#include <sys/videoio.h>
+#endif
++#endif
#ifdef __cplusplus
extern "C" {
diff --git a/graphics/libv4l/patches/patch-ab b/graphics/libv4l/patches/patch-ab
index d6b3c8ba5b6..34f4156741e 100644
--- a/graphics/libv4l/patches/patch-ab
+++ b/graphics/libv4l/patches/patch-ab
@@ -1,8 +1,8 @@
-$NetBSD: patch-ab,v 1.2 2008/09/08 19:10:20 jmcneill Exp $
+$NetBSD: patch-ab,v 1.3 2012/04/18 17:47:22 hans Exp $
--- libv4lconvert/libv4lconvert.c.orig 2008-09-08 14:34:57.000000000 -0400
+++ libv4lconvert/libv4lconvert.c 2008-09-08 14:38:17.000000000 -0400
-@@ -19,7 +19,11 @@
+@@ -19,7 +19,14 @@
#include <errno.h>
#include <string.h>
#include <stdlib.h>
@@ -11,6 +11,9 @@ $NetBSD: patch-ab,v 1.2 2008/09/08 19:10:20 jmcneill Exp $
+#else
+#include <sys/syscall.h>
+#endif
++#ifdef __sun
++#include <alloca.h>
++#endif
#include <unistd.h>
#include "libv4lconvert.h"
#include "libv4lconvert-priv.h"
diff --git a/graphics/libv4l/patches/patch-ac b/graphics/libv4l/patches/patch-ac
index 9e2c86000af..8418cd7655f 100644
--- a/graphics/libv4l/patches/patch-ac
+++ b/graphics/libv4l/patches/patch-ac
@@ -1,14 +1,21 @@
-$NetBSD: patch-ac,v 1.3 2010/12/27 04:58:10 obache Exp $
+$NetBSD: patch-ac,v 1.4 2012/04/18 17:47:22 hans Exp $
--- include/libv4l2.h.orig 2008-09-08 14:42:22.000000000 -0400
+++ include/libv4l2.h 2008-09-08 14:43:43.000000000 -0400
-@@ -22,6 +22,11 @@
+@@ -22,6 +22,18 @@
#include <stdio.h>
#include <unistd.h>
+#if defined(__NetBSD__) || defined(__DragonFly__)
+#include <sys/types.h>
+typedef off_t __off64_t;
++#elif defined(__sun)
++#ifdef _LARGEFILE64_SOURCE
++typedef off64_t __off64_t;
++#else
++typedef off_t __off64_t;
++#endif
++typedef off_t __off_t;
+#endif
+
#ifdef __cplusplus
diff --git a/graphics/libv4l/patches/patch-ad b/graphics/libv4l/patches/patch-ad
index 42b62b98364..5623bb671bb 100644
--- a/graphics/libv4l/patches/patch-ad
+++ b/graphics/libv4l/patches/patch-ad
@@ -1,4 +1,4 @@
-$NetBSD: patch-ad,v 1.4 2010/12/27 04:58:10 obache Exp $
+$NetBSD: patch-ad,v 1.5 2012/04/18 17:47:22 hans Exp $
* XXX
* `mode_t' is promoted to `int' when passwd through `...'.
@@ -17,10 +17,14 @@ $NetBSD: patch-ad,v 1.4 2010/12/27 04:58:10 obache Exp $
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
-@@ -69,6 +73,10 @@
+@@ -69,6 +73,14 @@
#include "libv4l2.h"
#include "libv4l2-priv.h"
++#ifdef __sun
++#define __off_t off_t
++#endif
++
+#ifndef MAP_ANONYMOUS
+#define MAP_ANONYMOUS MAP_ANON
+#endif
@@ -28,7 +32,7 @@ $NetBSD: patch-ad,v 1.4 2010/12/27 04:58:10 obache Exp $
/* Note these flags are stored together with the flags passed to v4l2_fd_open()
in v4l2_dev_info's flags member, so care should be taken that the do not
use the same bits! */
-@@ -154,7 +162,7 @@ static int v4l2_map_buffers(int index)
+@@ -154,7 +166,7 @@ static int v4l2_map_buffers(int index)
break;
}
@@ -37,7 +41,7 @@ $NetBSD: patch-ad,v 1.4 2010/12/27 04:58:10 obache Exp $
(size_t)buf.length, PROT_READ|PROT_WRITE, MAP_SHARED, devices[index].fd,
(__off_t)(buf.m.offset >> MMAP2_PAGE_SHIFT));
if (devices[index].frame_pointers[i] == MAP_FAILED) {
-@@ -408,7 +416,7 @@ int v4l2_open (const char *file, int ofl
+@@ -408,7 +420,7 @@ int v4l2_open (const char *file, int ofl
mode_t mode;
va_start (ap, oflag);
@@ -46,7 +50,19 @@ $NetBSD: patch-ad,v 1.4 2010/12/27 04:58:10 obache Exp $
fd = syscall(SYS_open, file, oflag, mode);
-@@ -871,7 +879,7 @@ int v4l2_ioctl (int fd, unsigned long in
+@@ -584,7 +596,11 @@ int v4l2_dup(int fd)
+ int index;
+
+ if ((index = v4l2_get_index(fd)) == -1)
++#ifdef __sun
++ return syscall(SYS_fcntl, fd, F_DUPFD, 0);
++#else
+ return syscall(SYS_dup, fd);
++#endif
+
+ devices[index].open_count++;
+
+@@ -871,7 +887,7 @@ int v4l2_ioctl (int fd, unsigned long in
but we need the buffer _now_ to write our converted data
to it! */
if (devices[index].convert_mmap_buf == MAP_FAILED) {
@@ -55,7 +71,7 @@ $NetBSD: patch-ad,v 1.4 2010/12/27 04:58:10 obache Exp $
(size_t)(
devices[index].no_frames *
V4L2_FRAME_BUF_SIZE),
-@@ -995,7 +1003,7 @@ void *v4l2_mmap(void *start, size_t leng
+@@ -995,7 +1011,7 @@ void *v4l2_mmap(void *start, size_t leng
return MAP_FAILED;
}
@@ -64,7 +80,7 @@ $NetBSD: patch-ad,v 1.4 2010/12/27 04:58:10 obache Exp $
(__off_t)(offset >> MMAP2_PAGE_SHIFT));
}
-@@ -1012,7 +1020,7 @@ void *v4l2_mmap(void *start, size_t leng
+@@ -1012,7 +1028,7 @@ void *v4l2_mmap(void *start, size_t leng
}
if (devices[index].convert_mmap_buf == MAP_FAILED) {
diff --git a/graphics/libv4l/patches/patch-ae b/graphics/libv4l/patches/patch-ae
index 4612fa4926c..5df34ff5191 100644
--- a/graphics/libv4l/patches/patch-ae
+++ b/graphics/libv4l/patches/patch-ae
@@ -1,4 +1,4 @@
-$NetBSD: patch-ae,v 1.3 2010/12/27 04:58:10 obache Exp $
+$NetBSD: patch-ae,v 1.4 2012/04/18 17:47:22 hans Exp $
--- libv4l2/log.c.orig 2008-09-08 14:45:43.000000000 -0400
+++ libv4l2/log.c 2008-09-08 14:47:53.000000000 -0400
@@ -10,7 +10,7 @@ $NetBSD: patch-ae,v 1.3 2010/12/27 04:58:10 obache Exp $
#include <linux/ioctl.h>
/* These headers are not needed by us, but by linux/videodev2.h,
which is broken on some systems and doesn't include them itself :( */
-@@ -25,9 +26,20 @@
+@@ -25,9 +26,28 @@
#include <asm/types.h>
/* end broken header workaround includes */
#include <linux/videodev2.h>
@@ -18,12 +18,20 @@ $NetBSD: patch-ae,v 1.3 2010/12/27 04:58:10 obache Exp $
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
++#ifdef __sun
++#include <sys/videodev2.h>
++#else
+#include <sys/videoio.h>
+#endif
++#endif
#include "libv4l2.h"
#include "libv4l2-priv.h"
-+#if defined(__NetBSD__) || defined(__DragonFly__)
++#if defined(__sun)
++#define IOCGROUP(x) (((x) >> 8) & 0xff)
++#endif
++
++#if defined(__NetBSD__) || defined(__DragonFly__) || defined(__sun)
+#define _IOC_NR(x) ((x) & 0xff)
+#define _IOC_TYPE IOCGROUP
+#endif
@@ -31,7 +39,7 @@ $NetBSD: patch-ae,v 1.3 2010/12/27 04:58:10 obache Exp $
#define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
FILE *v4l2_log_file = NULL;
-@@ -84,11 +96,13 @@
+@@ -84,11 +104,13 @@ static const char *v4l2_ioctls[] = {
[_IOC_NR(VIDIOC_ENUMAUDOUT)] = "VIDIOC_ENUMAUDOUT",
[_IOC_NR(VIDIOC_G_PRIORITY)] = "VIDIOC_G_PRIORITY",
[_IOC_NR(VIDIOC_S_PRIORITY)] = "VIDIOC_S_PRIORITY",
diff --git a/graphics/libv4l/patches/patch-af b/graphics/libv4l/patches/patch-af
index c0a5b00639c..2473aff1c96 100644
--- a/graphics/libv4l/patches/patch-af
+++ b/graphics/libv4l/patches/patch-af
@@ -1,4 +1,4 @@
-$NetBSD: patch-af,v 1.3 2011/01/07 15:20:45 obache Exp $
+$NetBSD: patch-af,v 1.4 2012/04/18 17:47:22 hans Exp $
* XXXX
* `mode_t' is promoted to `int' when passed through `...'.
@@ -22,7 +22,7 @@ $NetBSD: patch-af,v 1.3 2011/01/07 15:20:45 obache Exp $
/* These headers are not needed by us, but by linux/videodev2.h,
which is broken on some systems and doesn't include them itself :( */
#include <sys/time.h>
-@@ -36,8 +41,18 @@
+@@ -36,8 +41,22 @@
#include <linux/ioctl.h>
/* end broken header workaround includes */
#include <linux/videodev2.h>
@@ -30,8 +30,12 @@ $NetBSD: patch-af,v 1.3 2011/01/07 15:20:45 obache Exp $
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
++#ifdef __sun
++#include <sys/videodev2.h>
++#else
+#include <sys/videoio.h>
+#endif
++#endif
#include <libv4l2.h>
+#ifndef O_LARGEFILE
diff --git a/graphics/libv4l/patches/patch-aj b/graphics/libv4l/patches/patch-aj
index 30c236c5a3a..87aac11e6e4 100644
--- a/graphics/libv4l/patches/patch-aj
+++ b/graphics/libv4l/patches/patch-aj
@@ -1,13 +1,21 @@
-$NetBSD: patch-aj,v 1.1 2009/01/10 21:04:23 jmcneill Exp $
+$NetBSD: patch-aj,v 1.2 2012/04/18 17:47:22 hans Exp $
--- include/libv4l1.h.orig 2009-01-10 15:36:53.000000000 -0500
+++ include/libv4l1.h 2009-01-10 15:37:29.000000000 -0500
-@@ -57,6 +57,10 @@ LIBV4L_PUBLIC extern FILE *v4l1_log_file
+@@ -57,6 +57,18 @@ LIBV4L_PUBLIC extern FILE *v4l1_log_file
capture formats, like hw specific bayer compression methods).
*/
-+#ifndef __off64_t
-+#define __off64_t off_t
++#if defined(__NetBSD__) || defined(__DragonFly__)
++#include <sys/types.h>
++typedef off_t __off64_t;
++#elif defined(__sun)
++#ifdef _LARGEFILE64_SOURCE
++typedef off64_t __off64_t;
++#else
++typedef off_t __off64_t;
++#endif
++typedef off_t __off_t;
+#endif
+
LIBV4L_PUBLIC int v4l1_open (const char *file, int oflag, ...);
diff --git a/graphics/libv4l/patches/patch-ak b/graphics/libv4l/patches/patch-ak
index 1581eaf57c3..32b2f222f9b 100644
--- a/graphics/libv4l/patches/patch-ak
+++ b/graphics/libv4l/patches/patch-ak
@@ -1,4 +1,4 @@
-$NetBSD: patch-ak,v 1.3 2011/01/07 15:20:45 obache Exp $
+$NetBSD: patch-ak,v 1.4 2012/04/18 17:47:22 hans Exp $
* XXX
* 'mode_t' is promoted to `int' when passwd through `...'.
@@ -20,7 +20,7 @@ $NetBSD: patch-ak,v 1.3 2011/01/07 15:20:45 obache Exp $
/* These headers are not needed by us, but by linux/videodev2.h,
which is broken on some systems and doesn't include them itself :( */
#include <sys/time.h>
-@@ -58,10 +59,20 @@
+@@ -58,10 +59,24 @@
/* end broken header workaround includes */
#include <linux/videodev.h>
#include <linux/videodev2.h>
@@ -28,8 +28,12 @@ $NetBSD: patch-ak,v 1.3 2011/01/07 15:20:45 obache Exp $
+#include <sys/syscall.h>
+#include <sys/ioctl.h>
+#include "videodev.h"
++#ifdef __sun
++#include <sys/videodev2.h>
++#else
+#include <sys/videoio.h>
+#endif
++#endif
#include <libv4l2.h>
#include "libv4l1.h"
#include "libv4l1-priv.h"
@@ -50,3 +54,15 @@ $NetBSD: patch-ak,v 1.3 2011/01/07 15:20:45 obache Exp $
fd = syscall(SYS_open, file, oflag, mode);
+@@ -434,7 +449,11 @@ int v4l1_dup(int fd)
+ int index;
+
+ if ((index = v4l1_get_index(fd)) == -1)
++#ifdef __sun
++ return syscall(SYS_fcntl, fd, F_DUPFD, 0);
++#else
+ return syscall(SYS_dup, fd);
++#endif
+
+ devices[index].open_count++;
+
diff --git a/graphics/libv4l/patches/patch-al b/graphics/libv4l/patches/patch-al
index f8acd2722ed..b2edf031261 100644
--- a/graphics/libv4l/patches/patch-al
+++ b/graphics/libv4l/patches/patch-al
@@ -1,4 +1,4 @@
-$NetBSD: patch-al,v 1.1 2009/01/10 21:04:23 jmcneill Exp $
+$NetBSD: patch-al,v 1.2 2012/04/18 17:47:22 hans Exp $
--- libv4l1/log.c.orig 2008-08-06 04:46:13.000000000 -0400
+++ libv4l1/log.c 2009-01-10 15:56:48.000000000 -0500
@@ -10,16 +10,23 @@ $NetBSD: patch-al,v 1.1 2009/01/10 21:04:23 jmcneill Exp $
#include <linux/ioctl.h>
/* These headers are not needed by us, but by linux/videodev2.h,
which is broken on some systems and doesn't include them itself :( */
-@@ -25,8 +26,19 @@
+@@ -25,8 +26,26 @@
#include <asm/types.h>
/* end broken header workaround includes */
#include <linux/videodev.h>
+#else
++#ifdef __sun
++#include <sys/ioccom.h>
++#endif
+#include <sys/ioctl.h>
+#include "videodev.h"
+#endif
#include "libv4l1-priv.h"
++#if defined(__sun)
++#define IOCGROUP(x) (((x) >> 8) & 0xff)
++#endif
++
+#ifndef _IOC_NR
+#define _IOC_NR(x) ((x) & 0xff)
+#endif