[gitg] Use the right gio-unix or gio-win32 depending on the platform
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Use the right gio-unix or gio-win32 depending on the platform
- Date: Mon, 21 Dec 2015 10:20:52 +0000 (UTC)
commit 3cd321d46b172cb7322741ac37ed281318605758
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Mon Dec 21 11:20:10 2015 +0100
Use the right gio-unix or gio-win32 depending on the platform
configure.ac | 39 ++++++++++++++++++++----------------
libgitg-1.0.pc.in | 2 +-
libgitg-ext/libgitg-ext-1.0.pc.in | 2 +-
libgitg/Makefile.am | 2 +-
libgitg/gitg-hook.vala | 4 +++
libgitg/libgitg-1.0.pc.in | 2 +-
6 files changed, 30 insertions(+), 21 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 52e8896..6e9a424 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,6 +37,7 @@ AC_PROG_MAKE_SET
AC_PATH_PROG(GZIP, gzip)
AC_PROG_MKDIR_P
AM_PROG_VALAC([0.20.1.23])
+PKG_PROG_PKG_CONFIG
AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources)
@@ -92,13 +93,32 @@ INTROSPECTION_REQUIRED=0.10.1
LIBGIT2_GLIB_REQUIRED_VERSION=0.23.5
LIBGIT2_GLIB_REQUIRED_MAX_VERSION=0.24.0
+gdk_targets=`$PKG_CONFIG --variable=targets gdk-3.0`
+
+for target in $gdk_targets;
+do
+ case "$target" in
+ quartz)
+ gdk_windowing_quartz=yes
+ GIO_SYSTEM_PKG=gio-unix-2.0
+ ;;
+ win32)
+ gdk_windowing_win32=yes
+ GIO_SYSTEM_PKG=gio-win32-2.0
+ ;;
+ x11)
+ gdk_windowing_x11=yes
+ GIO_SYSTEM_PKG=gio-unix-2.0
+ esac
+done
+
PKG_CHECK_MODULES(LIBGITG, [
gthread-2.0 >= $GLIB_REQUIRED_VERSION
glib-2.0 >= $GLIB_REQUIRED_VERSION
gobject-2.0 >= $GLIB_REQUIRED_VERSION
gmodule-2.0 >= $GLIB_REQUIRED_VERSION
gio-2.0 >= $GLIB_REQUIRED_VERSION
- gio-unix-2.0 >= $GLIB_REQUIRED_VERSION
+ $GIO_SYSTEM_PKG >= $GLIB_REQUIRED_VERSION
gobject-introspection-1.0 >= $INTROSPECTION_REQUIRED
libgit2-glib-1.0 >= $LIBGIT2_GLIB_REQUIRED_VERSION
libgit2-glib-1.0 < $LIBGIT2_GLIB_REQUIRED_MAX_VERSION
@@ -110,22 +130,7 @@ PKG_CHECK_MODULES(LIBGITG, [
libsecret-1
])
-gdk_targets=`$PKG_CONFIG --variable=targets gdk-3.0`
-
-for target in $gdk_targets;
-do
- case "$target" in
- quartz)
- gdk_windowing_quartz=yes
- ;;
- win32)
- gdk_windowing_win32=yes
- ;;
- x11)
- gdk_windowing_x11=yes
- esac
-done
-
+AC_SUBST(GIO_SYSTEM_PKG)
AM_CONDITIONAL(GDK_WINDOWING_X11, test "$gdk_windowing_x11" = "yes")
AM_CONDITIONAL(GDK_WINDOWING_QUARTZ, test "$gdk_windowing_quartz" = "yes")
AM_CONDITIONAL(GDK_WINDOWING_WIN32, test "$gdk_windowing_win32" = "yes")
diff --git a/libgitg-1.0.pc.in b/libgitg-1.0.pc.in
index dc66560..1daa625 100644
--- a/libgitg-1.0.pc.in
+++ b/libgitg-1.0.pc.in
@@ -6,6 +6,6 @@ includedir= includedir@
Name: @PACKAGE_NAME@
Description: gitg library
Version: @PACKAGE_VERSION@
-Requires: glib-2.0 gobject-2.0 gmodule-2.0 gio-2.0 gio-unix-2.0 gthread-2.0
+Requires: glib-2.0 gobject-2.0 gmodule-2.0 gio-2.0 gthread-2.0 @GIO_SYSTEM_PKG@
Libs: -L${libdir} -lgitg-1.0
Cflags: -I${includedir}/libgitg-1.0
diff --git a/libgitg-ext/libgitg-ext-1.0.pc.in b/libgitg-ext/libgitg-ext-1.0.pc.in
index d851288..684e0a8 100644
--- a/libgitg-ext/libgitg-ext-1.0.pc.in
+++ b/libgitg-ext/libgitg-ext-1.0.pc.in
@@ -6,6 +6,6 @@ includedir= includedir@
Name: libgitg-ext
Description: gitg extensions library
Version: @PACKAGE_VERSION@
-Requires: libgit2-glib-1.0 libgitg-1.0 gtk+-3.0 glib-2.0 gobject-2.0 gmodule-2.0 gio-2.0 gio-unix-2.0
gthread-2.0
+Requires: libgit2-glib-1.0 libgitg-1.0 gtk+-3.0 glib-2.0 gobject-2.0 gmodule-2.0 gio-2.0 gthread-2.0
@GIO_SYSTEM_PKG@
Libs: -L${libdir} -lgitg-ext-1.0
Cflags: -I${includedir}/libgitg-ext-1.0
diff --git a/libgitg/Makefile.am b/libgitg/Makefile.am
index 385d9b8..b192c72 100644
--- a/libgitg/Makefile.am
+++ b/libgitg/Makefile.am
@@ -31,9 +31,9 @@ libgitg_libgitg_1_0_la_VALAFLAGS = \
--pkg ggit-1.0 \
--pkg gtk+-3.0 \
--pkg gio-2.0 \
+ --pkg $(GIO_SYSTEM_PKG) \
--pkg gee-0.8 \
--pkg libsecret-1 \
- --pkg gio-unix-2.0 \
--pkg gdesktop-enums-3.0 \
--pkg libsoup-2.4 \
--pkg gtksourceview-3.0 \
diff --git a/libgitg/gitg-hook.vala b/libgitg/gitg-hook.vala
index 742f7e4..fe64e85 100644
--- a/libgitg/gitg-hook.vala
+++ b/libgitg/gitg-hook.vala
@@ -101,7 +101,11 @@ public class Hook : Object
private void read_from_fd(int fd)
{
+#if G_OS_WIN32
+ var stream = new Win32InputStream(fd, true);
+#else
var stream = new UnixInputStream(fd, true);
+#endif
var dstream = new DataInputStream(stream);
stream_read_async(dstream);
diff --git a/libgitg/libgitg-1.0.pc.in b/libgitg/libgitg-1.0.pc.in
index 2f1c599..aff6fdb 100644
--- a/libgitg/libgitg-1.0.pc.in
+++ b/libgitg/libgitg-1.0.pc.in
@@ -6,6 +6,6 @@ includedir= includedir@
Name: @PACKAGE_NAME@
Description: gitg library
Version: @PACKAGE_VERSION@
-Requires: libgit2-glib-1.0 glib-2.0 gobject-2.0 gmodule-2.0 gio-2.0 gio-unix-2.0 gthread-2.0 gtk+-3.0
+Requires: libgit2-glib-1.0 glib-2.0 gobject-2.0 gmodule-2.0 gio-2.0 gthread-2.0 gtk+-3.0 @GIO_SYSTEM_PKG@
Libs: -L${libdir} -lgitg-1.0
Cflags: -I${includedir}/libgitg-1.0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]