Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Apr 2015 13:43:48 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r383919 - in head/games: . openbor openbor/files
Message-ID:  <201504131343.t3DDhmAv002108@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Mon Apr 13 13:43:47 2015
New Revision: 383919
URL: https://svnweb.freebsd.org/changeset/ports/383919

Log:
  Add new port games/openbor
  
  PR:		196657
  Reviewed by:	games (danfe, partial of earlier version)
  Approved by:	bapt (mentor, earlier version)
  
  OpenBOR is a continuation of the Beats Of Rage 2D game engine, which
  was originally created by Senile Team.
  
  WWW: http://www.chronocrash.com

Added:
  head/games/openbor/
  head/games/openbor/Makefile   (contents, props changed)
  head/games/openbor/distinfo   (contents, props changed)
  head/games/openbor/files/
  head/games/openbor/files/patch-sdl__sdlport.c   (contents, props changed)
  head/games/openbor/files/patch-source__ramlib__ram.c   (contents, props changed)
  head/games/openbor/pkg-descr   (contents, props changed)
Modified:
  head/games/Makefile

Modified: head/games/Makefile
==============================================================================
--- head/games/Makefile	Mon Apr 13 13:30:58 2015	(r383918)
+++ head/games/Makefile	Mon Apr 13 13:43:47 2015	(r383919)
@@ -672,6 +672,7 @@
     SUBDIR += openarena-oax
     SUBDIR += openarena-server
     SUBDIR += openastromenace
+    SUBDIR += openbor
     SUBDIR += openbubbles
     SUBDIR += opencity
     SUBDIR += openclonk

