diff options
author | Stanislav Sedov <stas@FreeBSD.org> | 2009-04-11 13:23:05 +0000 |
---|---|---|
committer | Stanislav Sedov <stas@FreeBSD.org> | 2009-04-11 13:23:05 +0000 |
commit | c6762e80516b169cd71a8d7e68d0ed5b308f7e55 (patch) | |
tree | f23cbb8b9252353d844bff7e183b8b588e997854 /lang/mtasc | |
parent | 3b03d918066c823f39536b8d108d1145c833a3dd (diff) |
Notes
Diffstat (limited to 'lang/mtasc')
-rw-r--r-- | lang/mtasc/Makefile | 1 | ||||
-rw-r--r-- | lang/mtasc/files/patch-basepath | 10 | ||||
-rw-r--r-- | lang/mtasc/files/patch-extc_extc_stubs.c | 42 | ||||
-rw-r--r-- | lang/mtasc/files/patch-mtasc_parser.ml | 40 |
4 files changed, 89 insertions, 4 deletions
diff --git a/lang/mtasc/Makefile b/lang/mtasc/Makefile index 620c4aaa4e4d..60cb02ac437b 100644 --- a/lang/mtasc/Makefile +++ b/lang/mtasc/Makefile @@ -7,6 +7,7 @@ PORTNAME= mtasc PORTVERSION= 1.14 +PORTREVISION= 1 CATEGORIES= lang www MASTER_SITES= http://saper.info/distfiles/ LOCAL/chinsan diff --git a/lang/mtasc/files/patch-basepath b/lang/mtasc/files/patch-basepath index a28f5e7d7977..012583a41249 100644 --- a/lang/mtasc/files/patch-basepath +++ b/lang/mtasc/files/patch-basepath @@ -1,10 +1,12 @@ ---- mtasc/main.ml.orig 2008-09-06 03:09:02.176005686 +0200 -+++ mtasc/main.ml 2008-09-06 03:11:37.642045225 +0200 -@@ -113,7 +113,7 @@ +--- mtasc/main.ml.orig 2008-08-31 15:14:17.000000000 +0400 ++++ mtasc/main.ml 2009-04-11 12:38:50.000000000 +0400 +@@ -112,8 +112,8 @@ + if do_exit then exit 1 ;; try - let usage = "Motion-Twin ActionScript2 Compiler 1.14 - (c)2004-2008 Motion-Twin\n Usage : mtasc.exe [options] <files...>\n Options :" in +- let usage = "Motion-Twin ActionScript2 Compiler 1.14 - (c)2004-2008 Motion-Twin\n Usage : mtasc.exe [options] <files...>\n Options :" in - let base_path = normalize_path (try Extc.executable_path() with _ -> ".") in ++ let usage = "Motion-Twin ActionScript2 Compiler 1.14 - (c)2004-2008 Motion-Twin\n Usage : mtasc [options] <files...>\n Options :" in + let base_path = normalize_path (try Extc.executable_path() ^ "/.." with _ -> "..") in let files = ref [] in let time = Sys.time() in diff --git a/lang/mtasc/files/patch-extc_extc_stubs.c b/lang/mtasc/files/patch-extc_extc_stubs.c new file mode 100644 index 000000000000..f9411fe39ada --- /dev/null +++ b/lang/mtasc/files/patch-extc_extc_stubs.c @@ -0,0 +1,42 @@ +--- extc/extc_stubs.c.orig 2007-03-05 14:09:37.000000000 +0300 ++++ extc/extc_stubs.c 2009-04-11 12:57:23.000000000 +0400 +@@ -32,6 +32,11 @@ + # include <sys/syslimits.h> + # include <mach-o/dyld.h> + #endif ++#ifdef __FreeBSD__ ++# include <sys/param.h> ++# include <sys/sysctl.h> ++# include <sys/user.h> ++#endif + + #define zval(z) ((z_streamp)(z)) + +@@ -125,7 +130,26 @@ + } + + CAMLprim value executable_path(value u) { +-#ifdef _WIN32 ++#if defined(__FreeBSD__) ++ char pathname[PATH_MAX]; ++ int error, name[4]; ++ size_t len; ++ pid_t pid; ++ ++ pid = getpid(); ++ name[0] = CTL_KERN; ++ name[1] = KERN_PROC; ++ name[2] = KERN_PROC_PATHNAME; ++ name[3] = pid; ++ ++ len = sizeof(pathname); ++ error = sysctl(name, 4, pathname, &len, NULL, 0); ++ if (error < 0 && errno != ESRCH) ++ warn("sysctl: kern.proc.pathname: %d", pid); ++ if (error < 0) ++ return caml_copy_string("-"); ++ return caml_copy_string(pathname); ++#elif defined(_WIN32) + char path[MAX_PATH]; + if( GetModuleFileName(NULL,path,MAX_PATH) == 0 ) + failwith("executable_path"); diff --git a/lang/mtasc/files/patch-mtasc_parser.ml b/lang/mtasc/files/patch-mtasc_parser.ml new file mode 100644 index 000000000000..2c504486ec20 --- /dev/null +++ b/lang/mtasc/files/patch-mtasc_parser.ml @@ -0,0 +1,40 @@ +--- mtasc/parser.ml.orig 2009-04-11 12:35:07.000000000 +0400 ++++ mtasc/parser.ml 2009-04-11 12:37:16.000000000 +0400 +@@ -166,8 +166,8 @@ + | [< '(Kwd For,p); '(POpen,_); c = parse_expr_opt; e = parse_for p c >] -> e + | [< '(Kwd If,p); cond = parse_eval; e = parse_expr_opt; e2 , p2 = parse_else (pos e) >] -> EIf (cond,wrap_var e,e2), punion p p2 + | [< '(Kwd Return,p); v , p2 = parse_eval_option p; >] -> EReturn v , punion p p2 +- | [< '(Kwd Break,p); >] -> EBreak , p +- | [< '(Kwd Continue,p); >] -> EContinue , p ++ | [< '(Kwd Break,p) >] -> EBreak , p ++ | [< '(Kwd Continue,p) >] -> EContinue , p + | [< '(Kwd While,p1); v = parse_eval; e = parse_expr_opt >] -> EWhile (v,wrap_var e,NormalWhile) , punion p1 (pos e) + | [< '(Kwd Do,p1); e = parse_expr; '(Kwd While,_); v = parse_eval; >] -> EWhile (v,wrap_var e,DoWhile) , punion p1 (pos v) + | [< '(Kwd Switch,p1); v = parse_eval; '(BrOpen,_); el, p2 = parse_switch false >] -> ESwitch (v,el) , punion p1 p2 +@@ -278,7 +278,7 @@ + + and parse_expr_opt = parser + | [< e = parse_expr >] -> e +- | [< '(Next,p); >] -> EBlock [] , p ++ | [< '(Next,p) >] -> EBlock [] , p + + and parse_for p c = parser + | [< '(Kwd In,_); v = parse_eval; '(PClose,p2); e = parse_expr_opt >] -> EForIn(c,v,wrap_var e) , punion p p2 +@@ -324,7 +324,7 @@ + and parse_block callb sp = parser + | [< e = callb; el,p = parse_block callb sp >] -> e :: el , p + | [< '(Next,_); el = parse_block callb sp >] -> el +- | [< '(BrClose,p); >] -> [] , p ++ | [< '(BrClose,p) >] -> [] , p + | [< '(Eof,_) >] -> error Unclosed_parenthesis sp + + and parse_expr_list p = parser +@@ -351,7 +351,7 @@ + + and parse_import = parser + | [< '(Const (Ident name),_); p = parse_import2 name >] -> p +- | [< '(Binop OpMult,_); >] -> [] , None ++ | [< '(Binop OpMult,_) >] -> [] , None + + and parse_import2 name = parser + | [< '(Dot,_); p , n = parse_import >] -> name :: p , n |