Pages: [1] 2
  Print  
Author Topic: Porting OpenArena to FreeBSD  (Read 36395 times)
kamikaze
Nub


Cakes 2
Posts: 19


« on: May 19, 2010, 01:45:52 PM »

The last version of OpenArena available on FreeBSD is 0.7.1.

I ported the ioq3 1.36 to FreeBSD and my patches were later committed to ioq3 HEAD, of which I regularly port snapshots: http://www.freshports.org/games/ioquake3-devel
Currently the OpenArena SVN code (r1784) builds and runs on FreeBSD out of the box.

I'm considering a similar involvement in OpenArena and I wonder how much the code differs. Are ioq3 changes regularly ported back to OA?
Logged
sago007
Posts a lot
*

Cakes 62
Posts: 1664


Open Arena Developer


WWW
« Reply #1 on: May 19, 2010, 02:09:18 PM »

The last OpenArena source from http://openarena.ws/board/index.php?topic=1933.0 should contain changes up to ioquake3 r1783. The tar ball contains the .svn-files to make it easy to just type "svn update" and hope to get the ioquake3 changes... this has become harder over time though...
Logged

There are nothing offending in my posts.
kamikaze
Nub


Cakes 2
Posts: 19


« Reply #2 on: May 19, 2010, 02:22:02 PM »

That sounds like I could give it a shot next week and it might just work out of the box.
Logged
Peter Silie
Member


Cakes 2008
Posts: 610



« Reply #3 on: May 19, 2010, 02:52:49 PM »

Would be great to have the game on one more os!
Logged
kamikaze
Nub


Cakes 2
Posts: 19


« Reply #4 on: May 20, 2010, 04:47:08 AM »

I'm somewhat confused about the nature of releases.

You have official releases, an SVN repository and the OAX repository.

Which repository is the one that I should offer as an openarena-devel port?

How frequently do you release? Does it even make sense to offer an openarena-devel port to regular users (like it does for ioq3 with their perceived 3 year release cycle).
Logged
Peter Silie
Member


Cakes 2008
Posts: 610



« Reply #5 on: May 20, 2010, 06:01:13 AM »

How frequently do you release?

release? oa?
Dunno!
Next release estimated 2017 i guess Grin (scnr)
Logged
kamikaze
Nub


Cakes 2
Posts: 19


« Reply #6 on: May 20, 2010, 08:58:29 AM »

So generally I'd treat the local SVN as the stable branch and OAX as the devel branch?

And I'd probably have to create my own source snapshots. Is only the code in OAX and the local SVN different or does the game data also differ?
Logged
sago007
Posts a lot
*

Cakes 62
Posts: 1664


Open Arena Developer


WWW
« Reply #7 on: May 20, 2010, 09:25:34 AM »

The commits to the official svn is so infrequent that one has to presume that it is out of date. It has the source used for final releases in tar-balls and is the safe choice if you want a permanent link. .

OAX only contains code for the game logic - the qvm files. This was split from the code for the binaries because OpenArena just uses a slightly modified binary for that.

There are no SVN that contains the code for the binary as code. There is not supposed to be any engine development in OA but that has slipped a bit to the point there a simple patch is not enough.

The previously mentioned thread http://openarena.ws/board/index.php?topic=1933.0 has the latest test binaries with source. They change regularly but the old links still work if you can remember them. They keep full compatibility with current release (currently 0.8.1 and 0.8.5) unless otherwise stated.

It depends on what you want to do. Building on the latest test branch will work and will make it easier to apply any patches in the future but people might question why it is based of a test binary.
Logged

There are nothing offending in my posts.
kamikaze
Nub


Cakes 2
Posts: 19


« Reply #8 on: May 20, 2010, 12:51:18 PM »

I'm not interested in any binaries (none of them will run on FreeBSD anyway). Only the release and the devel source. I'll create the necessary build magic to create FreeBSD binary packages and an OpenArena data package, which both binary packages will depend on. Because of the similarities I might even be able to reuse most of the ioquake3 magic it might be almost as simple as the ioquake3-devel Ports Makefile: http://www.freebsd.org/cgi/cvsweb.cgi/ports/games/ioquake3-devel/Makefile?rev=1.6;content-type=text%2Fplain

