linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches
@ 2019-04-09 12:38 Руслан Ижбулатов
  2019-04-09 12:38 ` [PATCH 1/8] [PATCH for ZBar] Include windows.h for vfw Руслан Ижбулатов
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Руслан Ижбулатов @ 2019-04-09 12:38 UTC (permalink / raw)
  To: linux-media

Here's a few patches that might be useful.

Руслан Ижбулатов (8):
  Include windows.h for vfw
  Specify correct path to barcode.png
  Check for clock_gettime on pthread library as well
  Disable zbarcam-gtk on Windows
  Use -no-undefined for libzbargtk
  Make zbargtk build on Windows
  Make use of glib thread names
  Correctly generate version.xml and reldate.xml

 Makefile.am             |  2 +-
 configure.ac            |  8 ++++----
 gtk/Makefile.am.inc     |  2 +-
 gtk/zbargtk.c           | 12 +++++++++++-
 zbarcam/Makefile.am.inc |  2 ++
 5 files changed, 19 insertions(+), 7 deletions(-)

-- 
2.4.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/8] [PATCH for ZBar] Include windows.h for vfw
  2019-04-09 12:38 [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches Руслан Ижбулатов
@ 2019-04-09 12:38 ` Руслан Ижбулатов
  2019-04-09 12:38 ` [PATCH 2/8] [PATCH for ZBar] Specify correct path to barcode.png Руслан Ижбулатов
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Руслан Ижбулатов @ 2019-04-09 12:38 UTC (permalink / raw)
  To: linux-media

vfw.h can't be included without windows.h to supply basic type definitions.

Signed-off-by: Руслан Ижбулатов <lrn1986@gmail.com>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 58b97ec..6e092e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -257,7 +257,7 @@ configure --disable-video to skip building video support.])],
         )],
   [AC_CHECK_HEADERS([vfw.h], [with_video="vfw"],
     [AC_MSG_FAILURE([test for VfW video support failed!
-configure --disable-video to skip building video support.])])])
+configure --disable-video to skip building video support.])],[#include <windows.h>])])
 
 AS_IF([test "x$have_libv4l" = "xyes"],
    [PKG_CHECK_MODULES([V4L2], [libv4l2], [],
-- 
2.4.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/8] [PATCH for ZBar] Specify correct path to barcode.png
  2019-04-09 12:38 [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches Руслан Ижбулатов
  2019-04-09 12:38 ` [PATCH 1/8] [PATCH for ZBar] Include windows.h for vfw Руслан Ижбулатов
@ 2019-04-09 12:38 ` Руслан Ижбулатов
  2019-04-09 12:38 ` [PATCH 3/8] [PATCH for ZBar] Check for clock_gettime on pthread library as well Руслан Ижбулатов
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Руслан Ижбулатов @ 2019-04-09 12:38 UTC (permalink / raw)
  To: linux-media

$(srcdir)/examples/barcode.png does not exist anymore.

Signed-off-by: Руслан Ижбулатов <lrn1986@gmail.com>
---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index c767d15..a9367b3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,7 +73,7 @@ EXTRA_DIST += perl/MANIFEST perl/README perl/Changes perl/COPYING.LIB \
 
 if WIN32
 dist_doc_DATA += README.windows
-pkgdata_DATA = $(srcdir)/examples/barcode.png \
+pkgdata_DATA = $(srcdir)/python/test/barcode.png \
     $(srcdir)/examples/scan_image.cpp $(srcdir)/examples/scan_image.vcproj
 
 %-rc.o: %.rc
