@@ -0,0 +1,351 @@
+
+Disable requirement for X.
+
+Based on:
+http://home.att.net/~Tom.Horsley/tah-tc-5.0.tar.gz
+
+Don't use internal wxUSE_GUI but force the state.
+
+---
+
+diff -urNp truecrypt-5.0a-source.base1/Main/Application.cpp truecrypt-5.0a-source.new1/Main/Application.cpp
+--- truecrypt-5.0a-source.base1/Main/Application.cpp 2008-02-04 13:14:16.000000000 +0200
++++ truecrypt-5.0a-source.new1/Main/Application.cpp 2008-02-15 09:42:18.000000000 +0200
+@@ -22,11 +22,13 @@ namespace TrueCrypt
+ return mUserInterface;
+ }
+
++#ifdef ENABLE_wxGUI
+ wxApp* Application::CreateGuiApp ()
+ {
+ mUserInterface = new GraphicUserInterface;
+ return mUserInterface;
+ }
++#endif
+
+ FilePath Application::GetConfigFilePath (const wxString &configFileName, bool createConfigDir)
+ {
+@@ -72,11 +74,13 @@ namespace TrueCrypt
+ wxAppInitializer wxTheAppInitializer((wxAppInitializerFunction) CreateConsoleApp);
+ break;
+ }
++#ifdef ENABLE_wxGUI
+ case UserInterfaceType::Graphic:
+ {
+ wxAppInitializer wxTheAppInitializer((wxAppInitializerFunction) CreateGuiApp);
+ break;
+ }
++#endif
+
+ default:
+ throw ParameterIncorrect (SRC_POS);
+diff -urNp truecrypt-5.0a-source.base1/Main/FatalErrorHandler.cpp truecrypt-5.0a-source.new1/Main/FatalErrorHandler.cpp
+--- truecrypt-5.0a-source.base1/Main/FatalErrorHandler.cpp 2008-02-04 13:14:16.000000000 +0200
++++ truecrypt-5.0a-source.new1/Main/FatalErrorHandler.cpp 2008-02-15 09:42:18.000000000 +0200
+@@ -90,6 +90,7 @@ namespace TrueCrypt
+
+ #endif // wxUSE_STACKWALKER
+
++#ifdef ENABLE_wxGUI
+ wxString url = Gui->GetHomepageLinkURL (L"err-report", vars.str());
+ url.Replace (L"0x", L"");
+
+@@ -109,6 +110,7 @@ namespace TrueCrypt
+
+ if (Gui->AskYesNo (msg, true))
+ wxLaunchDefaultBrowser (url, wxBROWSER_NEW_WINDOW);
++#endif
+
+ _exit (1);
+ }
+@@ -155,6 +157,7 @@ namespace TrueCrypt
+ vars.Replace (L"::", L".");
+ vars.Replace (L":", L".");
+
++#ifdef ENABLE_wxGUI
+ wxString url = Gui->GetHomepageLinkURL (L"err-report", vars);
+
+ wxString msg = L"An unhandled exception has occured and TrueCrypt must be terminated. If this is caused by a bug in TrueCrypt, we would like to fix it. To help us, you can send us an automatically generated error report containing the following items:\n\n- Program version\n- Operating system version\n- Hardware architecture\n- Error description\n- Error location\n";
+@@ -164,15 +167,20 @@ namespace TrueCrypt
+
+ if (Gui->AskYesNo (msg, true))
+ wxLaunchDefaultBrowser (url, wxBROWSER_NEW_WINDOW);
++#endif
+
+ }
+ catch (exception &e)
+ {
++#ifdef ENABLE_wxGUI
+ Gui->ShowError (e);
++#endif
+ }
+ catch (...)
+ {
++#ifdef ENABLE_wxGUI
+ Gui->ShowError (_("Unknown exception occurred."));
++#endif
+ }
+
+ _exit (1);
+diff -urNp truecrypt-5.0a-source.base1/Main/GraphicUserInterface.cpp truecrypt-5.0a-source.new1/Main/GraphicUserInterface.cpp
+--- truecrypt-5.0a-source.base1/Main/GraphicUserInterface.cpp 2008-02-07 17:48:16.000000000 +0200
++++ truecrypt-5.0a-source.new1/Main/GraphicUserInterface.cpp 2008-02-15 09:42:18.000000000 +0200
+@@ -19,6 +19,9 @@
+ #include "Application.h"
+ #include "GraphicUserInterface.h"
+ #include "FatalErrorHandler.h"
++
++#ifdef ENABLE_wxGUI
++
+ #include "Forms/DeviceSelectionDialog.h"
+ #include "Forms/MainFrame.h"
+ #include "Forms/MountOptionsDialog.h"
+@@ -1039,3 +1042,4 @@ namespace TrueCrypt
+
+ GraphicUserInterface *Gui = nullptr;
+ }
++#endif
+diff -urNp truecrypt-5.0a-source.base1/Main/GraphicUserInterface.h truecrypt-5.0a-source.new1/Main/GraphicUserInterface.h
+--- truecrypt-5.0a-source.base1/Main/GraphicUserInterface.h 2008-02-05 19:56:46.000000000 +0200
++++ truecrypt-5.0a-source.new1/Main/GraphicUserInterface.h 2008-02-15 09:42:18.000000000 +0200
+@@ -14,6 +14,7 @@
+ #include "Main.h"
+ #include "UserInterface.h"
+
++#ifdef ENABLE_wxGUI
+ namespace TrueCrypt
+ {
+ class GraphicUserInterface : public UserInterface
+@@ -128,5 +129,6 @@ namespace TrueCrypt
+
+ extern GraphicUserInterface *Gui;
+ }
++#endif
+
+ #endif // TC_HEADER_Main_GraphicUserInterface
+diff -urNp truecrypt-5.0a-source.base1/Main/Main.make truecrypt-5.0a-source.new1/Main/Main.make
+--- truecrypt-5.0a-source.base1/Main/Main.make 2008-02-15 09:25:30.000000000 +0200
++++ truecrypt-5.0a-source.new1/Main/Main.make 2008-02-15 09:42:18.000000000 +0200
+@@ -21,6 +21,7 @@ OBJS += UserPreferences.o
+ OBJS += VolumeHistory.o
+ OBJS += Xml.o
+ OBJS += Unix/Main.o
++ifeq "$(TC_BUILD_GUI)" "True"
+ OBJS += Forms/AboutDialog.o
+ OBJS += Forms/ChangePasswordDialog.o
+ OBJS += Forms/DeviceSelectionDialog.o
+@@ -47,6 +48,7 @@ OBJS += Forms/VolumeLocationWizardPage.o
+ OBJS += Forms/VolumePasswordWizardPage.o
+ OBJS += Forms/VolumeSizeWizardPage.o
+ OBJS += Forms/WizardFrame.o
++endif
+ OBJS += Resources.o
+
+ PCH := SystemPrecompiled.h.gch
+@@ -67,15 +69,21 @@ WX_CONFIG_EXTRA ?= --static
+
+ #------ wxWidgets configuration ------
+
++ifeq "$(TC_BUILD_GUI)" "True"
++WX_ASK_LIBS=adv,core,base
++else
++WX_ASK_LIBS=core,base
++endif
++
+ ifeq "$(TC_BUILD_CONFIG)" "Release"
+
+ CXXFLAGS += $(shell $(WX_CONFIG) $(WX_CONFIG_EXTRA) --cxxflags)
+-WX_LIBS = $(shell $(WX_CONFIG) $(WX_CONFIG_EXTRA) --libs adv,core,base)
++WX_LIBS = $(shell $(WX_CONFIG) $(WX_CONFIG_EXTRA) --libs $(WX_ASK_LIBS))
+
+ else
+
+ CXXFLAGS += $(shell $(WX_CONFIG) $(WX_CONFIG_EXTRA) --debug --cxxflags)
+-WX_LIBS = $(shell $(WX_CONFIG) $(WX_CONFIG_EXTRA) --debug --libs adv,core,base)
++WX_LIBS = $(shell $(WX_CONFIG) $(WX_CONFIG_EXTRA) --debug --libs $(WX_ASK_LIBS))
+
+ endif
+
+diff -urNp truecrypt-5.0a-source.base1/Main/Resources.cpp truecrypt-5.0a-source.new1/Main/Resources.cpp
+--- truecrypt-5.0a-source.base1/Main/Resources.cpp 2008-02-04 13:14:16.000000000 +0200
++++ truecrypt-5.0a-source.new1/Main/Resources.cpp 2008-02-15 09:42:18.000000000 +0200
+@@ -35,6 +35,7 @@ namespace TrueCrypt
+ }
+ #endif // TC_WINDOWS
+
++#ifdef ENABLE_wxGUI
+ wxBitmap Resources::GetDriveIconBitmap ()
+ {
+ #ifdef TC_WINDOWS
+@@ -72,6 +73,7 @@ namespace TrueCrypt
+ # endif
+ #endif
+ }
++#endif
+
+ string Resources::GetLanguageXml ()
+ {
+@@ -111,6 +113,7 @@ namespace TrueCrypt
+ #endif
+ }
+
++#ifdef ENABLE_wxGUI
+ wxBitmap Resources::GetLogoBitmap ()
+ {
+ #ifdef TC_WINDOWS
+@@ -173,4 +176,5 @@ namespace TrueCrypt
+ return wxBitmap (image);
+ #endif
+ }
|