The FreeBSD build servers will then automatically provide both release and devel packages in regular intervals. It will be possible to install both versions, so you can use both release and devel versions, the same as I am doing with ioquake3.
Logged
sago007
Posts a lot
*

Cakes 62
Posts: 1664


Open Arena Developer


WWW
« Reply #9 on: May 20, 2010, 01:24:37 PM »

The FreeBSD build servers will then automatically provide both release and devel packages in regular intervals. It will be possible to install both versions, so you can use both release and devel versions, the same as I am doing with ioquake3.
Unfortunate this project does not have such a nice way to release source files.

Closest things:
Stable are stored somewhere in here: http://openarena.ws/svn/source/081/ (yes, it is a tar ball on svn)
Testing are stored here: http://files.poulsander.com/~poul19/public_files/oa/dev081/ (yes, that is not on the openarena.ws-domain)

And they will both change then 0.9.x is released.

OAX can be ignored. It does not contain engine-source.

I realize that I sometimes use the term "binary source": What I mean is "engine code".
Logged

There are nothing offending in my posts.
kamikaze
Nub


Cakes 2
Posts: 19


« Reply #10 on: May 20, 2010, 10:41:21 PM »

In that case I'll create engine source snapshots. I have to do that for the ioq3-devel, too.
Logged
kamikaze
Nub


Cakes 2
Posts: 19


« Reply #11 on: May 21, 2010, 08:25:48 AM »

Your SVN repository is a messy nightmare.

Where is the 0.8.5 engine source? I only can find the 0.8.1 source, in a tar.bz2. WTF is a tar.bz2 doing in an SVN repository?
Logged
Falkland
Member


Cakes 6
Posts: 590


« Reply #12 on: May 21, 2010, 10:12:35 AM »

Your SVN repository is a messy nightmare.

Yes it is indeed , because the project owner ( who is the only one having write access to it ) just use it as an "enhanced - for him/her - ftp server" instead of a "source version control repository"
Logged
kamikaze
Nub


Cakes 2
Posts: 19


« Reply #13 on: May 21, 2010, 11:13:31 AM »

It kinda makes sense that way.

There's code in source/code, but it lacks the Makefile and was committed 2008, so I figure it's not what I'm looking for.

So, does this mean the code is on a single person's hard disks, producing occasional binary builds without publishing the source and there's no way for me to get the code? I feel ridiculed.
Logged
Falkland
Member


Cakes 6
Posts: 590


« Reply #14 on: May 21, 2010, 11:35:43 AM »

So, does this mean the code is on a single person's hard disks, producing occasional binary builds without publishing the source and there's no way for me to get the code? I feel ridiculed.

There's no svn tree for the engine sources . The engine source code is stored here : http://files.poulsander.com/~poul19/public_files/oa/dev081/ ( as reported by sago007 ) under tar.bz2 archives.

The archive used for building official OA085 binary should be that named as openarena-engine-source-0.8.x-13.tar.bz2

Anyway OA runs also with binaries produced with the latest archive ( openarena-engine-source-0.8.x-15.tar.bz2 )

The archive contains the original ioquake3 .svn dir with all the infos about the latest revision used to produce the archive.

What I personally do to obtain a unified patch is comparing the same original ioquake3 revision with the sources of the archive
Logged
kamikaze
Nub


Cakes 2
Posts: 19


« Reply #15 on: May 21, 2010, 01:35:53 PM »

OK, thanks everyone for the help. I feel kinda bad about overlooking the second link in sago007's post. Thank you for your patience.

I only needed to update the Makefile to get the thing to build. I'd be glad if that made it into the official source.

Apart from the last two chunks all changes are to the freebsd section of the Makefile, so this should be a no-brainer.

Here is the patch (based on the openarena-engine-source-0.8.x-15.tar.bz2 source):
Code:
--- Makefile.orig 2010-04-24 23:29:15.000000000 +0200
+++ Makefile 2010-05-21 21:29:25.000000000 +0200
@@ -561,45 +561,16 @@
 
 ifeq ($(PLATFORM),freebsd)
 
