Fandom

Naval Battle Wiki

Installation

6pages on
this wiki
Add New Page
Comments0 Share

There are several ways to install Naval Battle. You may get prebuilt binaries if there are any suitable for your distro. And of course, you may always build the game from source code for yourself - just grab the compiler and all other tools necessary.

Download the binaries Edit

Linux Edit

Ubuntu Edit

Ubuntu users may get Naval Battle builds from the author's PPA, which stands for a Personal Package Archive. It is added to the list of your software sources fairly easy:

$ sudo apt-add-repository ppa:al-exquemelin/navbattle

if you wish to update only when a stable release is published or

$ sudo apt-add-repository ppa:al-exquemelin/navbattle-daily

if you prefer updating every time the source code in the actual series gets updated (once every 24 hours is the limit). See version history for more details on how the development process is organised in the Naval Battle project.

Having added the PPA, you may act just like with regular repositories:

$ sudo apt-get update
$ sudo apt-get install navbattle

This will install the latest build in the chosen PPA.

Building from source Edit

The actual Naval Battle series is 0.1; the latest release is 0.1.3.

Active development of Naval Battle is led in the trunk series. To get some more or less stable code refer to numbered series (0.1, 0.2, etc.). See version history for details.

Linux Edit

Ubuntu Edit

This is the standard procedure for most Ubuntu-based distros (Xubuntu, Kubuntu, etc.) as long as they use apt-get and the same repo system.

1. Naval Battle is hosted at Launchpad, so you'll need Bazaar to get the code. Install it:

$ sudo apt-get install bzr

You might also get the bzr-doc package if you want some more information on using Bazaar.

2. Now navigate to a directory of your choosing (e.g. ~/) and get the code by typing

$ bzr branch lp:navbattle/0.1

This will create a directory named ./0.1 and download the most fresh code available into it.

3. To build the game successfully you'll have to provide some dependencies. First of all, make sure that you have g++ and make installed (which is the case often, but you'd better double-check).

Then install all the SDL related development packages:

$ sudo apt-get install libsdl-dev libsdl-image1.2-dev libsdl-ttf2.0-dev

Note that libsdl-image1.2-dev depends on libsdl-image1.2, so you'll have both packages installed. The same is true for the rest of the packages mentioned.

4. The rest is simple. Just go to the directory you have downloaded the code into:

$ cd ./0.1

and start building the game by typing

$ make

You may specify the target needed: thus, if you want to hunt down some annoying bug, you should use

$ make debug

5. Run the game by typing

$ ./navbattle

Arch Linux Edit

The installation procedure consists of quite the same steps as in Ubuntu, except that you use pacman instead of apt-get. Also mind the difference in package names (there are no -dev packages in Arch repositories).

Thus, to get the dependencies needed use

$ sudo pacman -Ss make gcc sdl sdl_image sdl_ttf

then build everything normally.

Windows Edit

1. Get Bazaar client for Windows at http://wiki.bazaar.canonical.com/WindowsDownloads and install it. The standalone installer is preferable.

2. Run Bazaar Explorer from Windows main menu.

3. Click Get project source from elsewhere button, then Branch button.

4. Enter lp:navbattle/0.1 into From field and change the path in To field to your liking. Click OK.

5. Click Yes to initialize a shared repository.

6. Click OK, then Close.

7. Click OK once more and wait while Bazaar downloads all the revisions necessary.

8. Click Close. You now have the source code and may quit Bazaar client.

9. Now it's on to the compilation. While this example uses MinGW, you may use any compiler you like - with correspondent changes to the process, of course. Get the latest MinGW installer.

10. Run the installer and click Install. In the following window, you may change to options to your liking or just click Continue. Wait while the download process finishes, then click Continue.

11. Mark the packages you wish to install. For this particular task we'll need mingw32-base, mingw32-gcc-g++ and mingw32-msys. Now select Apply Changes from the Installation menu. Click Apply and wait for the packages to be downloaded and installed.

12. Click Close, then exit MinGW Installation Manager.

13. Make sure MSYS can find MinGW. Locate C:\MinGW\msys\1.0\etc\fstab.sample and rename or copy it to C:\MinGW\msys\1.0\etc\fstab (the paths may vary depending on where you installed MinGW). Open this file with a text editor and make sure it contains, among others, the following line:

C:/MinGW   /mingw

Change it corresponding to your MinGW path or leave it unchanged in case you used the default one. Save and close the file.

14. Locate C:\MinGW\msys\1.0\msys.bat and run it (the path may vary depending on where you installed MinGW). A command shell should appear.

15. Copy the source code into your MSYS environment, i.e. copy C:\navbattle\0.1 to C:\MinGW\msys\1.0\home\al_exquemelin, where al_exquemelin is your MinGW username.

16. Time to get SDL itself. Go to http://libsdl.org/release/ and download SDL-devel-1.2.15-mingw32.tar.gz. Unpack the archive (you may use gunzip and tar utilities included in MSYS).

17. Now distribute the archive's contents as follows.

  • Copy the .a files from archive's \lib directory into C:\MinGW\lib.
  • Copy everything from archive's \include\SDL directory into C:\MinGW\include.
  • Copy SDL.dll from archive's \bin directory into the directory where our executable will be created (e.g. C:\MinGW\msys\1.0\home\al_exquemelin\trunk).

18. Download https://www.libsdl.org/projects/SDL_image/release/SDL_image-devel-1.2.12-VC.zip and unpack the archive.

  • Put SDL_image.h from the archive's \include directory into C:\MinGW\include.
  • Put SDL_image.lib from the archive's \lib\x86 directory into C:\MinGW\lib.
  • Put SDL_image.dll, libpng15-15.dll from the archive's \lib\x86 directory into C:\MinGW\msys\1.0\home\al_exquemelin\trunk.

19. Download https://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-devel-2.0.11-VC.zip and unpack the archive.

  • Put SDL_ttf.h from the archive's \include directory into C:\MinGW\include.
  • Put SDL_ttf.lib from the archive's \lib\x86 directory into C:\MinGW\lib.
  • Put SDL_ttf.dll, libfreetype-6.dll, zlib1.dll from the archive's \lib\x86 directory into C:\MinGW\msys\1.0\home\al_exquemelin\trunk.

20. Copy libgcc_s_dw2-1.dll, libstdc++-6.dll from C:\MinGW\bin to C:\MinGW\msys\1.0\home\al_exquemelin\trunk.

21. If the shell is not running yet execute C:\MinGW\msys\1.0\msys.bat. Navgate to
$ ~/trunk
and type
$ make debug
at the prompt. The resulting executable, named navbattle.exe, must now appear in your trunk directory.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.