-- 
2.4.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/8] [PATCH for ZBar] Check for clock_gettime on pthread library as well
  2019-04-09 12:38 [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches Руслан Ижбулатов
  2019-04-09 12:38 ` [PATCH 1/8] [PATCH for ZBar] Include windows.h for vfw Руслан Ижбулатов
  2019-04-09 12:38 ` [PATCH 2/8] [PATCH for ZBar] Specify correct path to barcode.png Руслан Ижбулатов
@ 2019-04-09 12:38 ` Руслан Ижбулатов
  2019-04-09 12:38 ` [PATCH 4/8] [PATCH for ZBar] Disable zbarcam-gtk on Windows Руслан Ижбулатов
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Руслан Ижбулатов @ 2019-04-09 12:38 UTC (permalink / raw)
  To: linux-media

On Windows that function might be in libpthread.

Signed-off-by: Руслан Ижбулатов <lrn1986@gmail.com>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 6e092e0..3224888 100644
--- a/configure.ac
+++ b/configure.ac
@@ -183,7 +183,7 @@ ZBAR_CHK_CODE([pdf417], [PDF417 symbology (incomplete)])
 
 dnl libraries
 
-AC_SEARCH_LIBS([clock_gettime], [rt])
+AC_SEARCH_LIBS([clock_gettime], [rt pthread])
 AM_ICONV()
 
 dnl libraries linkage
-- 
2.4.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/8] [PATCH for ZBar] Disable zbarcam-gtk on Windows
  2019-04-09 12:38 [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches Руслан Ижбулатов
                   ` (2 preceding siblings ...)
  2019-04-09 12:38 ` [PATCH 3/8] [PATCH for ZBar] Check for clock_gettime on pthread library as well Руслан Ижбулатов
@ 2019-04-09 12:38 ` Руслан Ижбулатов
  2019-04-09 12:38 ` [PATCH 5/8] [PATCH for ZBar] Use -no-undefined for libzbargtk Руслан Ижбулатов
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Руслан Ижбулатов @ 2019-04-09 12:38 UTC (permalink / raw)
  To: linux-media

It requires scan_video.c, which includes linux/videodev2.h, so
the code is clearly not meant to be built for Windows, even if
GTK is available there.

Signed-off-by: Руслан Ижбулатов <lrn1986@gmail.com>
---
 zbarcam/Makefile.am.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/zbarcam/Makefile.am.inc b/zbarcam/Makefile.am.inc
index b112783..ad16d3c 100644
--- a/zbarcam/Makefile.am.inc
+++ b/zbarcam/Makefile.am.inc
@@ -5,12 +5,14 @@ zbarcam_zbarcam_LDADD = zbar/libzbar.la
 CLEANFILES += zbarcam/.libs/zbarcam zbarcam/moc_zbarcam_qt.h
 
 if HAVE_GTK
+if !WIN32
 bin_PROGRAMS += zbarcam/zbarcam-gtk
 zbarcam_zbarcam_gtk_SOURCES = zbarcam/zbarcam-gtk.c zbarcam/scan_video.c
 zbarcam_zbarcam_gtk_CPPFLAGS = $(GTK_CFLAGS) $(AM_CPPFLAGS)
 zbarcam_zbarcam_gtk_LDADD = $(GTK_LIBS) gtk/libzbargtk.la zbar/libzbar.la \
 	$(AM_LDADD)
 endif
+endif
 
 if HAVE_QT
 bin_PROGRAMS += zbarcam/zbarcam-qt
-- 
2.4.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/8] [PATCH for ZBar] Use -no-undefined for libzbargtk
  2019-04-09 12:38 [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches Руслан Ижбулатов
                   ` (3 preceding siblings ...)
  2019-04-09 12:38 ` [PATCH 4/8] [PATCH for ZBar] Disable zbarcam-gtk on Windows Руслан Ижбулатов
@ 2019-04-09 12:38 ` Руслан Ижбулатов
  2019-04-09 12:38 ` [PATCH 6/8] [PATCH for ZBar] Make zbargtk build on Windows Руслан Ижбулатов
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Руслан Ижбулатов @ 2019-04-09 12:38 UTC (permalink / raw)
  To: linux-media

-no-undefined is required to build shlibs on Windows.
Doesn't hurt on other platforms either (unless a shlib is built
with undefined symbols by design, which is not the case here).

Signed-off-by: Руслан Ижбулатов <lrn1986@gmail.com>
---
 gtk/Makefile.am.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gtk/Makefile.am.inc b/gtk/Makefile.am.inc
index 406fd86..f7e8e6c 100644
--- a/gtk/Makefile.am.inc
+++ b/gtk/Makefile.am.inc
@@ -1,7 +1,7 @@
 lib_LTLIBRARIES += gtk/libzbargtk.la
 gtk_libzbargtk_la_CPPFLAGS = -Igtk $(GTK_CFLAGS) $(AM_CPPFLAGS)
 gtk_libzbargtk_la_LDFLAGS = -version-info $(ZGTK_LIB_VERSION) \
-    -export-symbols-regex "^zbar_gtk_.*" $(AM_LDFLAGS)
+    -export-symbols-regex "^zbar_gtk_.*" $(AM_LDFLAGS) -no-undefined
 gtk_libzbargtk_la_LIBADD = $(GTK_LIBS) zbar/libzbar.la $(AM_LIBADD)
 
 dist_gtk_libzbargtk_la_SOURCES = gtk/zbargtk.c gtk/zbargtkprivate.h
