HI all,

this is angelscript port, which supertuxkart might benefit for example.

Hope it is useful.

Cheers.
diff --git a/devel/libangelscript/Makefile b/devel/libangelscript/Makefile
new file mode 100644
index 0000000..ff03557
--- /dev/null
+++ b/devel/libangelscript/Makefile
@@ -0,0 +1,24 @@
+# $OpenBSD$
+
+COMMENT =               cross-platform scripting library
+
+V =                     2.30.2
+PKGNAME =               angelscript-${V}
+DISTNAME =              angelscript_${V}
+EXTRACT_SUFX=           .zip
+
+CATEGORIES =            devel
+HOMEPAGE =              http://www.angelcode.com/angelscript
+
+# ZLIB
+PERMIT_PACKAGE_CDROM =  Yes
+
+MASTER_SITES =          ${HOMEPAGE}/sdk/files/
+
+USE_GMAKE =             Yes
+WANTLIB +=              c stdc++
+
+WRKDIST =               ${WRKDIR}/sdk
+WRKSRC =                ${WRKDIR}/sdk/angelscript/projects/gnuc
+
+.include <bsd.port.mk>
diff --git a/devel/libangelscript/distinfo b/devel/libangelscript/distinfo
new file mode 100644
index 0000000..8587580
--- /dev/null
+++ b/devel/libangelscript/distinfo
@@ -0,0 +1,2 @@
+SHA256 (angelscript_2.30.2.zip) = jAh3S8HKaDEktJlqtEWfSysQvazYYOdvKPtbUEMy19c=
+SIZE (angelscript_2.30.2.zip) = 1640151
diff --git 
a/devel/libangelscript/patches/patch-angelscript_source_as_memory_cpp 
b/devel/libangelscript/patches/patch-angelscript_source_as_memory_cpp
new file mode 100644
index 0000000..6ad228d
--- /dev/null
+++ b/devel/libangelscript/patches/patch-angelscript_source_as_memory_cpp
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- angelscript/source/as_memory.cpp.orig      Thu Dec 17 22:21:10 2015
++++ angelscript/source/as_memory.cpp   Thu Dec 17 22:21:48 2015
+@@ -38,7 +38,7 @@
+ 
+ #include <stdlib.h>
+ 
+-#if !defined(__APPLE__) && !defined( __SNC__ ) && !defined( __ghs__ ) && 
!defined(__FreeBSD__)
++#if !defined(__APPLE__) && !defined( __SNC__ ) && !defined( __ghs__ ) && 
!defined(__FreeBSD__) && !defined(__OpenBSD__)
+ #include <malloc.h>
+ #endif
+ 
diff --git a/devel/libangelscript/patches/patch-source-as_callfunc_x64_gcc 
b/devel/libangelscript/patches/patch-source-as_callfunc_x64_gcc
new file mode 100644
index 0000000..cd74a22
--- /dev/null
+++ b/devel/libangelscript/patches/patch-source-as_callfunc_x64_gcc
@@ -0,0 +1,43 @@
+$OpenBSD$
+--- angelscript/source/as_callfunc_x64_gcc.cpp.orig    Sat Jul 11 18:30:10 2015
++++ angelscript/source/as_callfunc_x64_gcc.cpp Thu Dec 17 22:20:31 2015
+@@ -72,6 +72,9 @@ static asQWORD __attribute__((noinline)) X64_CallFunct
+       // Reference: http://www.x86-64.org/documentation/abi.pdf
+ 
+       __asm__ __volatile__ (
++#ifdef __OPTIMIZE__
++              "  .cfi_startproc \n"
++#endif
+ 
+               "  movq %0, %%rcx \n"   // rcx = cnt
+               "  movq %1, %%r10 \n"   // r10 = args
+@@ -105,6 +108,9 @@ static asQWORD __attribute__((noinline)) X64_CallFunct
+               "  subl $1, %%esi \n"
+               "  xorl %%edx, %%edx \n"
+               "  leaq 8(, %%rsi, 8), %%rcx \n"
++#ifdef __OPTIMIZE__
++              "  .cfi_endproc \n"
++#endif
+               "loopstack: \n"
+               "  movq 112(%%r10, %%rdx), %%rax \n"
+               "  pushq %%rax \n"
+@@ -112,6 +118,9 @@ static asQWORD __attribute__((noinline)) X64_CallFunct
+               "  cmpq %%rcx, %%rdx \n"
+               "  jne loopstack \n"
+               "endstack: \n"
++#ifdef __OPTIMIZE__
++              "  .cfi_startproc \n"
++#endif
+ 
+       // Populate integer and floating point parameters
+               "  movq %%r10, %%rax \n"
+@@ -152,6 +161,9 @@ static asQWORD __attribute__((noinline)) X64_CallFunct
+               "  lea %4, %%rdx \n"
+               "  movq %%xmm1, (%%rdx) \n"
+               "  jmp endcall \n"
++#ifdef __OPTIMIZE__
++              "  .cfi_endproc \n"
++#endif
+               "intret: \n"
+               "  movq %%rax, %3 \n"
+               "  movq %%rdx, %4 \n"
diff --git a/devel/libangelscript/pkg/DESCR b/devel/libangelscript/pkg/DESCR
new file mode 100644
index 0000000..05f6e8a
--- /dev/null
+++ b/devel/libangelscript/pkg/DESCR
@@ -0,0 +1,3 @@
+The AngelCode Scripting Library, or AngelScript as it is also known, is an 
extremely flexible cross-platform scripting library designed to allow 
applications to extend their functionality through external scripts. It has 
been designed from the beginning to be an easy to use component, both for the 
application programmer and the script writer.
+
+Efforts have been made to let it call standard C functions and C++ methods 
with little to no need for proxy functions. The application simply registers 
the functions, objects, and methods that the scripts should be able to work 
with and nothing more has to be done with your code. The same functions used by 
the application internally can also be used by the scripting engine, which 
eliminates the need to duplicate functionality. 
diff --git a/devel/libangelscript/pkg/PLIST b/devel/libangelscript/pkg/PLIST
new file mode 100644
index 0000000..a5df762
--- /dev/null
+++ b/devel/libangelscript/pkg/PLIST
@@ -0,0 +1,3 @@
+@comment $OpenBSD$
+include/angelscript.h
+lib/libangelscript.a

Reply via email to