From owner-svn-ports-all@FreeBSD.ORG Mon Apr 13 13:43:50 2015 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A5AAAA5; Mon, 13 Apr 2015 13:43:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44AB3C35; Mon, 13 Apr 2015 13:43:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3DDhoeH002119; Mon, 13 Apr 2015 13:43:50 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3DDhmAv002108; Mon, 13 Apr 2015 13:43:48 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201504131343.t3DDhmAv002108@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Mon, 13 Apr 2015 13:43:48 +0000 (UTC) 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 X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 13:43:50 -0000 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 + +.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 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 ++#include ++#include ++#include ++ + #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 + #include + #include ++#elif defined(__DragonFly__) || defined(__FreeBSD__) || \ ++ defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) ++#include ++#include ++#include ++# if defined(__DragonFly__) ++#include // struct kinfo_proc ++#include // struct vmstats ++# elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ++#include // struct kinfo_proc ++# elif defined(__NetBSD__) ++#include // struct uvmexp_sysctl ++# elif defined(__OpenBSD__) ++#include // struct uvmexp ++# endif + #elif LINUX + #include + #include +@@ -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/