diff --git a/packages/multimedia/zvbi/package.mk b/packages/multimedia/zvbi/package.mk new file mode 100644 index 0000000000..32a2f26ed4 --- /dev/null +++ b/packages/multimedia/zvbi/package.mk @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2020-present Team LibreELEC (https://libreelec.tv) + +PKG_NAME="zvbi" +PKG_VERSION="0.2.35" +PKG_SHA256="fc883c34111a487c4a783f91b1b2bb5610d8d8e58dcba80c7ab31e67e4765318" +PKG_LICENSE="GPL2" +PKG_SITE="http://zapping.sourceforge.net/ZVBI" +PKG_URL="https://downloads.sourceforge.net/sourceforge/zapping/zvbi-${PKG_VERSION}.tar.bz2" +PKG_DEPENDS_TARGET="toolchain libpng zlib" +PKG_LONGDESC="Library to provide functions to capture and decode VBI data." + +PKG_CONFIGURE_OPTS_TARGET="--disable-dvb \ + --disable-bktr \ + --disable-nls \ + --disable-proxy \ + --without-doxygen \ + --without-x" diff --git a/packages/multimedia/zvbi/patches/zvbi-0010-fix-static-linking.patch b/packages/multimedia/zvbi/patches/zvbi-0010-fix-static-linking.patch new file mode 100644 index 0000000000..3988a3e212 --- /dev/null +++ b/packages/multimedia/zvbi/patches/zvbi-0010-fix-static-linking.patch @@ -0,0 +1,41 @@ +--- a/configure ++++ b/configure +@@ -16515,7 +16515,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_destroy_write_struct" >&5 + $as_echo "$ac_cv_lib_png_png_destroy_write_struct" >&6; } + if test "x$ac_cv_lib_png_png_destroy_write_struct" = x""yes; then : +- LIBS="$LIBS -lpng -lz" ++ LIBS="-lpng -lz $LIBS" + else + HAVE_PNG="no" + fi +--- a/configure.in ++++ b/configure.in +@@ -244,7 +244,7 @@ dnl (PNG page export) + dnl + HAVE_PNG="yes" + AC_CHECK_LIB(png, png_destroy_write_struct, +- LIBS="$LIBS -lpng -lz", HAVE_PNG="no", -lz -lm) ++ LIBS="-lpng $LIBS -lz -lm", HAVE_PNG="no", -lz -lm) + if test "x$HAVE_PNG" = xyes; then + AC_DEFINE(HAVE_LIBPNG, 1, [Define if you have libpng]) + fi +--- a/examples/Makefile.am ++++ b/examples/Makefile.am +@@ -19,4 +19,4 @@ EXTRA_DIST = \ + INCLUDES = -I$(top_srcdir)/src + + LDADD = $(top_builddir)/src/libzvbi.la \ +- $(PTHREAD_LIB) -lm $(PNG_LIB) ++ $(PTHREAD_LIB) $(PNG_LIB) -lm +--- a/examples/Makefile.in ++++ b/examples/Makefile.in +@@ -262,7 +262,7 @@ EXTRA_DIST = \ + + INCLUDES = -I$(top_srcdir)/src + LDADD = $(top_builddir)/src/libzvbi.la \ +- $(PTHREAD_LIB) -lm $(PNG_LIB) ++ $(PTHREAD_LIB) $(PNG_LIB) -lm + + all: all-am + diff --git a/packages/multimedia/zvbi/patches/zvbi-0020-ioctl.patch b/packages/multimedia/zvbi/patches/zvbi-0020-ioctl.patch new file mode 100644 index 0000000000..4af7cb1a53 --- /dev/null +++ b/packages/multimedia/zvbi/patches/zvbi-0020-ioctl.patch @@ -0,0 +1,18 @@ +--- a/contrib/ntsc-cc.c ++++ b/contrib/ntsc-cc.c +@@ -32,7 +32,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -45,6 +44,7 @@ + #include "src/libzvbi.h" + + #ifdef ENABLE_V4L2 ++# include + # include + # include "src/videodev2k.h" + #endif diff --git a/packages/multimedia/zvbi/patches/zvbi-0030-ssize_max.patch b/packages/multimedia/zvbi/patches/zvbi-0030-ssize_max.patch new file mode 100644 index 0000000000..efad9aa898 --- /dev/null +++ b/packages/multimedia/zvbi/patches/zvbi-0030-ssize_max.patch @@ -0,0 +1,28 @@ +Linear memory extents over SSIZE_MAX are undefined, so there is no +point in protecting against them. +--- a/src/export.c ++++ b/src/export.c +@@ -1056,8 +1056,6 @@ + size_t count; + + count = src_size; +- if (unlikely (src_size > SSIZE_MAX)) +- count = SSIZE_MAX & -4096; + + for (retry = 10;; --retry) { + actual = write (e->_handle.fd, src, count); +@@ -1614,12 +1612,7 @@ + free (e->buffer.data); + } + +- if (unlikely (e->buffer.offset > (size_t) SSIZE_MAX)) { +- errno = EOVERFLOW; +- actual = -1; /* failed */ +- } else { +- actual = e->buffer.offset; +- } ++ actual = e->buffer.offset; + } else { + if (VBI_EXPORT_TARGET_ALLOC == e->target) + free (e->buffer.data); + diff --git a/packages/multimedia/zvbi/patches/zvbi-0040-fix-clang-support.patch b/packages/multimedia/zvbi/patches/zvbi-0040-fix-clang-support.patch new file mode 100644 index 0000000000..42ace29b2b --- /dev/null +++ b/packages/multimedia/zvbi/patches/zvbi-0040-fix-clang-support.patch @@ -0,0 +1,29 @@ +--- a/src/misc.h ++++ b/src/misc.h +@@ -52,17 +52,6 @@ + # define unlikely(expr) __builtin_expect(expr, 0) + #endif + +-#undef __i386__ +-#undef __i686__ +-/* FIXME #cpu is deprecated +-#if #cpu (i386) +-# define __i386__ 1 +-#endif +-#if #cpu (i686) +-# define __i686__ 1 +-#endif +-*/ +- + /* &x == PARENT (&x.tm_min, struct tm, tm_min), + safer than &x == (struct tm *) &x.tm_min. A NULL _ptr is safe and + will return NULL, not -offsetof(_member). */ +@@ -156,8 +145,6 @@ + + #define likely(expr) (expr) + #define unlikely(expr) (expr) +-#undef __i386__ +-#undef __i686__ + + static char * + PARENT_HELPER (char *p, unsigned int offset) diff --git a/packages/multimedia/zvbi/patches/zvbi-0050-prevent-test.patch b/packages/multimedia/zvbi/patches/zvbi-0050-prevent-test.patch new file mode 100644 index 0000000000..e97cee3811 --- /dev/null +++ b/packages/multimedia/zvbi/patches/zvbi-0050-prevent-test.patch @@ -0,0 +1,76 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -22,8 +22,6 @@ SUBDIRS = \ + src \ + $(proxy_dirs) \ + contrib \ +- examples \ +- test \ + po \ + doc + +--- a/Makefile.in ++++ b/Makefile.in +@@ -78,7 +78,7 @@ pkgconfigDATA_INSTALL = $(INSTALL_DATA) + DATA = $(pkgconfig_DATA) + ETAGS = etags + CTAGS = ctags +-DIST_SUBDIRS = m4 src daemon contrib examples test po doc ++DIST_SUBDIRS = m4 src daemon contrib po doc + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + distdir = $(PACKAGE)-$(VERSION) + top_distdir = $(distdir) +@@ -268,8 +268,6 @@ SUBDIRS = \ + src \ + $(proxy_dirs) \ + contrib \ +- examples \ +- test \ + po \ + doc + +--- a/configure ++++ b/configure +@@ -18591,7 +18591,7 @@ else + fi + + +-ac_config_files="$ac_config_files Makefile contrib/Makefile examples/Makefile daemon/Makefile daemon/zvbid.init doc/Doxyfile doc/Makefile m4/Makefile src/Makefile src/dvb/Makefile test/Makefile po/Makefile.in zvbi.spec zvbi-0.2.pc" ++ac_config_files="$ac_config_files Makefile contrib/Makefile daemon/Makefile daemon/zvbid.init doc/Doxyfile doc/Makefile m4/Makefile src/Makefile src/dvb/Makefile po/Makefile.in zvbi.spec zvbi-0.2.pc" + + cat >confcache <<\_ACEOF + # This file is a shell script that caches the results of configure +@@ -19726,7 +19726,6 @@ do + "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;; +- "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "daemon/Makefile") CONFIG_FILES="$CONFIG_FILES daemon/Makefile" ;; + "daemon/zvbid.init") CONFIG_FILES="$CONFIG_FILES daemon/zvbid.init" ;; + "doc/Doxyfile") CONFIG_FILES="$CONFIG_FILES doc/Doxyfile" ;; +@@ -19734,7 +19733,6 @@ do + "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/dvb/Makefile") CONFIG_FILES="$CONFIG_FILES src/dvb/Makefile" ;; +- "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "zvbi.spec") CONFIG_FILES="$CONFIG_FILES zvbi.spec" ;; + "zvbi-0.2.pc") CONFIG_FILES="$CONFIG_FILES zvbi-0.2.pc" ;; +--- a/configure.in ++++ b/configure.in +@@ -384,7 +384,6 @@ AM_CONDITIONAL(BUILD_STATIC_LIB, [test "x$enable_static" = xyes]) + AC_OUTPUT([ + Makefile + contrib/Makefile +- examples/Makefile + daemon/Makefile + daemon/zvbid.init + doc/Doxyfile +@@ -392,7 +391,6 @@ AC_OUTPUT([ + m4/Makefile + src/Makefile + src/dvb/Makefile +- test/Makefile + po/Makefile.in + zvbi.spec + zvbi-0.2.pc