summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-01-18 09:01:43 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2013-01-18 09:11:40 +0100
commitd16ee17c08a383b77070f3ba40d91882c0cb56e8 (patch)
treebc4c7622fa5afb2d70871cd7ecff30ecd0b8c4b3
parentc1fd3ca2b91b675c038816076f671e778907d9ce (diff)
downloadmsitools-d16ee17c08a383b77070f3ba40d91882c0cb56e8.tar.gz
msitools-d16ee17c08a383b77070f3ba40d91882c0cb56e8.tar.xz
msitools-d16ee17c08a383b77070f3ba40d91882c0cb56e8.zip
wixl: remove gio-unix dependency
It is not available under Windows, but it can be easily implemented using Posix.read.
-rw-r--r--Makefile.am7
-rw-r--r--configure.ac7
-rw-r--r--tools/wixl/util.vala16
-rw-r--r--tools/wixl/wixl-heat.vala2
4 files changed, 22 insertions, 10 deletions
diff --git a/Makefile.am b/Makefile.am
index beae662..0ef1e3b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -104,7 +104,8 @@ wixl_LDADD = \
wixl_DEPENDENCIES = libmsi/libmsi.la
-if !WIN32
+# Wixl-heat
+
bin_PROGRAMS += wixl-heat
wixl_heat_CFLAGS = -w
@@ -112,8 +113,9 @@ wixl_heat_CFLAGS = -w
wixl_heat_VALAFLAGS = \
--vapidir=. \
--pkg config \
+ --pkg gio-2.0 \
+ --pkg posix \
--enable-experimental \
- --pkg gio-unix-2.0 \
$(NULL)
wixl_heat_SOURCES = \
@@ -123,7 +125,6 @@ wixl_heat_SOURCES = \
wixl_heat_CPPFLAGS = $(wixl_CPPFLAGS)
wixl_heat_LDADD = $(wixl_LDADD)
-endif
# Autotest support
diff --git a/configure.ac b/configure.ac
index f4c8f76..a384fbd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,15 +31,10 @@ AC_PATH_PROG(VAPIGEN, vapigen, no)
AC_SUBST(VAPIGEN)
AM_CONDITIONAL([VAPI], [test "x$VAPIGEN" != xno])
-# used by wixl-heat
-AS_IF([test $win32 = no],
- [WIXL_UNIX="gio-unix-2.0"])
-
PKG_CHECK_MODULES([WIXL], [gio-2.0 >= 0.23.0
libgcab-1.0 >= 0.1.10
uuid >= 1.41.3
- libxml-2.0 >= 2.7
- $WIXL_UNIX])
+ libxml-2.0 >= 2.7])
GETTEXT_PACKAGE=wixl
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Gettext Package])
diff --git a/tools/wixl/util.vala b/tools/wixl/util.vala
index e7fadcc..13269c7 100644
--- a/tools/wixl/util.vala
+++ b/tools/wixl/util.vala
@@ -143,4 +143,20 @@ namespace Wixl {
return -1;
}
+
+ public class UnixInputStream : GLib.InputStream {
+ public int fd { get; set construct; }
+
+ public UnixInputStream(int fd_) {
+ fd = fd_;
+ }
+
+ public override ssize_t read ([CCode (array_length_type = "gsize")] uint8[] buffer, GLib.Cancellable? cancellable = null) throws GLib.IOError {
+ return Posix.read(fd, buffer, buffer.length);
+ }
+
+ public override bool close(GLib.Cancellable? cancellable = null) throws GLib.IOError {
+ return true;
+ }
+ }
} // Wixl
diff --git a/tools/wixl/wixl-heat.vala b/tools/wixl/wixl-heat.vala
index 560367d..44989c2 100644
--- a/tools/wixl/wixl-heat.vala
+++ b/tools/wixl/wixl-heat.vala
@@ -61,7 +61,7 @@ public int main (string[] args) {
var indent = " ";
try {
- var dis = new DataInputStream (new UnixInputStream (0, false));
+ var dis = new DataInputStream (new UnixInputStream (0));
string line;
while ((line = dis.read_line (null)) != null) {