Description: This patch applies changes to the source which are necessary 
 to compile the Tgif Debian package.  The contents of this patch has been
 extracted from the Tgif Debian package version 4.1.45-2 before the transition
 to source format 3.0 (quilt).
Author: Carlo Segre <segre@debian.org>
        Andreas Tille <tille@debian.org>
Last-Update: Sun, 01 Sep 2024 10:31:46 +0200

--- a/convxim.c
+++ b/convxim.c
@@ -42,10 +42,10 @@
 
 #ifndef _NO_XIMP
 #define DEFAULT_MODIFIERS	""
-#define DEFAULT_LANG		"ja_JP.EUC"
+#define DEFAULT_LANG		"ja_JP.eucJP"
 #else /* _NO_XIMP */
 #define DEFAULT_MODIFIERS	"@im=_XWNMO"
-#define DEFAULT_LANG		"ja_JP.ujis"
+#define DEFAULT_LANG		"ja_JP.eucJP"
 #endif /* ~_NO_XIMP */
 
 typedef struct tagXICInfo {
--- a/setup.c
+++ b/setup.c
@@ -1182,6 +1182,18 @@ int InitAntiAlias()
    return TRUE;
 }
 
+void InitTgifDir() {
+   char *c_ptr=NULL;
+   if ((c_ptr=getenv("HOME")) == NULL) {
+      strcpy(homeDir, DIR_SEP_STR);
+   } else if (strlen(c_ptr) >= MAXPATHLENGTH-1) {
+      strcpy(homeDir, DIR_SEP_STR);
+   } else {
+      strcpy(homeDir, c_ptr);
+   }
+   sprintf(tgifDir, "%s%c.%s", homeDir, DIR_SEP, TOOL_NAME);
+}
+
 void Setup()
 {
    int bitmask=0, x_neg_in_def=FALSE, y_neg_in_def=FALSE;
--- a/tgif.c
+++ b/tgif.c
@@ -345,6 +345,7 @@ void DoPrTgif(argc, argv, from_prtgif)
       argc--; argv++;
    }
    InitPaperSize();
+   InitTgifDir();
    InitTmpDir();
    InitPatFill();
    if (PRTGIF && !cmdLineOpenDisplay) {
--- a/Tgif.tmpl
+++ b/Tgif.tmpl
@@ -52,7 +52,10 @@ MISCDEFINES	= -D_BACKGROUND_DONT_FORK -D
 		  -D_DONT_REENCODE=\"FFDingbests:ZapfDingbats\" \@@\
 		  -DDEFATTRGROUP=\"TANGRAM-II:Declaration:Events:Messages:Rewards:Initialization:Watches\" \@@\
 		  -D_NO_NKF -D_NO_CHINPUT -D_NO_XCIN \@@\
-		  -DUSE_XT_INITIALIZE -DPTHREAD
+		  -DUSE_XT_INITIALIZE -DPRINT_CMD=\"lpr\" \@@\
+		  -D_TMP_DIR_IN_HOME_DIR -DPTHREAD
+XCOMM		  -DUSE_XAPPLRESDIR \@@\
+XCOMM		  -DXAPPLOADDIR_DEF=\"/usr/X11R6/lib/X11/app-defaults\" \@@\
 MOREDEFINES	=
 
 XCOMM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--- tgif-4.2.5.orig/setup.e
+++ tgif-4.2.5/setup.e
@@ -185,6 +185,7 @@ extern int	mainWinEventHandler ARGS_DECL
 extern void	Reconfigure ARGS_DECL((int Forced));
 extern void	CleanUpPaperSize ARGS_DECL((void));
 extern void	InitPaperSize ARGS_DECL((void));
+extern void	InitTgifDir ARGS_DECL((void));
 extern void	InitTmpDir ARGS_DECL((void));
 extern void	Setup ARGS_DECL((void));
 extern void	CleanUpResiduals ARGS_DECL((void));
