[PATCH] Repair OSX Port after i18n reorganization

Поиск
Список
Период
Сортировка
Искать

[PATCH] Repair OSX Port after i18n reorganization

От:
"Florian G. Pflug" <fgp@phlo.org>
Дата:
Hi

This patch makes the osx build work again, by doing the following
	.) Change i18n/Makefile.am to install i18n-files into
	$(datadir)i18n instead of $(datadir)/pgadmin3/i18n when
	building an appbundle.
	.) Put the files listed in TMP_ui in i18n/Makefile.am
	into EXTRA_DIST instead. I guess this was an error,
	since TMP_ui is never used in this Makefile...
	.) Support DESTDIR in i18n/Makefile.am
	.) Moves the path-hint support for windows from
	pgAdmin3.cpp to base/appbase.cpp,
	because this saves some conditionals and is cleaner
	.) Make "path" a global variable, like loadPath, ...

Now all path-related setups are done in InitPaths in AppBase

I didn't test the win32 build... I hope I didn't break anything..

greetings, Florian Pflug
Index: i18n/Makefile.am
===================================================================
--- i18n/Makefile.am	(revision 4179)
+++ i18n/Makefile.am	(working copy)
@@ -19,25 +19,27 @@
 
 EXTRA_DIST = \
 	$(srcdir)/wxstd.pot \
-	$(srcdir)/??_??/pgadmin3.po
-
-TMP_ui = \
+	$(srcdir)/??_??/pgadmin3.po \
 	$(srcdir)/wxstd.mo \
 	$(srcdir)/pgadmin3.lng \
 	$(srcdir)/pg_settings.csv \
 	$(srcdir)/??_??/pgadmin3.mo \
 	$(srcdir)/??_??/wxstd.mo
 
+if !APPBUNDLE
+i18ndir = $(pkgdatadir)/i18n
+else
+i18ndir = $(datadir)/i18n
+endif
 
 install-data-local:
-	$(mkinstalldirs) $(datadir)/pgadmin3/i18n
+	$(mkinstalldirs) $(PREFIX)$(i18ndir)
 	@pub_tx='$(PUB_TX)'; \
 	for DIR in $$pub_tx; do \
-		$(mkinstalldirs) $(datadir)/pgadmin3/i18n/$$DIR; \
+		$(mkinstalldirs) $(PREFIX)$(i18ndir)/$$DIR; \
 		for FILE in `ls $$DIR/*.mo`; do \
-			$(install_sh) -c -m 644 $$FILE $(datadir)/pgadmin3/i18n/$$DIR/; \
+			$(install_sh) -c -m 644 $$FILE $(PREFIX)$(i18ndir)/$$DIR/; \
 		done \
 	done
-	$(install_sh) -c -m 644 pgadmin3.lng $(datadir)/pgadmin3/i18n/$$DIR
-	$(install_sh) -c -m 644 wxstd.mo $(datadir)/pgadmin3/i18n/$$DIR
-
+	$(install_sh) -c -m 644 pgadmin3.lng $(PREFIX)$(i18ndir)/$$DIR
+	$(install_sh) -c -m 644 wxstd.mo $(PREFIX)$(i18ndir)/$$DIR
Index: src/pgAdmin3.cpp
===================================================================
--- src/pgAdmin3.cpp	(revision 4179)
+++ src/pgAdmin3.cpp	(working copy)
@@ -147,31 +147,6 @@
         }
     }
 
-
-    wxPathList path;
-
-    path.Add(loadPath);
-
-#ifdef __WXMSW__
-
-	// Look for a path 'hint' on Windows. This registry setting may
-	// be set by the Win32 PostgreSQL installer which will generally
-	// install pg_dump et al. in the PostgreSQL bindir rather than
-	// the pgAdmin directory.
-
-    wxRegKey hintKey(wxT("HKEY_LOCAL_MACHINE\\Software\\") APPNAME_L);
-
-	if (hintKey.HasValue(wxT("Helper Path")))
-	{
-		wxString hintPath;
-	    hintKey.QueryValue(wxT("Helper Path"), hintPath);
-		path.Add(hintPath);
-	}
-
-#endif 
-
-    path.AddEnvList(wxT("PATH"));
-
     // evaluate all working paths
 
 #if defined(__WXMSW__)
