From 1a54f9a1015c47079fa8a49586b1ecbc03d40482 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Fri, 3 Mar 2017 13:07:20 +0100 Subject: dev-ml/labltk: Fix build with ocaml 4.05 Package-Manager: Portage-2.3.4, Repoman-2.3.2 --- dev-ml/labltk/files/ocaml405.patch | 382 +++++++++++++++++++++++++++++++++++++ dev-ml/labltk/labltk-8.06.2.ebuild | 1 + 2 files changed, 383 insertions(+) create mode 100644 dev-ml/labltk/files/ocaml405.patch (limited to 'dev-ml') diff --git a/dev-ml/labltk/files/ocaml405.patch b/dev-ml/labltk/files/ocaml405.patch new file mode 100644 index 000000000000..8503646f71ec --- /dev/null +++ b/dev-ml/labltk/files/ocaml405.patch @@ -0,0 +1,382 @@ +Index: labltk-8.06.2/support/cltkCaml.c +=================================================================== +--- labltk-8.06.2.orig/support/cltkCaml.c ++++ labltk-8.06.2/support/cltkCaml.c +@@ -39,7 +39,7 @@ int CamlCBCmd(ClientData clientdata, Tcl + int id; + if (Tcl_GetInt(interp, argv[1], &id) != TCL_OK) + return TCL_ERROR; +- callback2(*handler_code,Val_int(id), ++ caml_callback2(*handler_code,Val_int(id), + copy_string_list(argc - 2,(char **)&argv[2])); + /* Never fails (OCaml would have raised an exception) */ + /* but result may have been set by callback */ +@@ -65,7 +65,7 @@ CAMLprim value camltk_return (value v) + /* Note: raise_with_string WILL copy the error message */ + CAMLprim void tk_error(const char *errmsg) + { +- raise_with_string(*tkerror_exn, errmsg); ++ caml_raise_with_string(*tkerror_exn, errmsg); + } + + +Index: labltk-8.06.2/support/cltkDMain.c +=================================================================== +--- labltk-8.06.2.orig/support/cltkDMain.c ++++ labltk-8.06.2/support/cltkDMain.c +@@ -56,7 +56,7 @@ void invoke_pending_caml_signals (client + /* Rearm timer */ + Tk_CreateTimerHandler(SIGNAL_INTERVAL, invoke_pending_caml_signals, NULL); + signal_events = 1; +- leave_blocking_section(); ++ caml_leave_blocking_section(); + } + /* The following is taken from byterun/startup.c */ + header_t atom_table[256]; +@@ -222,10 +222,10 @@ int Caml_Init(interp) + strcat(f, RCNAME); + if (0 == access(f,R_OK)) + if (TCL_OK != Tcl_EvalFile(cltclinterp,f)) { +- stat_free(f); ++ caml_stat_free(f); + tk_error(Tcl_GetStringResult(cltclinterp)); + }; +- stat_free(f); ++ caml_stat_free(f); + } + } + +Index: labltk-8.06.2/support/cltkEval.c +=================================================================== +--- labltk-8.06.2.orig/support/cltkEval.c ++++ labltk-8.06.2/support/cltkEval.c +@@ -45,7 +45,7 @@ value copy_string_list(int argc, char ** + for (i = argc-1; i >= 0; i--) { + oldres = res; + str = tcl_string_to_caml(argv[i]); +- res = alloc(2, 0); ++ res = caml_alloc(2, 0); + Field(res, 0) = str; + Field(res, 1) = oldres; + } +@@ -71,7 +71,7 @@ CAMLprim value camltk_tcl_eval(value str + Tcl_ResetResult(cltclinterp); + cmd = caml_string_to_tcl(str); + code = Tcl_Eval(cltclinterp, cmd); +- stat_free(cmd); ++ caml_stat_free(cmd); + + switch (code) { + case TCL_OK: +@@ -143,8 +143,8 @@ int fill_args (char **argv, int where, v + fill_args(tmpargv,0,Field(v,0)); + tmpargv[size] = NULL; + merged = Tcl_Merge(size,(const char *const*)tmpargv); +- for(i = 0; iwin, VisibilityChangeMask, + WaitVisibilityProc, clientData); + +- stat_free((char *)vis); +- callback2(*handler_code,cbid,Val_int(0)); ++ caml_stat_free((char *)vis); ++ caml_callback2(*handler_code,cbid,Val_int(0)); + } + + /* Sets up a callback upon Visibility of a window */ +@@ -65,7 +65,7 @@ CAMLprim value camltk_wait_vis(value win + (struct WinCBData *)caml_stat_alloc(sizeof(struct WinCBData)); + vis->win = Tk_NameToWindow(cltclinterp, String_val(win), cltk_mainWindow); + if (vis -> win == NULL) { +- stat_free((char *)vis); ++ caml_stat_free((char *)vis); + tk_error(Tcl_GetStringResult(cltclinterp)); + }; + vis->cbid = Int_val(cbid); +@@ -79,9 +79,9 @@ static void WaitWindowProc(ClientData cl + if (eventPtr->type == DestroyNotify) { + struct WinCBData *vis = clientData; + value cbid = Val_int(vis->cbid); +- stat_free((char *)clientData); ++ caml_stat_free((char *)clientData); + /* The handler is destroyed by Tk itself */ +- callback2(*handler_code,cbid,Val_int(0)); ++ caml_callback2(*handler_code,cbid,Val_int(0)); + } + } + +@@ -92,7 +92,7 @@ CAMLprim value camltk_wait_des(value win + (struct WinCBData *)caml_stat_alloc(sizeof(struct WinCBData)); + vis->win = Tk_NameToWindow(cltclinterp, String_val(win), cltk_mainWindow); + if (vis -> win == NULL) { +- stat_free((char *)vis); ++ caml_stat_free((char *)vis); + tk_error(Tcl_GetStringResult(cltclinterp)); + }; + vis->cbid = Int_val(cbid); +Index: labltk-8.06.2/browser/searchpos.ml +=================================================================== +--- labltk-8.06.2.orig/browser/searchpos.ml ++++ labltk-8.06.2/browser/searchpos.ml +@@ -782,7 +782,7 @@ and search_pos_expr ~pos exp = + search_pos_expr exp' ~pos + end; + search_pos_expr exp ~pos +- | Texp_function (_, l, _) -> ++ | Texp_function { arg_label = _; param = _ ; cases = l; partial = _; } -> + List.iter l ~f:(search_case ~pos) + | Texp_apply (exp, l) -> + List.iter l ~f:(fun (_, x) -> Misc.may (search_pos_expr ~pos) x); +Index: labltk-8.06.2/jpf/fileselect.ml +=================================================================== +--- labltk-8.06.2.orig/jpf/fileselect.ml ++++ labltk-8.06.2/jpf/fileselect.ml +@@ -55,7 +55,7 @@ let myentry_create p ~variable = + let subshell cmd = + let r,w = pipe () in + match fork () with +- 0 -> close r; dup2 ~src:w ~dst:stdout; ++ 0 -> close r; dup2 ~cloexec:false ~src:w ~dst:stdout; + execv ~prog:"/bin/sh" ~args:[| "/bin/sh"; "-c"; cmd |] + | id -> + close w; diff --git a/dev-ml/labltk/labltk-8.06.2.ebuild b/dev-ml/labltk/labltk-8.06.2.ebuild index 4426081ac9e8..1210261ebf20 100644 --- a/dev-ml/labltk/labltk-8.06.2.ebuild +++ b/dev-ml/labltk/labltk-8.06.2.ebuild @@ -21,6 +21,7 @@ DEPEND="${RDEPEND} src_prepare() { epatch "${FILESDIR}/findlib.patch" + has_version '>=dev-lang/ocaml-4.05.0_beta' && epatch "${FILESDIR}/ocaml405.patch" } src_configure() { -- cgit v1.2.3-65-gdbad