Testing frogatto from SVN


#1

Hi there, I thought it would be good to have a little manual on this. It’s work in progress so please post as much feedback as possible.

Chapters (Grey is to do):

[ul][li]The Frogatto SVN-repository[/li]
[li]The SVN commandline tool[/li]
[li]Graphical client RapidSVN[/li]
[li]Compiling on Linux[/li]
[li]Compiling on Windows
[list]
[li]Using Cygwin[/li]
[li]Using MinGW[/li]
[li]Using Ms Unix Services for Windows[/li]
[li]Using Ms Visual C++[/li]
[/list]
[/li]
[li]Compiling on Mac OS
[list]
[li]Using GnuMake[/li]
[li]Using XCode[/li]
[/list]
[/li]
[li]?[/li][/ul]

[size=12pt]The Frogatto SVN-repository[/size]
SVN stands for Subversion and is a version control system. Every committer (->The developers) can commit his local changes to the repository on the SVN-server. Every commit will create a new revision which is like a number for every single version of the repository.
The Frogatto repository is public since revision 125, everyone can download from it. The current revision 3470 but often, it increases multiple times a day. The url of the Frogatto repo is svn://frogatto.com/home/ben/svn/frogatto/trunk/. To Access it, you’ll need an SVN client. There are no Binaries in the Repository. I’ll explain how to compile them later.
SVN can be used through the simple svn commandline program or through a graphical client which likely is more intuitive.

[size=12pt]The SVN commandline tool[/size]
On some Linux distriutions, subversion is present by default, on others, you’ll have to install it through:

On Debian and it’s derivatives (like Ubuntu)

Fedora

Arch Linux