-- 
2.4.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/8] [PATCH for ZBar] Make zbargtk build on Windows
  2019-04-09 12:38 [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches Руслан Ижбулатов
                   ` (4 preceding siblings ...)
  2019-04-09 12:38 ` [PATCH 5/8] [PATCH for ZBar] Use -no-undefined for libzbargtk Руслан Ижбулатов
@ 2019-04-09 12:38 ` Руслан Ижбулатов
  2019-04-09 12:38 ` [PATCH 7/8] [PATCH for ZBar] Make use of glib thread names Руслан Ижбулатов
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Руслан Ижбулатов @ 2019-04-09 12:38 UTC (permalink / raw)
  To: linux-media

The code is mostly platform-agnostic, except for this small part
that is written for X. Add ifdefs with an appropriate W32 header,
and call zbar_window_attach() with correct W32 arguments.
Use HAVE_X as a condition.

Signed-off-by: Руслан Ижбулатов <lrn1986@gmail.com>
---
 gtk/zbargtk.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gtk/zbargtk.c b/gtk/zbargtk.c
index c7e05e3..595acfe 100644
--- a/gtk/zbargtk.c
+++ b/gtk/zbargtk.c
@@ -22,7 +22,11 @@
  *------------------------------------------------------------------------*/
 
 #include <gtk/gtksignal.h>
+#ifdef HAVE_X
 #include <gdk/gdkx.h>
+#elif defined(_WIN32)
+#include <gdk/gdkwin32.h>
+#endif
 
 #include <zbar/zbargtk.h>
 #include "zbargtkprivate.h"
@@ -380,9 +384,15 @@ static void zbar_gtk_realize (GtkWidget *widget)
     gdk_window_set_back_pixmap(widget->window, NULL, TRUE);
 
     /* attach zbar_window to underlying X window */
+#ifdef HAVE_X
     if(zbar_window_attach(zbar->window,
                            gdk_x11_drawable_get_xdisplay(widget->window),
                            gdk_x11_drawable_get_xid(widget->window)))
+#elif defined(_WIN32)
+    if(zbar_window_attach(zbar->window,
+                           GDK_WINDOW_HWND (widget->window),
+                           0))
+#endif
         zbar_window_error_spew(zbar->window, 0);
 }
 
