[Slackbuilds-users] libdv: a problem and a possible fix

Luiz Carlos Ramos lramos.prof at yahoo.com.br
Thu May 26 13:46:25 UTC 2016


Hello,

recently I've built libdv using the slackbuild, and got a problem.

Basically, the source libdv/enc_input.c uses a macro (VIDEO_MAX_FRAME)
possibly defined in /usr/include/linux/videodev.h. Looking at that file,
the macro isn't defined, and so the build process stop with a proper
error.

I have to say I'm not using the stock kernel, but 3.16.3. I 
don't know if this problem is specific to this kernel or if it applies
to the stock 14.1 kernel as well (or to -current).

Making some investigation, I've found that this macro is defined at
/usr/include/linux/videodev2.h, and it's defined with 32. Also,
at least one case was solved defining this macro at the application
level, such as
https://lists.debian.org/debian-glibc/2006/07/msg00149.html, for
instance (although recognizing this case is not about libdv at all).

What I did was defining that macro in libdv/enc_input.c if it's not
still not defined. I've built a patch to that file and included it at
the SlackBuild script. The git patch goes attached.

Another option, which I didn't try, was to substitute #include videodev.h to
#include videodev2.h.

Hope this can help the community!

Cheers,

Luiz Ramos
lramos dot prof at yahoo dot com dot br
São Paulo - Brazil

-------------- next part --------------
>From 545f558d8e93bbde200b8ad51f8e87c572c1b69e Mon Sep 17 00:00:00 2001
From: Luiz Ramos <lramos.prof at yahoo.com.br>
Date: Thu, 26 May 2016 10:23:07 -0300
Subject: [PATCH] libraries/libdv: fixed compilation

Included a patch to libdv/enc_input.c, to define VIDEO_MAX_FRAME if
/usr/include/linux/videodev.h doesn't have it already defined.

-- Luiz Ramos, 26/May/2016
---
 libraries/libdv/01-define-video-max-frame.patch | 13 +++++++++++++
 libraries/libdv/libdv.SlackBuild                |  2 ++
 2 files changed, 15 insertions(+)
 create mode 100644 libraries/libdv/01-define-video-max-frame.patch

diff --git a/libraries/libdv/01-define-video-max-frame.patch b/libraries/libdv/01-define-video-max-frame.patch
new file mode 100644
index 0000000000000000000000000000000000000000..4074b5b4b675810e2aac4ffe4f02b36d6fa123ee
--- /dev/null
+++ b/libraries/libdv/01-define-video-max-frame.patch
@@ -0,0 +1,13 @@
+diff -urpN a/libdv/enc_input.c b/libdv/enc_input.c
+--- a/libdv/enc_input.c	2004-10-20 00:49:24.000000000 -0300
++++ b/libdv/enc_input.c	2016-05-25 23:26:24.211085619 -0300
+@@ -51,6 +51,9 @@
+ #define _LINUX_TIME_H
+ #include <sys/types.h>
+ #include <linux/videodev.h>
++#ifndef VIDEO_MAX_FRAME
++#define VIDEO_MAX_FRAME	32
++#endif
+ #include <sys/time.h>
+ #include <unistd.h>
+ #include <fcntl.h>
diff --git a/libraries/libdv/libdv.SlackBuild b/libraries/libdv/libdv.SlackBuild
index 845e7d9076c091f4fb3dc8020c861edee82afd07..50d14671002bcdc8c5f2ccdb3d71b880172a9af4 100644
--- a/libraries/libdv/libdv.SlackBuild
+++ b/libraries/libdv/libdv.SlackBuild
@@ -83,6 +83,8 @@ CXXFLAGS="$SLKCFLAGS" \
   --disable-gtktest \
   --build=$ARCH-slackware-linux
 
+patch -p1 -i${CWD}/01-define-video-max-frame.patch
+
 make
 make install-strip DESTDIR=$PKG
 
-- 
2.8.2



More information about the SlackBuilds-users mailing list