Added: head/games/openbor/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/openbor/Makefile	Mon Apr 13 13:43:47 2015	(r383919)
@@ -0,0 +1,100 @@
+# $FreeBSD$
+
+PORTNAME=	openbor
+PORTVERSION=	3.0.r4138
+CATEGORIES=	games
+MASTER_SITES=	LOCAL/jbeich \
+		https://svn.code.sf.net/p/${PORTNAME}/engine/engine/:svn
+
+MAINTAINER=	jbeich@FreeBSD.org
+COMMENT=	Moddable fighting game engine (aka Beats of Rage)
+
+LICENSE=	BSD3CLAUSE
+
+LIB_DEPENDS=	libvorbisfile.so:${PORTSDIR}/audio/libvorbis \
+		libpng.so:${PORTSDIR}/graphics/png \
+		libvpx.so:${PORTSDIR}/multimedia/libvpx
+
+USES=		dos2unix gmake pkgconfig tar:xz
+USE_SDL=	gfx2
+DOS2UNIX_FILES=	Makefile
+MAKE_ENV=	BUILD_LINUX=1 SDKPATH="${LOCALBASE}" \
+		GCC_TARGET="${CONFIGURE_TARGET:S/amd64/x86_64/}"
+MAKE_ARGS=	CC="${CC}" LIBRARIES="${LOCALBASE}/lib" \
+		TARGET_ARCH=${ARCH:S/i386/x86/} ARCHFLAGS="" \
+		TARGET_FINAL='$(TARGET)'
+LDFLAGS+=	-Wl,--as-needed
+PLIST_FILES=	bin/${PORTNAME} \
+		share/pixmaps/${PORTNAME}.png
+PORTDOCS=	README
+
+DESKTOP_ENTRIES="OpenBOR" \
+		"" \
+		"${PORTNAME}" \
+		"${PORTNAME}" \
+		"Game;ArcadeGame;" \
+		""
+
+.include <bsd.port.options.mk>
+
+.if ${ARCH} == i386
+BUILD_DEPENDS+=	yasm:${PORTSDIR}/devel/yasm
+.endif
+
+#
+# To update snapshot: make makesum BOOTSTRAP=
+# Specific snapshot:  make makesum SVN_FETCH= PORTVERSION=1.0.r1234
+#
+.if defined(BOOTSTRAP)
+# XXX _MASTER_SITES_svn isn't defined yet
+SVN_REV!=	${SETENV} LC_ALL=C svn info \
+			${MASTER_SITES:M*\:svn:S/:svn//} | \
+		${SED} -n 's/^Last Changed Rev: //p'
+PORTVERSION:=	${PORTVERSION:R}.r${SVN_REV}
+.else
+SVN_REV?=	${PORTVERSION:E:S/r//}
+.endif
+
+.if defined(BOOTSTRAP) || defined(SVN_FETCH)
+FETCH_DEPENDS+=	svn:${PORTSDIR}/devel/subversion
+
+do-fetch:
+	${MKDIR} ${WRKDIR}
+	svn export -r${SVN_REV} ${_MASTER_SITES_svn} ${WRKSRC}
+	(cd ${WRKDIR} && ${TAR} cJvf \
+		${_DISTDIR}/${DISTNAME}${EXTRACT_SUFX} ${DISTNAME})
+	${REINPLACE_CMD} -i '' '/^PORTVERSION=/s/r.*/r${SVN_REV}/' \
+		${MASTERDIR}/Makefile
+. if ${USER} == ${MAINTAINER:C/@.*//}
+	-scp ${_DISTDIR}/${DISTNAME}${EXTRACT_SUFX} \
+		freefall.freebsd.org:public_distfiles/
+. endif
+.endif
+
+post-patch:
+	@${REINPLACE_CMD} -e 's/ -O[0-9]//; s/ -g//; s/ -Werror//' \
+		-e 's/ -fomit-frame-pointer//' \
+		-e 's/ -freorder-blocks//' \
+		-e 's/ -Wno-unused-result//' \
+		-e 's/ -Wl,-rpath,$$(LIBRARIES)//' \
+		-e '/echo/!s/	@/	/' \
+		-e 's/$$(LIBS)/$$(LDFLAGS) &/' \
+		${WRKSRC}/Makefile
+	@${GREP} -Flr 'malloc.h' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} \
+		's,malloc\.h,stdlib.h,'
+	@${REINPLACE_CMD} -e 's/^function \(.*\) {/\1() {/' \
+		-e 's/^get_revnum/VERSION_BUILD=${SVN_REV}/' \
+		${WRKSRC}/version.sh
+
+do-configure:
+	(cd ${WRKSRC} && ${SH} ./version.sh)
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/OpenBOR.elf \
+		${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+	${INSTALL_DATA} ${WRKSRC}/resources/OpenBOR_Icon_128x128.png \
+		${STAGEDIR}${PREFIX}/share/pixmaps/${PORTNAME}.png
+	(cd ${WRKSRC} && ${COPYTREE_SHARE} \
+		"${PORTDOCS}" ${STAGEDIR}${DOCSDIR})
+
+.include <bsd.port.mk>

Added: head/games/openbor/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/openbor/distinfo	Mon Apr 13 13:43:47 2015	(r383919)
@@ -0,0 +1,2 @@
+SHA256 (openbor-3.0.r4138.tar.xz) = e99b4c0b6f1bd3eee8332f1a078ebb1d05b08ac5e9b504cde24ef532bb1307a3
+SIZE (openbor-3.0.r4138.tar.xz) = 3451504

Added: head/games/openbor/files/patch-sdl__sdlport.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/openbor/files/patch-sdl__sdlport.c	Mon Apr 13 13:43:47 2015	(r383919)
@@ -0,0 +1,30 @@
+--- sdl/sdlport.c.orig	2013-12-29 14:05:10 UTC
++++ sdl/sdlport.c
+@@ -6,6 +6,11 @@
+  * Copyright (c) 2004 - 2014 OpenBOR Team
+  */
+ 
++#include <errno.h>
++#include <unistd.h>
++#include <err.h>
++#include <sys/stat.h>
++
+ #include "sdlport.h"
+ #include "packfile.h"
+ #include "ram.h"
+@@ -92,6 +97,15 @@ int main(int argc, char *argv[])
+ #ifdef ANDROID
+ 	dirExists(rootDir, 1);
+     chdir(rootDir);
++#else
++	{
++		if (chdir(getenv("HOME")) != 0)
++			err(1, "cannot cd to $HOME");
++		if (mkdir(".openbor", 0755) != 0 && errno != EEXIST)
++			err(1, "cannot mkdir $HOME/.openbor");
++		if (chdir(".openbor") != 0)
++			err(1, "cannot cd to $HOME/.openbor");
++	}
+ #endif
+ 	dirExists(paksDir, 1);
+ 	dirExists(savesDir, 1);

Added: head/games/openbor/files/patch-source__ramlib__ram.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/openbor/files/patch-source__ramlib__ram.c	Mon Apr 13 13:43:47 2015	(r383919)
@@ -0,0 +1,200 @@
+--- source/ramlib/ram.c.orig	2013-12-29 14:05:10 UTC
++++ source/ramlib/ram.c
+@@ -27,6 +27,21 @@
+ #include <mach/task.h>
+ #include <mach/mach.h>
+ #include <mach/mach_init.h>
++#elif defined(__DragonFly__) || defined(__FreeBSD__) || \
++  defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#include <unistd.h>
++# if defined(__DragonFly__)
++#include <sys/kinfo.h>      // struct kinfo_proc
++#include <sys/vmmeter.h>    // struct vmstats
++# elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
++#include <sys/user.h>       // struct kinfo_proc
++# elif defined(__NetBSD__)
++#include <uvm/uvm_extern.h> // struct uvmexp_sysctl
++# elif defined(__OpenBSD__)
++#include <uvm/uvmexp.h>     // struct uvmexp
++# endif
+ #elif LINUX
+ #include <sys/sysinfo.h>
+ #include <unistd.h>
+@@ -50,6 +65,8 @@
+ 
+ static u64 systemRam = 0x00000000;
+ 
++#if !defined(__DragonFly__) && !defined(__FreeBSD__) && \
++  !defined(__FreeBSD_kernel__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
+ #ifndef DARWIN
+ #ifndef WIN
+ #ifndef XBOX
+@@ -60,10 +77,13 @@ static unsigned long stackSize = 0x00000
+ #endif
+ #endif
+ #endif
++#endif
+ 
+ /////////////////////////////////////////////////////////////////////////////
+ // Symbols
+ 
++#if !defined(__DragonFly__) && !defined(__FreeBSD__) && \
++  !defined(__FreeBSD_kernel__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
+ #ifndef DARWIN
+ #ifndef WIN
+ #ifndef XBOX
+@@ -81,6 +101,7 @@ extern unsigned long start;
+ #endif
+ #endif
+ #endif
++#endif
+ 
+ /////////////////////////////////////////////////////////////////////////////
+ //  Functions
+@@ -107,6 +128,49 @@ u64 getFreeRam(int byte_size)
+         return 0;
+     }
+     return (u64)(((vms.inactive_count + vms.free_count) * size) / byte_size);
++#elif defined(__DragonFly__)
++    struct vmstats vms;
++    size_t sz = sizeof(vms);
++    if (sysctlbyname("vm.vmstats", &vms, &sz, NULL, 0))
++    {
++        return 0;
++    }
++    return (u64)((vms.v_free_count + vms.v_inactive_count
++                  + vms.v_cache_count) * getpagesize()) / byte_size;
++#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
++    u_int v_free_count, v_inactive_count, v_cache_count;
++    size_t sz = sizeof(u_int);
++    v_free_count = v_inactive_count = v_cache_count = 0;
++    sysctlbyname("vm.stats.vm.v_free_count",
++                 &v_free_count, &sz, NULL, 0);
++    sysctlbyname("vm.stats.vm.v_inactive_count",
++                 &v_inactive_count, &sz, NULL, 0);
++    sysctlbyname("vm.stats.vm.v_cache_count",
++                 &v_cache_count, &sz, NULL, 0);
++    return (u64)((v_free_count + v_inactive_count + v_cache_count)
++                 * getpagesize()) / byte_size;
++#elif defined(__NetBSD__) || defined(__OpenBSD__)
++# if defined(__NetBSD__)
++#undef VM_UVMEXP
++#define VM_UVMEXP VM_UVMEXP2
++#define uvmexp uvmexp_sysctl
++# else
++#define filepages vnodepages
++#define execpages vtextpages
++# endif
++    int mib[] = {
++        CTL_VM,
++        VM_UVMEXP,
++    };
++    u_int miblen = sizeof(mib) / sizeof(mib[0]);
++    struct uvmexp uvmexp;
++    size_t sz = sizeof(uvmexp);
++    if (sysctl(mib, miblen, &uvmexp, &sz, NULL, 0))
++    {
++        return 0;
++    }
++    return (u64)((uvmexp.free + uvmexp.inactive + uvmexp.filepages
++                  + uvmexp.execpages) * uvmexp.pagesize) / byte_size;
+ #elif LINUX
+     struct sysinfo info;
+     sysinfo(&info);
+@@ -147,11 +211,29 @@ void setSystemRam()
+     stat.dwLength = sizeof(MEMORYSTATUS);
+     GlobalMemoryStatus(&stat);
+     systemRam = stat.dwTotalPhys;
+-#elif DARWIN
+-    u64 mem;
+-    size_t len = sizeof(mem);
+-    sysctlbyname("hw.memsize", &mem, &len, NULL, 0);
+-    systemRam = mem;
++#elif defined(DARWIN) || defined(__DragonFly__) || defined(__FreeBSD__) || \
++  defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
++# if defined(HW_MEMSIZE) || defined(HW_PHYSMEM64)
++    uint64_t physmem;
++# else
++    u_long physmem;
++# endif
++    int mib[] = {
++        CTL_HW,
++# if defined(HW_MEMSIZE)
++        HW_MEMSIZE,
++# elif defined(HW_PHYSMEM64)
++        HW_PHYSMEM64,
++# else
++        HW_PHYSMEM,
++# endif
++    };
++    size_t sz = sizeof(physmem);
++    if (sysctl(mib, 2, &physmem, &sz, NULL, 0))
++    {
++        physmem = 0;
++    }
++    systemRam = physmem;
+ #elif LINUX
+     struct sysinfo info;
+     sysinfo(&info);
+@@ -194,6 +276,8 @@ void setSystemRam()
+     stackSize = 0x00000000;
+     systemRam = getFreeRam(BYTES);
+ #endif
++#if !defined(__DragonFly__) && !defined(__FreeBSD__) && \
++  !defined(__FreeBSD_kernel__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
+ #ifndef DARWIN
+ #ifndef WIN
+ #ifndef XBOX
+@@ -205,6 +289,7 @@ void setSystemRam()
+ #endif
+ #endif
+ #endif
++#endif
+     getRamStatus(BYTES);
+ }
+ 
+@@ -234,6 +319,42 @@ u64 getUsedRam(int byte_size)
+         return 0;
+     }
+     return info.resident_size / byte_size;
++#elif defined(__DragonFly__) || defined(__FreeBSD__) || \
++  defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
++# if defined(__NetBSD__)
++#undef KERN_PROC
++#define KERN_PROC KERN_PROC2
++#define KINFO_PROC struct kinfo_proc2
++# else
++#define KINFO_PROC struct kinfo_proc
++# endif
++# if defined(__DragonFly__)
++#define KP_RSS(kp) (kp.kp_vm_rssize * getpagesize())
++# elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
++#define KP_RSS(kp) (kp.ki_rssize * getpagesize())
++# elif defined(__NetBSD__)
++#define KP_RSS(kp) (kp.p_vm_rssize * getpagesize())
++# elif defined(__OpenBSD__)
++#define KP_RSS(kp) (kp.p_vm_rssize * getpagesize())
++# endif
++    int mib[] = {
++        CTL_KERN,
++        KERN_PROC,
++        KERN_PROC_PID,
++        getpid(),
++# if defined(__NetBSD__) || defined(__OpenBSD__)
++        sizeof(KINFO_PROC),
++        1,
++# endif
++    };
++    u_int miblen = sizeof(mib) / sizeof(mib[0]);
++    KINFO_PROC kp;
++    size_t sz = sizeof(KINFO_PROC);
++    if (sysctl(mib, miblen, &kp, &sz, NULL, 0))
++    {
++        return 0;
++    }
++    return (u64)KP_RSS(kp) / byte_size;
+ #elif LINUX
+     unsigned long vm = 0;
+     FILE *file = fopen("/proc/self/statm", "r");

Added: head/games/openbor/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/openbor/pkg-descr	Mon Apr 13 13:43:47 2015	(r383919)
@@ -0,0 +1,4 @@
+OpenBOR is a continuation of the Beats Of Rage 2D game engine, which
+was originally created by Senile Team.
+
+WWW: http://www.chronocrash.com/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504131343.t3DDhmAv002108>