summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorberkeviktor@aol.com <berkeviktor@aol.com>2010-05-23 01:51:41 +0200
committerberkeviktor@aol.com <berkeviktor@aol.com>2010-05-23 01:51:41 +0200
commit45ea25ed57d9692355d4812c5813ab2a1433f390 (patch)
tree34d649aa8fe50dfb4237a2a6a8419adfcdb98202
parente80acf8ad4f2e36a500ef7f376e69fd753e65231 (diff)
add support for building a portable version
-rw-r--r--config.h2
-rw-r--r--src/makeinc.mak5
-rw-r--r--xchat-wdk.patch45
3 files changed, 47 insertions, 5 deletions
diff --git a/config.h b/config.h
index 6b1fdc99..2b1f198a 100644
--- a/config.h
+++ b/config.h
@@ -3,7 +3,7 @@
 #define USE_GMODULE
 #define USE_PLUGIN
 #define PACKAGE_NAME "xchat"
-#define PACKAGE_VERSION "r1431-2"
+#define PACKAGE_VERSION "r1431-3"
 #define XCHATLIBDIR "."
 #define XCHATSHAREDIR "."
 #define OLD_PERL
diff --git a/src/makeinc.mak b/src/makeinc.mak
index 7a719967..75fd53e3 100644
--- a/src/makeinc.mak
+++ b/src/makeinc.mak
@@ -1,5 +1,6 @@
 #uncomment this to have an x64 build
 #X64 = YES
+#PORTABLE = YES
 #OPENSSL = YES
 IPV6 = YES
 
@@ -49,6 +50,10 @@ PYTHONOUTPUT = xcpython.dll
 TCLLIB = tcl86
 TCLOUTPUT = xctcl.dll
 
+!ifdef PORTABLE
+CFLAGS = $(CFLAGS) -DPORTABLE_BUILD
+!endif
+
 !ifdef IPV6
 CFLAGS = $(CFLAGS) -DUSE_IPV6
 LIBS = $(LIBS) ws2_32.lib
diff --git a/xchat-wdk.patch b/xchat-wdk.patch
index 8f293e9f..2e9bbd14 100644
--- a/xchat-wdk.patch
+++ b/xchat-wdk.patch
@@ -75,7 +75,7 @@ diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/tcl/tclplugin.c xchat-wdk/p
  #include "xchat-plugin.h"
 diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/cfgfiles.c xchat-wdk/src/common/cfgfiles.c
 --- xchat-wdk.orig/src/common/cfgfiles.c	2009-01-02 06:56:12 +0100
-+++ xchat-wdk/src/common/cfgfiles.c	2010-05-22 03:42:11 +0200
++++ xchat-wdk/src/common/cfgfiles.c	2010-05-23 01:37:33 +0200
 @@ -17,7 +17,6 @@
   */
  
@@ -84,7 +84,36 @@ diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/cfgfiles.c xchat-wdk/src
  #include <stdlib.h>
  #include <string.h>
  #include <stdio.h>
-@@ -676,7 +675,12 @@
+@@ -32,7 +31,11 @@
+ #include "xchatc.h"
+ 
+ #ifdef WIN32
++#ifdef PORTABLE_BUILD
++#define XCHAT_DIR "config"
++#else
+ #define XCHAT_DIR "X-Chat 2"
++#endif
+ #else
+ #define XCHAT_DIR ".xchat2"
+ #endif
+@@ -308,12 +311,16 @@
+ {
+ 	if (!xdir_fs)
+ 	{
++#ifdef PORTABLE_BUILD
++		xdir_fs = XCHAT_DIR;
++#else
+ 		char out[256];
+ 
+ 		if (!get_reg_str ("Software\\Microsoft\\Windows\\CurrentVersion\\"
+ 				"Explorer\\Shell Folders", "AppData", out, sizeof (out)))
+ 			return "./config";
+ 		xdir_fs = g_strdup_printf ("%s\\" XCHAT_DIR, out);
++#endif
+ 	}
+ 	return xdir_fs;
+ }
+@@ -676,7 +683,12 @@
  	prefs.mainwindow_save = 1;
  	prefs.bantype = 2;
  	prefs.input_balloon_time = 20;
@@ -521,8 +550,16 @@ diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/xchat.h xchat-wdk/src/co
  #define	X_OK	1
 diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/about.c xchat-wdk/src/fe-gtk/about.c
 --- xchat-wdk.orig/src/fe-gtk/about.c	2010-05-16 09:43:49 +0200
-+++ xchat-wdk/src/fe-gtk/about.c	2010-05-21 21:42:51 +0200
-@@ -117,7 +117,7 @@
++++ xchat-wdk/src/fe-gtk/about.c	2010-05-23 01:47:48 +0200
+@@ -113,11 +113,15 @@
+ 	gtk_container_add (GTK_CONTAINER (vbox), label);
+ 	g_get_charset (&locale);
+ 	(snprintf) (buf, sizeof (buf),
++#ifdef PORTABLE_BUILD
++				"<span size=\"x-large\"><b>"DISPLAY_NAME" "PACKAGE_VERSION"</b></span>\n<span size=\"x-large\"><b>Portable Version</b></span>\n\n"
++#else
+ 				"<span size=\"x-large\"><b>"DISPLAY_NAME" "PACKAGE_VERSION"</b></span>\n\n"
++#endif
  				"%s\n\n"
  #ifdef WIN32
  				/* leave this message to avoid time wasting bug reports! */