====== Hacking ====== ===== SVN repository ===== The sources are managed in a [[http://subversion.tigris.org/|Subversion]] repository. You need a SVN client in order to retrieve the sources. You either use the ''svn'' CLI utility or a svn GUI (e.g. [[http://rapidsvn.tigris.org/|RapidSVN]]). The repository is accessible at ''https://holdingnuts.svn.sourceforge.net/svnroot/holdingnuts'' You can checkout the latest trunk with this command: $ svn co https://holdingnuts.svn.sourceforge.net/svnroot/holdingnuts/trunk holdingnuts/trunk You can also browse the sources via the [[http://apps.sourceforge.net/trac/holdingnuts/browser|trac source-browser]]. ===== Building the sources ===== Here is a list of requirements for building the sources: * C/C++ Compiler and Linker * [[http://qt.nokia.com/downloads|Qt4]] (>=4.3) headers and libraries (needed for the client) * [[http://www.libsdl.org|SDL]] (>=1.2.13) (optional; needed for the client audio) * [[http://www.sqlite.org/|SQLite]] (sqlite-amalgamation >=3.6) (optional; needed for server player ranking) * [[http://www.cmake.org/|CMake]] (>=2.6 patch-3) ==== Compiling on Linux ==== Make sure all needed development packages required above are installed. For instance on Ubuntu you need to install these packages: # apt-get install build-essential cmake libqt4-dev libsqlite3-dev libsdl-dev === Preferred method (outer-src-dir build) === $ cd holdingnuts && ls branches tags trunk $ mkdir build && cd build $ cmake ../trunk $ make === Alternatively you can do a build in the source-directory === $ cd holdingnuts/trunk $ cmake . # take notice of the . at the end $ make === Gentoo Linux - subversion snapshot ebuild === **Only for Gentoo Linux users:** There's a {{:devel:holdingnuts-9999.ebuild|holdingnuts snapshot ebuild}} which allows conveniently building a snapshot from SVN repository. Place this file in an overlay (e.g. ''/usr/local/portage/games-board/holdingnuts/holdingnuts-9999.ebuild'') and perform the usual steps needed for emerging external ebuilds. ==== Compiling on Windows ==== Currently there's support for compiling with [[http://www.mingw.org/|MinGW32]]. However, building with Visual C++ should work (with some tweeks!). Dependencies: * Qt: For an easy Qt4 Setup download the [[http://www.qtsoftware.com/downloads/downloads#lgpl|Qt4 SDK: Complete Development Environment]] Installer, it includes an optional selectable MinGW Installation too. * SDL: You can use the [[http://www.libsdl.org/release/SDL-devel-1.2.13-mingw32.tar.gz|pre-compiled SDL-libraries for MinGW32]] or build SDL yourself. * SQLite: We built a SQLite devel-package for MinGW for download: {{:devel:sqlite-3.6.17-mingw.tar.bz2|}} **Important**: Avoid using spaces in paths or you may run into problems! === Short instruction (console only) === C:\>cd holdingnuts\trunk ; If you're building with MinGW, run this (take notice of the . at the end) C:\holdingnuts\trunk>cmake -G "MinGW Makefiles" . C:\holdingnuts\trunk>mingw32-make ; If you're building with Visual C++ (adjust your Visual Studio version), run this (take notice of the . at the end) C:\holdingnuts\trunk>cmake -G "Visual Studio 9 2008" . ; Now you can open the resulting project-file with Visual Studio. === Long instruction (GUI/console) === Follow these steps for building the sources on Windows: == When building with MinGW == * Download and install MinGW (you may use the Automated MinGW Installer) * You need at least 'MinGW base tools', 'g++' and 'MinGW Make' * It's best to have the MinGW-executables in the Environment-Path * right-click on 'My Computer' and choose 'Properties'. In the box that opens, click the 'Advanced' tab. Next, click the button 'Environment Variables'. Add the full path to the MinGW executable directory 'bin' to the PATH variable. == These steps are needed for both variants (MingGW and Visual Studio) == * Download and install CMake * Set ''CMAKE_INCLUDE_PATH'' and ''CMAKE_LIBRARY_PATH'' environment variables to the includes and libraries of 3rd party libs (SDL, SQLite, ...) * Run the CMake-GUI * select for 'Where is the source code' the base directory of the sources (e.g. C:\holdingnuts\trunk, **not** \src) * select for 'Where to build the binaries' any directory you want to have the binaries generated (e.g. C:\holdingnuts\build) * click on 'Configure' in order to create the CMake cache files. * Select the 'MinGW Makefiles' respectively 'Visual Studio 9 2008' (adjust your version) build-system. * check the configure-values. If a tool is not found, specify its path (e.g. windres.exe, qmake.exe) * confirm the configure-values by clicking on 'Configure' again. The Makefiles respectively the project-files are now generated. == When building with MinGW == * open a console (run cmd.exe) and change into the generated build-directory * run mingw32-make == When building with Visual Studio == * Open the resulting project-file in the generated build-directory. You should now be able to compile the sources with Visual Studio. ==== Compiling on Mac OS X ==== The steps are similar to the steps needed for Linux. There are pre-compiled libs for SDL and Qt4 available. You may either have your own environment setup for compiling or you can use [[http://www.macports.org/|MacPorts]]. If you're going to build with MacPorts, you'll need to install these tools and libraries: sudo port install cmake qt4-mac libsdl If you run into a strange problem with your linker, try to add libc to the linker-flags: CMAKE_EXE_LINKER_FLAGS:STRING=-lc ===== What's next? ===== Read how to [[devel:setup|setup]] your HoldingNuts environment. For further information please take a look at [[devel:start|Development]] and [[Participate]].