[msitools] wixl: add --wxidir option



commit c23d2f3151eb15160c4d63b189ca7629fd333635
Author: Paolo Bonzini <pbonzini redhat com>
Date:   Thu Jan 17 11:20:16 2013 +0100

    wixl: add --wxidir option

 Makefile.am             |    2 +-
 atlocal.in              |    2 +-
 tests/wixl.at           |   11 +++++++++++
 tools/wixl/builder.vala |    1 -
 tools/wixl/wixl.vala    |   12 +++++++++++-
 5 files changed, 24 insertions(+), 4 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 7f790ad..6dbf24c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -90,7 +90,7 @@ wixl_CPPFLAGS =					\
 	$(WIXL_CFLAGS)				\
 	-DG_LOG_DOMAIN=\""wixl"\"		\
 	-DLOCALEDIR=\""$(localedir)"\"		\
-	-DPKGDATADIR=\""$(datadir)/wixl-0.1/"\"	\
+	-DPKGDATADIR=\""$(datadir)/wixl-$(VERSION)/"\"	\
 	-DPKGLIBDIR=\""$(pkglibdir)"\"		\
 	$(NULL)
 
diff --git a/atlocal.in b/atlocal.in
index 73fb891..cd11d8d 100644
--- a/atlocal.in
+++ b/atlocal.in
@@ -24,7 +24,7 @@ _msibuild() {
 }
 
 _wixl() {
-  wixl$EXEEXT "$@"
+  wixl$EXEEXT --wxidir "$abs_top_srcdir/data/wixl" "$@"
 }
 _wixl_heat() {
   wixl-heat$EXEEXT "$@"
diff --git a/tests/wixl.at b/tests/wixl.at
index dd64533..56edef9 100644
--- a/tests/wixl.at
+++ b/tests/wixl.at
@@ -99,6 +99,17 @@ AT_CHECK_WIXL([-D Foo -o out.msi IncludeTest.wxs], [0], [ignore],
 AT_CHECK([test -f out.msi], [0])
 AT_CLEANUP
 
+AT_SETUP([System include directory])
+AT_DATA([include.wxs], [<?xml version='1.0' encoding='windows-1252'?>
+<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
+  <?include gtk2.wxi ?>
+</Wix>
+])
+
+AT_CHECK_WIXL([-E include.wxs -D SourceDir=foo], [0], [stdout])
+AT_CHECK([grep -F gtk-demo.exe stdout], [0], [ignore])
+AT_CLEANUP
+
 AT_SETUP([ARP example])
 AT_WIXLDATA([test-arp.wxs])
 AT_WIXLDATA([FoobarAppl10.exe])
diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala
index f269852..9c1c9e8 100644
--- a/tools/wixl/builder.vala
+++ b/tools/wixl/builder.vala
@@ -6,7 +6,6 @@ namespace Wixl {
             add_path (".");
             foreach (var i in includedirs)
                 this.includedirs.append (File.new_for_path (i));
-            this.includedirs.append (File.new_for_path (Config.PKGDATADIR + "include"));
         }
 
         WixRoot root;
diff --git a/tools/wixl/wixl.vala b/tools/wixl/wixl.vala
index 220d292..1cd2a76 100644
--- a/tools/wixl/wixl.vala
+++ b/tools/wixl/wixl.vala
@@ -11,14 +11,18 @@ namespace Wixl {
     [CCode (array_length = false, array_null_terminated = true)]
     static string[] defines;
     [CCode (array_length = false, array_null_terminated = true)]
+    static string[] opt_includedirs;
+
     static string[] includedirs;
+    static string wxidir;
 
     private const OptionEntry[] options = {
         { "version", 0, 0, OptionArg.NONE, ref version, N_("Display version number"), null },
         { "verbose", 'v', 0, OptionArg.NONE, ref verbose, N_("Verbose output"), null },
         { "output", 'o', 0, OptionArg.FILENAME, ref output, N_("Output file"), null },
         { "define", 'D', 0, OptionArg.STRING_ARRAY, ref defines, N_("Define variable"), null },
-        { "includedir", 'I', 0, OptionArg.STRING_ARRAY, ref includedirs, N_("Include directory"), null },
+        { "includedir", 'I', 0, OptionArg.STRING_ARRAY, ref opt_includedirs, N_("Include directory"), null },
+        { "wxidir", 0, 0, OptionArg.STRING, ref wxidir, N_("System include directory"), null },
         { "only-preproc", 'E', 0, OptionArg.NONE, ref preproc, N_("Stop after the preprocessing stage"), null },
         { "", 0, 0, OptionArg.FILENAME_ARRAY, ref files, null, N_("INPUT_FILE...") },
         { null }
@@ -35,6 +39,8 @@ namespace Wixl {
         opt_context.set_help_enabled (true);
         opt_context.add_main_entries (options, null);
 
+        wxidir = Config.PKGDATADIR + "/include";
+
         try {
             opt_context.parse (ref args);
         } catch (OptionError.BAD_VALUE err) {
@@ -44,6 +50,10 @@ namespace Wixl {
             warning (error.message);
         }
 
+        /* fixme vala, does not support += on arrays without length.  */
+        includedirs = opt_includedirs;
+        includedirs += wxidir;
+
         if (version) {
             GLib.stdout.printf ("%s\n", Config.PACKAGE_VERSION);
             exit (0);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]