Modding, Mission Design, and Coding > Cross-Platform Development

OpenBSD port

(1/9) > >>

subliminal:
I managed to compile fs2_open on OpenBSD 5.5 AMD64. It works nicely.
Only two problems were encountered while compiling and those are:
1) Missing OpenBSD entry in the configure script (it was treated as an unknown OS).
2) Missing lua.pc (in OpenBSD it's named "luaversionnumber.pc", "lua51.pc" in this case).

Step by step tutorial:
Install all the necessary dependencies (all of which are available in the package repository).
Download the source code tarball (e. g. 3.7.2 RC4).
Replace AUTOMAKE_VERSION, AUTOCONF_VERSION and lua**.pc with the ones you have installed on your system.

--- Code: ---cd /home/user/Downloads
tar xzvf fs2_open_3_7_2_RC4_src.tgz
cd fs2_open_3_7_2_RC4
export AUTOMAKE_VERSION=1.9  AUTOCONF_VERSION=2.69
su
cp /usr/local/lib/pkgconfig/lua51.pc /usr/local/lib/pkgconfig/lua.pc
exit
vi configure.ac

--- End code ---

Find the line saying:
--- Code: --- case "$target" in
--- End code ---
and add this after the FreeBSD entry:


--- Code: ---*openbsd*)
# openbsd
echo "OPENBSD $host_cpu-$host_os"
fs2_os_bsd="yes"
if test "$host_cpu" = "amd64"
then
D_CFLAGS="$D_CFLAGS -m64 -march=athlon64 -ansi"
fi
D_CFLAGS="$D_CFLAGS -DLUA_USE_LINUX"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
;;

--- End code ---

Then just compile as usual:

--- Code: ---./autogen.sh
su
make install
exit

--- End code ---

Play the game!

--- Code: ---cp /usr/local/bin/fs2_open_3.7.2_RC4 /home/user/freespace2
cd /home/user/freespace2
su
chmod 0666 /dev/drm*
exit
chmod +x fs2_open_3.7.2_RC4
./fs2_open_3.7.2_RC4

--- End code ---
Add command line options to your liking:
http://www.hard-light.net/wiki/index.php/Command-Line_Reference

The chmod 0666 part is essential if you don't want your game started in software mode (it's slow!).
You can download the port from here:
https://github.com/subliminalshadow/openbsd/tree/master/ports/games

chief1983:
Interesting, I was contemplating adding another nightly build arch to experiment with Vagrant.  Maybe I'll make it an OpenBSD one.

subliminal:
wxLauncher compiles as well. Just follow the readme, be sure you have all the dependencies installed and add:
--- Code: ----DPYTHON_EXECUTABLE=/usr/local/bin/python2.7
--- End code ---
(else it will complain of missing markdown).

Like this:

--- Code: ---cmake -DPYTHON_EXECUTABLE=/usr/local/bin/python2.7 -DUSE_OPENAL=1 -DCMAKE_INSTALL_PREFIX=/usr/local ../
--- End code ---
Copy the resulting binary to your freespace2 directory and have fun.

subliminal:
I made the ports for fs2_open and wxlauncher. You just need to download the archives and untar into /usr/ports/games. Then, cd to each directory and run
--- Code: ---make install
--- End code ---
Finally, you can run both the fs2_open binary and wxlauncher from your freespace2 data directory.

https://github.com/subliminalshadow/openbsd/tree/master/ports/games

NOTE: These are the first OpenBSD ports I made, so, feel free to report any bugs and mistakes considering the Makefiles.
UPDATE: 3.7.2 RC4 suffers from segmentation fault when beams are fired
UPDATE2: -no_3d_sound fixes the crash for 3.7.2 RC4
UPDATE3: recent revisions work perfectly

chief1983:
I still need to fire up an OpenBSD VM to try this out for myself.

Navigation

[0] Message Index

[#] Next page

Go to full version