-  ifneq (,$(findstring alpha,$(shell uname -m)))
-    ARCH=axp
-  else #default to i386
-    ARCH=i386
-  endif #alpha test
-
-  BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
-    -DUSE_ICON
+  # flags
+  BASE_CFLAGS = $(shell env MACHINE_ARCH=$(ARCH) make -f /dev/null -VCFLAGS) \
+    -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \
+    -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON
   CLIENT_CFLAGS = $(SDL_CFLAGS)
   SERVER_CFLAGS =
+  HAVE_VM_COMPILED = true
 
-  ifeq ($(USE_OPENAL),1)
-    CLIENT_CFLAGS += -DUSE_OPENAL
-    ifeq ($(USE_OPENAL_DLOPEN),1)
-      CLIENT_CFLAGS += -DUSE_OPENAL_DLOPEN
-    endif
-  endif
-
-  ifeq ($(USE_CODEC_VORBIS),1)
-    CLIENT_CFLAGS += -DUSE_CODEC_VORBIS
-  endif
-
-  OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer
-
-  ifeq ($(ARCH),axp)
-    BASE_CFLAGS += -DNO_VM_COMPILED
-    OPTIMIZEVM += -fexpensive-optimizations
-  else
-  ifeq ($(ARCH),i386)
-    OPTIMIZEVM += -mtune=pentiumpro \
-      -march=pentium -pipe -falign-loops=2 -falign-jumps=2 \
-      -falign-functions=2 -funroll-loops -fstrength-reduce
-    HAVE_VM_COMPILED=true
-  else
-    BASE_CFLAGS += -DNO_VM_COMPILED
-  endif
-  endif
-
-  OPTIMIZE = $(OPTIMIZEVM) -ffast-math
+  OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer -ffast-math
+  OPTIMIZE = $(OPTIMIZEVM)
 
   SHLIBEXT=so
   SHLIBCFLAGS=-fPIC
@@ -613,17 +584,40 @@
 
   CLIENT_LIBS += $(SDL_LIBS) -lGL
 
+  # optional features/libraries
   ifeq ($(USE_OPENAL),1)
-    ifneq ($(USE_OPENAL_DLOPEN),1)
+    CLIENT_CFLAGS += -DUSE_OPENAL
+    ifeq ($(USE_OPENAL_DLOPEN),1)
+      CLIENT_CFLAGS += -DUSE_OPENAL_DLOPEN
       CLIENT_LIBS += $(THREAD_LIBS) -lopenal
     endif
   endif
 
+  ifeq ($(USE_CURL),1)
+    CLIENT_CFLAGS += -DUSE_CURL
+    ifeq ($(USE_CURL_DLOPEN),1)
+      CLIENT_CFLAGS += -DUSE_CURL_DLOPEN
+      CLIENT_LIBS += -lcurl
+    endif
+  endif
+
   ifeq ($(USE_CODEC_VORBIS),1)
-    ifeq ($(PLATFORM),mingw32)
-      CLIENT_LIBS += $(LIBSDIR)/win32/libvorbisfile.a $(LIBSDIR)/win32/libvorbis.a $(LIBSDIR)/win32/libogg.a
-    else
-      CLIENT_LIBS += -lvorbisfile -lvorbis -logg
+    CLIENT_CFLAGS += -DUSE_CODEC_VORBIS
+  endif
+
+  ifeq ($(USE_CODEC_VORBIS),1)
+    CLIENT_LIBS += -lvorbisfile -lvorbis -logg
+  endif
+
+  # cross-compiling tweaks
+  ifeq ($(ARCH),i386)
+    ifeq ($(CROSS_COMPILING),1)
+      BASE_CFLAGS += -m32
+    endif
+  endif
+  ifeq ($(ARCH),amd64)
+    ifeq ($(CROSS_COMPILING),1)
+      BASE_CFLAGS += -m64
     endif
   endif
 