-- 
2.4.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/8] [PATCH for ZBar] Make use of glib thread names
  2019-04-09 12:38 [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches Руслан Ижбулатов
                   ` (5 preceding siblings ...)
  2019-04-09 12:38 ` [PATCH 6/8] [PATCH for ZBar] Make zbargtk build on Windows Руслан Ижбулатов
@ 2019-04-09 12:38 ` Руслан Ижбулатов
  2019-04-09 12:38 ` [PATCH 8/8] [PATCH for ZBar] Correctly generate version.xml and reldate.xml Руслан Ижбулатов
  2019-04-25 12:05 ` [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches Mauro Carvalho Chehab
  8 siblings, 0 replies; 10+ messages in thread
From: Руслан Ижбулатов @ 2019-04-09 12:38 UTC (permalink / raw)
  To: linux-media

This is optional, but why not use it?

Signed-off-by: Руслан Ижбулатов <lrn1986@gmail.com>
---
 gtk/zbargtk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gtk/zbargtk.c b/gtk/zbargtk.c
index 595acfe..c16f05c 100644
--- a/gtk/zbargtk.c
+++ b/gtk/zbargtk.c
@@ -637,7 +637,7 @@ static void zbar_gtk_init (ZBarGtk *self)
 
     /* spawn a thread to handle decoding and video */
     zbar->queue = g_async_queue_new();
-    zbar->thread = g_thread_new(NULL, zbar_gtk_processing_thread, self);
+    zbar->thread = g_thread_new("zbar gtk processing thread", zbar_gtk_processing_thread, self);
     g_assert(zbar->thread);
 }
 
-- 
2.4.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 8/8] [PATCH for ZBar] Correctly generate version.xml and reldate.xml
  2019-04-09 12:38 [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches Руслан Ижбулатов
                   ` (6 preceding siblings ...)
  2019-04-09 12:38 ` [PATCH 7/8] [PATCH for ZBar] Make use of glib thread names Руслан Ижбулатов
@ 2019-04-09 12:38 ` Руслан Ижбулатов
  2019-04-25 12:05 ` [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches Mauro Carvalho Chehab
  8 siblings, 0 replies; 10+ messages in thread
From: Руслан Ижбулатов @ 2019-04-09 12:38 UTC (permalink / raw)
  To: linux-media

The buildsystem expects these files to be in srcdir, so
put them there. Otherwise documentation won't build
(xmlto complains that it can't find the files. Note that
it uses an absolute path, so there's no way to solve this
with its --searchpath argument).

Signed-off-by: Руслан Ижбулатов <lrn1986@gmail.com>
---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3224888..41d77fd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -667,14 +667,14 @@ AC_CONFIG_COMMANDS([doc/version.xml],
   [AS_IF([test -f doc/version.xml && \
           ! echo $VERSION | diff doc/version.xml - >/dev/null 2>&1 || \
           ! echo $VERSION | diff $srcdir/doc/version.xml - >/dev/null 2>&1 ],
-    [echo "writing new doc/version.xml" ; echo $VERSION > doc/version.xml ])],
+    [echo "writing new doc/version.xml" ; echo $VERSION > $srcdir/doc/version.xml ])],
   [VERSION="$VERSION"]
 )
 AC_CONFIG_COMMANDS([doc/reldate.xml],
   [AS_IF([test -f doc/reldate.xml && \
           ! echo $RELDATE | diff doc/reldate.xml - >/dev/null 2>&1 || \
           ! echo $RELDATE | diff $srcdir/doc/reldate.xml - >/dev/null 2>&1 ],
-    [echo "writing new doc/reldate.xml" ; echo $RELDATE > doc/reldate.xml ])],
+    [echo "writing new doc/reldate.xml" ; echo $RELDATE > $srcdir/doc/reldate.xml ])],
   [RELDATE="$RELDATE"]
 )
 
-- 
2.4.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches
  2019-04-09 12:38 [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches Руслан Ижбулатов
                   ` (7 preceding siblings ...)
  2019-04-09 12:38 ` [PATCH 8/8] [PATCH for ZBar] Correctly generate version.xml and reldate.xml Руслан Ижбулатов
@ 2019-04-25 12:05 ` Mauro Carvalho Chehab
  8 siblings, 0 replies; 10+ messages in thread
From: Mauro Carvalho Chehab @ 2019-04-25 12:05 UTC (permalink / raw)
  To: Руслан
	Ижбулатов
  Cc: linux-media

Em Tue,  9 Apr 2019 12:38:34 +0000
Руслан Ижбулатов         <lrn1986@gmail.com> escreveu:

> Here's a few patches that might be useful.
> 
> Руслан Ижбулатов (8):
>   Include windows.h for vfw
>   Specify correct path to barcode.png
>   Check for clock_gettime on pthread library as well
>   Disable zbarcam-gtk on Windows
>   Use -no-undefined for libzbargtk
>   Make zbargtk build on Windows
>   Make use of glib thread names
>   Correctly generate version.xml and reldate.xml

Thank you for the patches. Applied today, and launched a new
ZBar version (0.22.1) with the build corrections.

> 
>  Makefile.am             |  2 +-
>  configure.ac            |  8 ++++----
>  gtk/Makefile.am.inc     |  2 +-
>  gtk/zbargtk.c           | 12 +++++++++++-
>  zbarcam/Makefile.am.inc |  2 ++
>  5 files changed, 19 insertions(+), 7 deletions(-)
> 

Thanks,
Mauro

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-04-25 12:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-09 12:38 [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches Руслан Ижбулатов
2019-04-09 12:38 ` [PATCH 1/8] [PATCH for ZBar] Include windows.h for vfw Руслан Ижбулатов
2019-04-09 12:38 ` [PATCH 2/8] [PATCH for ZBar] Specify correct path to barcode.png Руслан Ижбулатов
2019-04-09 12:38 ` [PATCH 3/8] [PATCH for ZBar] Check for clock_gettime on pthread library as well Руслан Ижбулатов
2019-04-09 12:38 ` [PATCH 4/8] [PATCH for ZBar] Disable zbarcam-gtk on Windows Руслан Ижбулатов
2019-04-09 12:38 ` [PATCH 5/8] [PATCH for ZBar] Use -no-undefined for libzbargtk Руслан Ижбулатов
2019-04-09 12:38 ` [PATCH 6/8] [PATCH for ZBar] Make zbargtk build on Windows Руслан Ижбулатов
2019-04-09 12:38 ` [PATCH 7/8] [PATCH for ZBar] Make use of glib thread names Руслан Ижбулатов
2019-04-09 12:38 ` [PATCH 8/8] [PATCH for ZBar] Correctly generate version.xml and reldate.xml Руслан Ижбулатов
2019-04-25 12:05 ` [PATCH 0/8] [PATCH for ZBar] MinGW compatibility patches Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).