With cordite in the air, splintered steel, shell casings and powder burns, there’s only one explanation...
Discuss & improve the game engine.

Moderators: sparcdr, torhu, Tequila

[Tutorial] Compiling on FreeBSD

Postby Barto » Sat May 04, 2013 8:55 pm

In this small tutorial, I will explain how to compile the game on a FreeBSD system. I will use the latest release of FreeBSD which is the 9.1 today with the bootonly CD on a amd64 system.

  • Why
  • Getting the tools
  • Getting the code
  • Compilation
  • Update
  • Troubles

There are few reasons that may motivate you from compiling SG from source:
  • You want to do some beta testing on this not so well known platform
  • You want to discover the new changes in the game code because you are a bsd user.
  • Or you want to get the game working without the linux-compatible mode on your server/own machine

Getting the tools
For being sure I haven't missed anything, I'll start with a really empty FreeBSD installation and I will be quite fast in the explanations since those users do know how to type a console command and may have done those steps already ;-)

So, log in root and type:
Code: Select all
pw user mod <yourname> -G wheel # being able to become root from your usual user

Logout from root. Then in your user account (may need a reload), type:
Code: Select all
pkg_add -r xorg vim xfce4 # at least having something proper to use and having the GL libs
Xorg -configure && mv ~/xorg.conf.new /etc/X11/xorg.conf

Then add in /etc/rc.conf those lines:
Code: Select all

Then you can exit the su mode and then type:
Code: Select all
echo "/usr/local/bin/startxfce4" > ~/.xinitrc

Now you need to reboot for applying the changes to rc.conf. When done, log in as a your usual user and then type:
Code: Select all

Set via the interface your keymap, then open the terminal and type:
Code: Select all
pkg_add -r sudo firefox scite # well...
cd /usr/ports/game/ioquake-devel/
make build-depends-list
pkg_add -r libvorbis openal-soft gmake pkgconf sdl12 curl fpc-sdl git zip

Then add yourself to the sudoers, for that matter launch:
Code: Select all

and and this line:
Code: Select all
<yourname> ALL=(ALL) ALL

And you are done!

Getting the code
Open the terminal and type:
Code: Select all
git clone https://github.com/smokin-guns/SmokinGuns.git

Open the terminal and type:
Code: Select all
cd SmokinGuns/
gmake # don't confuse with the BSD make that is totally different, you need to use GNU Make
cd build/release-freebsd-amd64/
cp *.amd64 /where/you/installed/the/game/
cp *.so /where/you/installed/the/game/
cd smokinguns/
zip -r z_vm.pk3 vm/
mv z_vm.pk3 /where/you/installed/the/game/smokinguns/

If you want to update the code, open the console and type:
Code: Select all
cd SmokinGuns/
git pull

and redo the compilation process.

  • If it doesn't compile for some reason when you just updated the code, try to remove the build folder and try to compile again. If it doesn't make the trick, contact the developers via the forum.
  • If you spot any bug while testing, just contact the developers via the forum or make a bug report (you will still need a forum account to log in here, in small caps).
  • If you want to play with the sources, I suggest you to learn git (especially the checkout command), there are plenty of tutorials around.
  • For some other problems, don't be scared to contact any developer or me (#smokinguns on freenode, this forum, email, etc.)
"Chuck Norris had to shorten his beard in the presence of Richard Stallman because two beards that awesome, so close would segfault the universe (again)."
User avatar
Jeuxlinux Admin
Posts: 360
Joined: Fri Oct 23, 2009 5:08 pm
Location: Switzerland

Return to Code

Show Sidebar
Show Sidebar

User Control Panel