]> Pileus Git - ~andy/sunrise/blob - app-misc/golly/files/golly-separate-data-directory.patch
dev-games/renpy-modules: Added missing dependency: glew
[~andy/sunrise] / app-misc / golly / files / golly-separate-data-directory.patch
1 --- golly-2.1-src.old/wxgolly.cpp       2009-09-07 02:35:55.000000000 +0200
2 +++ golly-2.1-src.new/wxgolly.cpp       2010-06-08 17:34:51.000000000 +0200
3 @@ -195,42 +195,6 @@
4  
5  // -----------------------------------------------------------------------------
6  
7 -void SetAppDirectory(const char* argv0)
8 -{
9 -   #ifdef __WXMSW__
10 -      // on Windows we need to reset current directory to app directory if user
11 -      // dropped file from somewhere else onto app to start it up (otherwise we
12 -      // can't find Help files)
13 -      wxString appdir = wxStandardPaths::Get().GetDataDir();
14 -      wxString currdir = wxGetCwd();
15 -      if ( currdir.CmpNoCase(appdir) != 0 )
16 -         wxSetWorkingDirectory(appdir);
17 -      // avoid VC++ warning
18 -      wxUnusedVar(argv0);
19 -   #elif defined(__WXMAC__)
20 -      // wxMac has set current directory to location of .app bundle so no need
21 -      // to do anything
22 -   #else // assume Unix
23 -      // user might have started app from a different directory so find
24 -      // last "/" in argv0 and change cwd if "/" isn't part of "./" prefix
25 -      unsigned int pos = strlen(argv0);
26 -      while (pos > 0) {
27 -         pos--;
28 -         if (argv0[pos] == '/') break;
29 -      }
30 -      if ( pos > 0 && !(pos == 1 && argv0[0] == '.') ) {
31 -         char appdir[2048];
32 -         if (pos < sizeof(appdir)) {
33 -            strncpy(appdir, argv0, pos);
34 -            appdir[pos] = 0;
35 -            wxSetWorkingDirectory(wxString(appdir,wxConvLocal));
36 -         }
37 -      }
38 -   #endif
39 -}
40 -
41 -// -----------------------------------------------------------------------------
42 -
43  void GollyApp::SetFrameIcon(wxFrame* frame)
44  {
45     // set frame icon
46 @@ -280,13 +244,12 @@
47        wxSystemOptions::SetOption(wxMAC_TEXTCONTROL_USE_MLTE, 1);
48     #endif
49  
50 -   // get current working directory before calling SetAppDirectory
51 +   // get current working directory before changing to data directory
52     wxString initdir = wxFileName::GetCwd();
53     if (initdir.Last() != wxFILE_SEP_PATH) initdir += wxFILE_SEP_PATH;
54  
55 -   // make sure current working directory contains application otherwise
56 -   // we can't open Help files
57 -   SetAppDirectory( wxString(argv[0]).mb_str(wxConvLocal) );
58 +   // change to data directory
59 +   wxSetWorkingDirectory(wxString("/usr/share/golly", wxConvLocal));
60  
61     // now set global gollydir for use in GetPrefs and elsewhere
62     gollydir = wxFileName::GetCwd();