How to build KanaMemo on Linux by Tom Maneiro ================================= 0) Install wxGTK development packages if you don't already have them! (ancient wxGTK 2.6 will do, but 2.8 is much better AND preferred) 1) Fetch KanaMemo sources from SVN svn co http://svn.aegisub.net/trunk/kanamemo 2) Fix the encoding of all source files to UTF-8 (some files are not correctly encoded on UTF-8, and there is one encoded on UTF-16!) to avoid GCC compiler errors (yes, GCC is very picky there!) 3) Change all wxWidgets includes in header files and in main.cpp: to 4) Convert icon.ico to XPM, edit the XPM and change the icon name there to "wxicon_xpm", then in game_window.cpp, add: #include "icon.xpm" 5) Fix the event table on game_panel.cpp: append "GamePanel::" before each callback function name (lines 85-86-87): -- start copying here -- BEGIN_EVENT_TABLE(GamePanel,wxPanel) EVT_BUTTON(Enter_Button,GamePanel::OnEnterPress) EVT_BUTTON(Question_Button,GamePanel::OnQuestionPress) EVT_TEXT_ENTER(Enter_Box,GamePanel::OnEnterPress) END_EVENT_TABLE() -- stop copying here -- 6) (Optional, but highly recommended): Open main.cpp and replace the method GetFullPath with this one: -- start copying here -- ///////////////////////////// // Gets and stores full path void KanaMemo::GetFullPath(wxString arg) { // Do the right thing under *nix: store users on home dir wxString settings_dir = wxStandardPaths::Get().GetUserDataDir() + _T("/"); if (!wxDirExists(settings_dir)) wxMkdir(settings_dir); fullPath = settings_dir; return; } -- stop copying here -- Don't forget to add '#include ' on the headers section! This will allow KanaMemo to load/save user files into your home directory ($HOME/.KanaMemo/, case-sensitive), as any good *nix app should do ;) 7) COMPILE THE APP! Use this command: g++ `wx-config --libs` `wx-config --cxxflags` main.cpp \ game_display.cpp game_panel.cpp game_window.cpp kana_table.cpp \ level.cpp switch_user.cpp version.cpp -o kanamemo 8) (Optional) Trim the fat (strip -s kanamemo) 9) Enjoy your native KanaMemo for Linux binary ;) (./kanamemo). If you have performed the edit specified in step 6, you may now copy the binary to somewhere in your $PATH, add a shortcut to your desktop, build a RPM/DEB/whatever package, etcetera... Date: 08/10/2008 23:11 Last revision: 09/12/2008 21:03