Index: src/include/base/appbase.h
===================================================================
--- src/include/base/appbase.h	(revision 4179)
+++ src/include/base/appbase.h	(working copy)
@@ -9,6 +9,7 @@
 //
 //////////////////////////////////////////////////////////////////////////
 
+extern wxPathList path;                  // The search path
 extern wxString loadPath;              // Where the program is loaded from
 extern wxString docPath;               // Where docs are stored
 extern wxString uiPath;                // Where ui data is stored
Index: src/base/appbase.cpp
===================================================================
--- src/base/appbase.cpp	(revision 4179)
+++ src/base/appbase.cpp	(working copy)
@@ -24,6 +24,7 @@
 #include "base/pgConnBase.h"
 #include "base/sysLogger.h"
 
+wxPathList path;                // The search path
 wxString loadPath;              // Where the program is loaded from
 wxString docPath;               // Where docs are stored
 wxString uiPath;                // Where ui data is stored
@@ -60,6 +61,18 @@
         docPath = loadPath + DOC_DIR;
     else
         docPath = loadPath + wxT("/../..") DOC_DIR;
+
+    // Look for a path 'hint' on Windows. This registry setting may
+    // be set by the Win32 PostgreSQL installer which will generally
+    // install pg_dump et al. in the PostgreSQL bindir rather than
+    // the pgAdmin directory.
+    wxRegKey hintKey(wxT("HKEY_LOCAL_MACHINE\\Software\\") APPNAME_L);
+    if (hintKey.HasValue(wxT("Helper Path")))
+    {
+        wxString hintPath;
+        hintKey.QueryValue(wxT("Helper Path"), hintPath);
+        path.Add(hintPath);
+    }
     
 #else
     wxString dataDir;
@@ -123,6 +136,8 @@
             docPath = loadPath + wxT("/..") DOC_DIR ;
     }
 #endif
+
+    path.AddEnvList(wxT("PATH"));
 }
 
 

Re: [PATCH] Repair OSX Port after i18n reorganization

От:
"Dave Page" <dpage@vale-housing.co.uk>
Дата:
 

> -----Original Message-----
> From: pgadmin-hackers-owner@postgresql.org 
> [mailto:pgadmin-hackers-owner@postgresql.org] On Behalf Of 
> Florian G. Pflug
> Sent: 13 May 2005 10:36
> To: pgadmin-hackers
> Subject: [pgadmin-hackers] [PATCH] Repair OSX Port after i18n 
> reorganization
> 
> Hi
> 
> This patch makes the osx build work again, by doing the following
> 	.) Change i18n/Makefile.am to install i18n-files into
> 	$(datadir)i18n instead of $(datadir)/pgadmin3/i18n when
> 	building an appbundle.
> 	.) Put the files listed in TMP_ui in i18n/Makefile.am
> 	into EXTRA_DIST instead. I guess this was an error,
> 	since TMP_ui is never used in this Makefile...
> 	.) Support DESTDIR in i18n/Makefile.am
> 	.) Moves the path-hint support for windows from
> 	pgAdmin3.cpp to base/appbase.cpp,
> 	because this saves some conditionals and is cleaner
> 	.) Make "path" a global variable, like loadPath, ...
> 
> Now all path-related setups are done in InitPaths in AppBase

Thanks - patch applied.

> I didn't test the win32 build... I hope I didn't break anything..

Nothing another #include didn't fix :-)

Regards, Dave

Re: [PATCH] Repair OSX Port after i18n reorganization

От:
"Florian G. Pflug" <fgp@phlo.org>
Дата:
Вложения:
Dave Page wrote:
> Thanks - patch applied.
I think you forgot to "svn add pkg/Makefile.am" ;-)

>>I didn't test the win32 build... I hope I didn't break anything..
> Nothing another #include didn't fix :-)
Ups.. ;-)

greetings, Florian Pflug
FAQ