FreeBSD Bugzilla – Attachment 151592 Details for
Bug 196657
[NEW PORT] games/openbor: Moddable fighting game engine (aka Beats of Rage)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
shar, v1
openbor.shar (text/plain), 9.74 KB, created by
Jan Beich
on 2015-01-13 22:23:25 UTC
(
hide
)
Description:
shar, v1
Filename:
MIME Type:
Creator:
Jan Beich
Created:
2015-01-13 22:23:25 UTC
Size:
9.74 KB
patch
obsolete
>#!/bin/sh ># This is a shell archive >echo x games/openbor >mkdir -p games/openbor > /dev/null 2>&1 >echo x games/openbor/Makefile >sed 's/^X//' > games/openbor/Makefile << 'SHAR_END' >X# $FreeBSD$ >X >XPORTNAME= openbor >XPORTVERSION= 3.0.r${SVN_REV} >XCATEGORIES= games >XMASTER_SITES= LOCAL/nobody_yet >X >XMAINTAINER= jbeich@vfemail.net >XCOMMENT= Moddable fighting game engine (aka Beats of Rage) >X >XLICENSE= BSD3CLAUSE >X >XLIB_DEPENDS= libvorbisfile.so:${PORTSDIR}/audio/libvorbis \ >X libpng.so:${PORTSDIR}/graphics/png >X >XUSES= dos2unix gmake tar:xz >XUSE_SDL= gfx >XDOS2UNIX_FILES= Makefile >XWRKSRC_SUBDIR= engine >XMAKE_ENV= BUILD_LINUX=1 NO_STRIP=1 \ >X TARGET_ARCH=${ARCH:S/i386/x86/} SDKPATH="${LOCALBASE}" >XMAKE_ARGS= CC="${CC}" LIBRARIES="${LOCALBASE}/lib" >XLDFLAGS+= -Wl,--as-needed >XPLIST_FILES= bin/${PORTNAME} \ >X bin/${PORTNAME}.real \ >X share/icons/hicolor/128x128/apps/${PORTNAME}.png >X >XDESKTOP_ENTRIES="OpenBOR" \ >X "" \ >X "${PORTNAME}" \ >X "${PORTNAME}" \ >X "Game;ArcadeGame;" \ >X "" >X >X.include <bsd.port.options.mk> >X >X.if ${ARCH} == i386 >XBUILD_DEPENDS+= yasm:${PORTSDIR}/devel/yasm >X.endif >X >X.if !defined(SVN_REV) >X.if defined(BOOTSTRAP) >XLANG= "C" >XSVN_REV!= svn info svn://svn.code.sf.net/p/openbor/engine/ | \ >X ${SED} -n 's/^Last Changed Rev: //p' >X.else >X.include "Makefile.svn_rev" >X.endif >X.endif >X >X.if defined(BOOTSTRAP) || defined(SVN_FETCH) >XFETCH_DEPENDS+= svn:${PORTSDIR}/devel/subversion >X >Xdo-fetch: >X ${MKDIR} ${WRKDIR} >X svn export -r ${SVN_REV} \ >X svn://svn.code.sf.net/p/openbor/engine/ ${WRKSRC} >X (cd ${WRKDIR}; tar cJvf ${DISTDIR}/${DISTNAME}.tar.xz ${DISTNAME}) >X echo "SVN_REV= ${SVN_REV}" > ${MASTERDIR}/Makefile.svn_rev >X.if ${USER} == nobody_yet >X scp ${DISTDIR}/${DISTNAME}.tar.xz \ >X nobody_yet@freefall.freebsd.org:public_distfiles/ >X.endif >X.endif >X >Xpost-patch: >X ${REINPLACE_CMD} -e 's/-O[0-9]//; s/-g//; s/-Werror//' \ >X -e 's/-fomit-frame-pointer//' \ >X -e 's/-freorder-blocks//' \ >X -e 's/-fno-ident//' \ >X -e 's/-Wno-unused-result//' \ >X -e 's/-Wl,-rpath,$$(LIBRARIES)//' \ >X -e '/echo/!s/ @/ /' \ >X -e 's/$$(LIBS)/$$(LDFLAGS) &/' \ >X ${WRKSRC}/Makefile >X ${GREP} -Flr 'malloc.h' ${WRKSRC} | ${XARGS} ${REINPLACE_CMD} \ >X 's,malloc\.h,stdlib.h,' >X ${REINPLACE_CMD} -e 's/^function \(.*\) {/\1() {/' \ >X -e 's/^get_revnum/VERSION_BUILD=${SVN_REV}/' \ >X ${WRKSRC}/version.sh >X >Xdo-configure: >X (cd ${WRKSRC} && ${SH} ./version.sh) >X >Xpre-install: >X ${PRINTF} '#! /bin/sh\nmkdir -p ~/.OpenBOR\n\ >X cd ~/.OpenBOR && openbor.real "$$@"\n' \ >X >${WRKDIR}/${PORTNAME} >Xdo-install: >X ${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin >X ${INSTALL_PROGRAM} ${WRKSRC}/OpenBOR.elf \ >X ${STAGEDIR}${PREFIX}/bin/${PORTNAME}.real >X ${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/128x128/apps >X ${INSTALL_DATA} ${WRKSRC}/resources/OpenBOR_Icon_128x128.png \ >X ${STAGEDIR}${PREFIX}/share/icons/hicolor/128x128/apps/${PORTNAME}.png >X >X.include <bsd.port.mk> >SHAR_END >echo x games/openbor/distinfo >sed 's/^X//' > games/openbor/distinfo << 'SHAR_END' >XSHA256 (openbor-3.0.r4099.tar.xz) = 207ed2d85f53a06178357c29a94442c19f6705491e46a76c6c89716ff4266808 >XSIZE (openbor-3.0.r4099.tar.xz) = 3571144 >SHAR_END >echo x games/openbor/Makefile.svn_rev >sed 's/^X//' > games/openbor/Makefile.svn_rev << 'SHAR_END' >XSVN_REV= 4099 >SHAR_END >echo x games/openbor/files >mkdir -p games/openbor/files > /dev/null 2>&1 >echo x games/openbor/pkg-descr >sed 's/^X//' > games/openbor/pkg-descr << 'SHAR_END' >XOpenBOR is a continuation of the Beats Of Rage 2D game engine, which >Xwas originally created by Senile Team. >X >XWWW: http://www.chronocrash.com >SHAR_END >echo x games/openbor/files/patch-source__ramlib__ram.c >sed 's/^X//' > games/openbor/files/patch-source__ramlib__ram.c << 'SHAR_END' >X--- source/ramlib/ram.c~ >X+++ source/ramlib/ram.c >X@@ -27,6 +27,21 @@ >X #include <mach/task.h> >X #include <mach/mach.h> >X #include <mach/mach_init.h> >X+#elif defined(__DragonFly__) || defined(__FreeBSD__) || \ >X+ defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) >X+#include <sys/types.h> >X+#include <sys/sysctl.h> >X+#include <unistd.h> >X+# if defined(__DragonFly__) >X+#include <sys/kinfo.h> // struct kinfo_proc >X+#include <sys/vmmeter.h> // struct vmstats >X+# elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) >X+#include <sys/user.h> // struct kinfo_proc >X+# elif defined(__NetBSD__) >X+#include <uvm/uvm_extern.h> // struct uvmexp >X+# elif defined(__OpenBSD__) >X+#include <uvm/uvmexp.h> // struct uvmexp >X+# endif >X #elif LINUX >X #include <sys/sysinfo.h> >X #include <unistd.h> >X@@ -50,6 +65,8 @@ >X >X static u64 systemRam = 0x00000000; >X >X+#if !defined(__DragonFly__) && !defined(__FreeBSD__) && \ >X+ !defined(__FreeBSD_kernel__) && !defined(__NetBSD__) && !defined(__OpenBSD__) >X #ifndef DARWIN >X #ifndef WIN >X #ifndef XBOX >X@@ -60,10 +77,13 @@ static unsigned long stackSize = 0x00000 >X #endif >X #endif >X #endif >X+#endif >X >X ///////////////////////////////////////////////////////////////////////////// >X // Symbols >X >X+#if !defined(__DragonFly__) && !defined(__FreeBSD__) && \ >X+ !defined(__FreeBSD_kernel__) && !defined(__NetBSD__) && !defined(__OpenBSD__) >X #ifndef DARWIN >X #ifndef WIN >X #ifndef XBOX >X@@ -81,6 +101,7 @@ extern unsigned long start; >X #endif >X #endif >X #endif >X+#endif >X >X ///////////////////////////////////////////////////////////////////////////// >X // Functions >X@@ -107,6 +128,49 @@ u64 getFreeRam(int byte_size) >X return 0; >X } >X return (u64)(((vms.inactive_count + vms.free_count) * size) / byte_size); >X+#elif defined(__DragonFly__) >X+ struct vmstats vms; >X+ size_t sz = sizeof(vms); >X+ if (sysctlbyname("vm.vmstats", &vms, &sz, NULL, 0)) >X+ { >X+ return 0; >X+ } >X+ return (u64)((vms.v_free_count + vms.v_inactive_count >X+ + vms.v_cache_count) * getpagesize()) / byte_size; >X+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) >X+ u_int v_free_count, v_inactive_count, v_cache_count; >X+ size_t sz = sizeof(u_int); >X+ v_free_count = v_inactive_count = v_cache_count = 0; >X+ sysctlbyname("vm.stats.vm.v_free_count", >X+ &v_free_count, &sz, NULL, 0); >X+ sysctlbyname("vm.stats.vm.v_inactive_count", >X+ &v_inactive_count, &sz, NULL, 0); >X+ sysctlbyname("vm.stats.vm.v_cache_count", >X+ &v_cache_count, &sz, NULL, 0); >X+ return (u64)((v_free_count + v_inactive_count + v_cache_count) >X+ * getpagesize()) / byte_size; >X+#elif defined(__NetBSD__) || defined(__OpenBSD__) >X+# if defined(__NetBSD__) >X+#undef VM_UVMEXP >X+#define VM_UVMEXP VM_UVMEXP2 >X+#define uvmexp uvmexp_sysctl >X+# else >X+#define filepages vnodepages >X+#define execpages vtextpages >X+# endif >X+ int mib[] = { >X+ CTL_VM, >X+ VM_UVMEXP, >X+ }; >X+ u_int miblen = sizeof(mib) / sizeof(mib[0]); >X+ struct uvmexp uvmexp; >X+ size_t sz = sizeof(uvmexp); >X+ if (sysctl(mib, miblen, &uvmexp, &sz, NULL, 0)) >X+ { >X+ return 0; >X+ } >X+ return (u64)((uvmexp.free + uvmexp.inactive + uvmexp.filepages >X+ + uvmexp.execpages) * uvmexp.pagesize) / byte_size; >X #elif LINUX >X struct sysinfo info; >X sysinfo(&info); >X@@ -147,11 +211,29 @@ void setSystemRam() >X stat.dwLength = sizeof(MEMORYSTATUS); >X GlobalMemoryStatus(&stat); >X systemRam = stat.dwTotalPhys; >X-#elif DARWIN >X- u64 mem; >X- size_t len = sizeof(mem); >X- sysctlbyname("hw.memsize", &mem, &len, NULL, 0); >X- systemRam = mem; >X+#elif defined(DARWIN) || defined(__DragonFly__) || defined(__FreeBSD__) || \ >X+ defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) >X+# if defined(HW_MEMSIZE) || defined(HW_PHYSMEM64) >X+ uint64_t physmem; >X+# else >X+ u_long physmem; >X+# endif >X+ int mib[] = { >X+ CTL_HW, >X+# if defined(HW_MEMSIZE) >X+ HW_MEMSIZE, >X+# elif defined(HW_PHYSMEM64) >X+ HW_PHYSMEM64, >X+# else >X+ HW_PHYSMEM, >X+# endif >X+ }; >X+ size_t sz = sizeof(physmem); >X+ if (sysctl(mib, 2, &physmem, &sz, NULL, 0)) >X+ { >X+ physmem = 0; >X+ } >X+ systemRam = physmem; >X #elif LINUX >X struct sysinfo info; >X sysinfo(&info); >X@@ -194,6 +276,8 @@ void setSystemRam() >X stackSize = 0x00000000; >X systemRam = getFreeRam(BYTES); >X #endif >X+#if !defined(__DragonFly__) && !defined(__FreeBSD__) && \ >X+ !defined(__FreeBSD_kernel__) && !defined(__NetBSD__) && !defined(__OpenBSD__) >X #ifndef DARWIN >X #ifndef WIN >X #ifndef XBOX >X@@ -205,6 +289,7 @@ void setSystemRam() >X #endif >X #endif >X #endif >X+#endif >X getRamStatus(BYTES); >X } >X >X@@ -234,6 +319,42 @@ u64 getUsedRam(int byte_size) >X return 0; >X } >X return info.resident_size / byte_size; >X+#elif defined(__DragonFly__) || defined(__FreeBSD__) || \ >X+ defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) >X+# if defined(__NetBSD__) >X+#undef KERN_PROC >X+#define KERN_PROC KERN_PROC2 >X+#define KINFO_PROC struct kinfo_proc2 >X+# else >X+#define KINFO_PROC struct kinfo_proc >X+# endif >X+# if defined(__DragonFly__) >X+#define KP_RSS(kp) (kp.kp_vm_rssize * getpagesize()) >X+# elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) >X+#define KP_RSS(kp) (kp.ki_rssize * getpagesize()) >X+# elif defined(__NetBSD__) >X+#define KP_RSS(kp) (kp.p_vm_rssize * getpagesize()) >X+# elif defined(__OpenBSD__) >X+#define KP_RSS(kp) (kp.p_vm_rssize * getpagesize()) >X+# endif >X+ int mib[] = { >X+ CTL_KERN, >X+ KERN_PROC, >X+ KERN_PROC_PID, >X+ getpid(), >X+# if defined(__NetBSD__) || defined(__OpenBSD__) >X+ sizeof(KINFO_PROC), >X+ 1, >X+# endif >X+ }; >X+ u_int miblen = sizeof(mib) / sizeof(mib[0]); >X+ KINFO_PROC kp; >X+ size_t sz = sizeof(KINFO_PROC); >X+ if (sysctl(mib, miblen, &kp, &sz, NULL, 0)) >X+ { >X+ return 0; >X+ } >X+ return (u64)KP_RSS(kp); >X #elif LINUX >X unsigned long vm = 0; >X FILE *file = fopen("/proc/self/statm", "r"); >SHAR_END >exit
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 196657
:
151484
|
151485
|
151486
|
151487
|
151585
|
151586
|
151591
| 151592