(The # means that it needs to be run as root, so you might have to put a sudo to the beginning)

If you want to compile it on your own, you can find source releases here.

For Mac you can find Binaries at http://www.open.collab.net/downloads/community/ or you can install subversion through Mac-Ports later.

On Windows, it will come with the Build enviorenment we’ll install later. In case you prefer to compile with Ms Visual C++, I recommend to simply use the graphical client.

The command to run the subversion commandline program is ‘svn’. Through

you can download or update to the current revision of the repository to the directory frogatto (created if nonexistent) in the current path.

Using

You can revert local changes to the “file”.

Will update a file or directory to the current revision.

[size=12pt]Graphical client RapidSVN[/size]
I recommend RapidSVN as a graphical SVN client. Binary packages are available for Windows Linux and Mac. Using Repostitory/Checkout, you can enter the SVN URL and a directory to download to. Everything else should be self explanatory.

[size=12pt]Compiling on Linux[/size]
Compiling on Linux is Quite easy. The development files (The Headers) of SDL, SDL_image, SDL_mixer, SDL_ttf, libpng, OpenGL, GLEW, GLU and boost need to be installed. On Debian, Ubuntu and other derivates, you can use:

Also you need the build-essentials (Compiler, GnuMake etc):

Now open a terminal and cd to the directory in which you checked out the frogatto repository.
You can use ccache to recompile faster (apt-get install ccache), otherwise you have to edit the Makefile and remove ccache in line 13.

Then, in the directory with the Makefile run

(Without the $, it indicates that you should run this as an unprivileged user) and wait until it’s compiled. If there’s an error you should try to compile using

to ignore leftovers from earlier compilations but this will take longer. If that doesn’t help, please respond to this thread and show the last few lines of the make-output.

For translation-support, you need to let it generate the .mo language files from the .po’s.

You can compile the multiplayer server using

If everything worked, there should be a ‘game’ binary in the directory now. This is the newest frogatto SVN build. Use

./game
to run it.

[size=12pt]Compiling on Windows[/size]

[b]- TODO -[/b]

[size=7pt]
Update:
Just played around with the Windows Services for Unix and found I don’t like them, so no tutorial for them, I’ll work on a cygwin tut now.
[/size]


#2

Good initiative, sir!
I don’t know if this was in your plans, but you may want to add something about svn update, so people can keep up with development when testing;
Also, you should change the “make” line to “make clean; make” as changes in the source code after a first compile will lead to inconsistencies.


#3

Had it in earlier but thought re checking out would be enough. Added, thanks.

That shouldn’t be. If a source of one of the object is update (Has a newer timestamp than the object itself) the object will be recompiled, same applies to everything that depends on this object. That’s the point about Makefiles; They help with partial compilation. If the Makefile looks like this:

[code]game : main.o editor.o
gcc -lexample main.o editor.o

main.o : main.c
gcc main.c

editor.o : editor.c
gcc editor.c

clean :
rm editor.o main.o
[/code]
It won’t recompile the editor if you only change the main.c. If you call make clean, the next time you run make it’ll have to recompile both. Thanks for the notice anyways.


#4

In your example, say editor.c and main.c include tiles.h, and tiles.h and main.c both change, but editor.c doesn’t change, that could lead to problems. If tiles.h contains a definition for a class (or struct, since apparently we’re dealing with C here), and previously it was one size, and now it’s bigger, code in main.c will think it’s one size, and code in editor.c will think it’s another. That can lead to extremely messed up problems. Anyway, Makefiles CAN be made to be smart enough to know about header dependencies, but ours are not (generally autoconf, scons, cmake, etc. do that for you).


#5

Makefiles HAVE TO be made to be smart enough to work as they’re intended to be, sorry for this little point of critisism (In case this doesn’t apply to yours) but a makefile that has to be cleaned before recompilation is quite useless. Otherwise you could use any kind of non targert oriented script to do the job. It’s a bit difficult to imagine a Makfile from your explanation but shouldn’t it solve the problem to let everything depend on the headers it’s using.


#6

On Arch, when user wants to build something from VCS, that something’s source tree first cloned (or updated to current revision) into a separate dir (‘frogatto’), and then that dir is being recursively copied to another dir (‘frogatto-build’). Oh, and the second dir is cleaned every time before copying, yeah. This way you’ve got the most fresh, clean and ready to be built source tree each time you want. I hope you got the idea.

I think that’s a good practice. Sure, it consumes more space, but it completely eliminates makefile problems (when they are not smart enough or not complicated enough).

I’d also like to hear devs on the subject, like how important it is (or isn’t) to test Frogatto from svn right now. Personally, I have one bug I’d like to see disappear (:


#7

This is a different situtation because the aim of ABS is to create a binary package once. If you have a local copy of the svn repo, you’re going to recompile quite often and then you can profit of partial recompilation through the Makefile (Whole recompilation takes very much time). Do you really want to say that the point about using Makefiles (and other target oriented build systems) would not be partial compilation of changed code so that there’s no need for redundant recompilation of unchanged code?

By the way, ‘make clean; make’ should be identical to ‘make -B’.

I (as no developer but someone who might write a patch for it) think there’s nothing wrong about reporting it :wink:

Edit:
If you show me an example where running make with already built objects will cause problems, I’ll make an improved unix/linux Makefile with object lists, header dependencies, optional ccache (atm ccache is ‘hardcoded’ into the makefile which has to be edited if no ccache should be used) etc.


#8

[quote=“Joo, post:7, topic:98”]Do you really want to say that the point about using Makefiles (and other target oriented build systems) would not be partial compilation of changed code so that there’s no need for redundant recompilation of unchanged code?[/quote]That’d be a good feature, but it’s not a must. I mean, you already have ccache, which should deal exactly with recompiling only new stuff, why do the same job in makefiles too? Fix me if I wrong; I’m just using ccache, I don’t know how it works internally.

Well, it’s true that I can’t make a package of the same version twice with makepkg (without --force). But that’s not the point, the point is to be a bit more failproof by avoiding awkward situations. And if you can’t build something from clean sources, then your problem isn’t some old compiled garbage in source tree, that’s for sure (:

I think I’ve ran into problems with old binaries a couple of times with different projects. But every time I’ve had cleaned everything related, because it’s the simplest solution. KISS, you know (:


#9

I need a small guide to compile Frogatto in Windows (using Dev-c++ or Code::Blocks) so MinGW, …

Please can anyone give steps to success compile in Windows?
Thanks !!


#10

[quote=“nasty, post:9, topic:98”]I need a small guide to compile Frogatto in Windows (using Dev-c++ or Code::Blocks) so MinGW, …

Please can anyone give steps to success compile in Windows?
Thanks !![/quote]

Basically you can just download all the dependencies and run the Makefile (if you have gnumake-mingw). The dlltool coming with mingw can convert .lib library binaries to the .la format mingw needs. But it didn’t work for me yet, had a lot of strange problems (compiler segfaults etc.)


#11

On Ubuntu 11.04.

These files are no longer can be found. “sudo apt-get install libsdl-dev libsdl-image-dev libsdl-mixer-dev libsdl-ttf-dev libpng-dev libglew-dev libglu-dev libboost-dev”

Reading package lists… Done
Building dependency tree
Reading state information… Done
Note, selecting ‘libsdl1.2-dev’ instead of 'libsdl-dev’
Note, selecting ‘libpng12-dev’ instead of 'libpng-dev’
Note, selecting ‘libglew1.5-dev’ instead of 'libglew-dev’
Note, selecting ‘libglu1-mesa-dev’ instead of 'libglu-dev’
Package libsdl-image-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package libsdl-mixer-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘libsdl-image-dev’ has no installation candidate
E: Package ‘libsdl-mixer-dev’ has no installation candidate
E: Unable to locate package libsdl-ttf-dev


#12

... should work on a default installation of Ubuntu 11.04 or Debian GNU/Linux 6.0.

… should work on a default installation of Ubuntu 11.04 or Debian GNU/Linux 6.0.


#13

OK I fix my problem. > install ccache


#14

Did the make multiplayer server support drop? I can’t make that one. Just wondering what it does. Missing two files.