@@ -1555,6 +1549,9 @@
   ifeq ($(ARCH),x86_64)
     Q3OBJ += $(B)/client/vm_x86_64.o $(B)/client/vm_x86_64_assembler.o
   endif
+  ifeq ($(ARCH),amd64)
+    Q3OBJ += $(B)/client/vm_x86_64.o $(B)/client/vm_x86_64_assembler.o
+  endif
   ifeq ($(ARCH),ppc)
     Q3OBJ += $(B)/client/vm_powerpc.o $(B)/client/vm_powerpc_asm.o
   endif
@@ -1720,6 +1717,9 @@
   ifeq ($(ARCH),x86_64)
     Q3DOBJ += $(B)/ded/vm_x86_64.o $(B)/ded/vm_x86_64_assembler.o
   endif
+  ifeq ($(ARCH),amd64)
+    Q3DOBJ += $(B)/ded/vm_x86_64.o $(B)/ded/vm_x86_64_assembler.o
+  endif
   ifeq ($(ARCH),ppc)
     Q3DOBJ += $(B)/ded/vm_powerpc.o $(B)/ded/vm_powerpc_asm.o
   endif
What is the official way to submit patches?
Logged
Peter Silie
Member


Cakes 2008
Posts: 610



« Reply #16 on: May 21, 2010, 02:25:59 PM »

Usualy the "SVN Commits"-Thread -> http://openarena.ws/board/index.php?topic=1945.0
Logged
kamikaze
Nub


Cakes 2
Posts: 19


« Reply #17 on: May 21, 2010, 05:50:11 PM »

Thank you, I posted the patch there.

The FreeBSD port is completed. Everything seems to be working fine, both regular OA and OAX. I have to wait for my ioquake3 changes to be committed (http://www.freebsd.org/cgi/query-pr.cgi?pr=146810), before I can submit openarena and oax and there'll be an additional delay for taking over maintainership of the openarena port, so it will take some time to get it all into the repository, but the actual work is done. Grin
Logged
Peter Silie
Member


Cakes 2008
Posts: 610



« Reply #18 on: May 22, 2010, 04:15:26 AM »

Great work and thx a lot!
Logged
kamikaze
Nub


Cakes 2
Posts: 19


« Reply #19 on: May 22, 2010, 07:45:39 AM »

The PR is here:
http://www.freebsd.org/cgi/query-pr.cgi?pr=146818

Since the current maintainer hasn't contributed to the port since 2007, I expect he's inactive and will not respond. In that case the submission will hang there for two weeks before it may be committed. But anyone can take the patches and test it.
Logged
HelloKitty!
Lesser Nub


Cakes 12
Posts: 115



« Reply #20 on: May 22, 2010, 10:51:44 AM »

Although I don't run BSD, this work is very useful and important. Thanks for taking the time!
Logged
kamikaze
Nub


Cakes 2
Posts: 19


« Reply #21 on: March 19, 2011, 04:51:02 PM »

Just a little heads up. I'm still maintaining this.

Currently I'm doing test builds with the revision 1910 based code and oax-B48.
Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #22 on: March 19, 2011, 05:17:43 PM »

Considering the spotty 3d video acceleration among the BSD platform, is a software renderer still a plausible idea?

I mean, there's more chance a BSD machine would have working SSE2 than basic, 1998-level 3d accel...
Logged

asking when OA3 will be done won't get OA3 done.
Progress of OA3 currently occurs behind closed doors alone

I do not provide technical support either.

new code development on github
andrewj
Member


Cakes 24
Posts: 584



« Reply #23 on: March 20, 2011, 01:28:17 AM »

is a software renderer still a plausible idea?
Shaders are the biggest problem, also high poly player models (need some LOD stuff), and of course just looking bad in 8-bit mode and too slow in 16/32 bit modes.

in a word: no
Logged
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #24 on: March 20, 2011, 04:37:16 AM »

in a word: no

dpsoftrast.c

in a word: yes
Logged

asking when OA3 will be done won't get OA3 done.
Progress of OA3 currently occurs behind closed doors alone

I do not provide technical support either.

new code development on github
Pages: [1] 2
  Print  
 
Jump to: