From: Richard W.M. Jones <"Richard W.M. Jones "> Date: Mon, 17 Nov 2008 13:07:50 +0000 (+0000) Subject: Better linking of ocaml-curses library. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=c977e087b8fa1b48e5c318f1db2026e52e37d88c;p=fedora-mingw.git Better linking of ocaml-curses library. --- diff --git a/.hgignore b/.hgignore index a9420f6..9df2e69 100644 --- a/.hgignore +++ b/.hgignore @@ -1,6 +1,10 @@ syntax: glob *~ +*.exe +*.cmi +*.cmx +*.o buildall.log SDL/SDL-1.2.13.tar.gz @@ -14,11 +18,9 @@ bzip2/bzip2-1.0.5.tar.gz cairo/cairo-1.7.4.tar.gz cairo/cairo-1.8.0.tar.gz cairo/svgspacewar -cairo/svgspacewar.exe cairomm/cairomm-1.6.2.tar.gz curl/curl-7.18.2.tar.bz2 curl/test1 -curl/*.exe expat/expat-2.0.1.tar.gz flexdll/flexdll-0.11.tar.gz fontconfig/fontconfig-2.6.0.tar.gz @@ -41,7 +43,6 @@ gtk2/gtk+-2.14.4.tar.bz2 gtk2/test1 gtk2/test2 gtk2/test3 -gtk2/*.exe gtkmm24/gtkmm-2.14.1.tar.bz2 gtk-vnc/gtk-vnc-0.3.7.tar.gz gtk-vnc/gtk-vnc-0.3.8-20081030.tar.gz @@ -66,7 +67,6 @@ libxml2/libxml2-2.7.2.tar.gz libxslt/libxslt-1.1.24.tar.gz nsis/nsis-2.19-src.tar.bz2 nsis/nsis-2.39-src.tar.bz2 -nsiswrapper/installer.exe nspr/nspr-4.7.2.tar.gz nss/nss-3.12.2.0-stripped.tar.bz2 nss/nss-pem-20080124.tar.bz2 @@ -81,24 +81,13 @@ ocaml/test_buffer ocaml/test_overflow ocaml/test_float ocaml/test_float2 -ocaml/*.exe -ocaml/*.cmi -ocaml/*.cmx -ocaml/*.o ocaml-calendar/calendar-2.0.4.tar.gz ocaml-calendar/test -ocaml-calendar/*.exe -ocaml-calendar/*.cmi -ocaml-calendar/*.cmx -ocaml-calendar/*.o ocaml-csv/ocaml-csv-1.1.7.tar.gz ocaml-curses/ocaml-curses-20020319.tar.gz +ocaml-curses/test1 ocaml-extlib/extlib-1.5.1.tar.gz ocaml-extlib/test1 -ocaml-extlib/*.exe -ocaml-extlib/*.cmi -ocaml-extlib/*.cmx -ocaml-extlib/*.o ocaml-findlib/findlib-1.2.2.tar.gz ocaml-lablgl/lablgl-1.03.tar.gz ocaml-libvirt/ocaml-libvirt-0.4.4.2.tar.gz diff --git a/ocaml-curses/Makefile b/ocaml-curses/Makefile new file mode 100644 index 0000000..c1756ea --- /dev/null +++ b/ocaml-curses/Makefile @@ -0,0 +1,19 @@ +# -*- Makefile -*- +# Test programs. + +all: test1 test1.exe + +# XXX The native ocaml-curses package is broken ... +test1: test1.ml +# ocamlfind ocamlopt -package curses $< -o $@ + ocamlopt -I +curses mlcurses.cmxa $< -o $@ -cclib -lncurses + +# XXX ... and the META file for this package also doesn't work either. +test1.exe: test1.ml +# OCAMLFIND_CONF=/etc/i686-pc-mingw32-ocamlfind.conf \ +# ocamlfind ocamlopt -package curses $< -o $@ + i686-pc-mingw32-ocamlopt -verbose -I +curses mlcurses.cmxa $< -o $@ + +clean: + rm -f test1 \ + *.exe *.cmi *.cmx *.o diff --git a/ocaml-curses/mingw32-ocaml-curses.spec b/ocaml-curses/mingw32-ocaml-curses.spec index 33ac401..e027f5e 100644 --- a/ocaml-curses/mingw32-ocaml-curses.spec +++ b/ocaml-curses/mingw32-ocaml-curses.spec @@ -9,7 +9,7 @@ Name: mingw32-ocaml-curses Version: 0.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: MinGW Windows OCaml bindings for ncurses License: LGPLv2+ @@ -53,7 +53,7 @@ make \ OCAMLC=%{_mingw32_target}-ocamlopt \ OCAMLOPT=%{_mingw32_target}-ocamlopt \ OCAMLMKLIB=%{_mingw32_target}-ocamlmklib \ - CURSES=%{_mingw32_libdir}/pdcurses.dll.a opt + CURSES="" opt cat > META < - 0.1-4 +- libmlcurses.a contained a copy of pdcurses.dll.a in error. + * Sun Nov 16 2008 Richard W.M. Jones - 0.1-3 - Use ocamlfind to install in the correct location. - Install the META file. diff --git a/ocaml-curses/test1.ml b/ocaml-curses/test1.ml new file mode 100644 index 0000000..d01e703 --- /dev/null +++ b/ocaml-curses/test1.ml @@ -0,0 +1,83 @@ +open Curses + +let () = ripoffline true +let w = initscr () +let (wd, ncol) = get_ripoff () + +(*let () = assert (start_color ()) +let () = assert (init_pair 1 Color.red Color.white)*) + +let () = assert (cbreak ()) +let () = assert (noecho ()) +let () = assert (intrflush w false) +let () = assert (keypad w true) + +let () = for i = 0 to 10 do + assert (mvaddch i (i * 2) (A.color_pair 1 + 111)) +done + +let () = border 0 0 0 0 0 0 0 0 +let () = wborder w 0 0 0 0 0 0 0 0 + +let () = assert (refresh ()) + +let (c1, c2) = mousemask (-1) + +let () = assert (mvaddstr 3 1 "Bonjour") +let () = assert (mvaddstr 4 2 (string_of_int c1)) +let () = assert (mvaddstr 5 2 (string_of_int c2)) + +let t = Array.init 50 (fun x -> 64 + x) +let () = assert (addchnstr t 10 3) +let () = assert (mvaddnstr 8 40 "Bonjour" 1 3) +let () = assert (mvinsstr 8 40 "toto ") + +let t = [|0; 0; 0; 0 |] + +let () = assert (inchnstr t 0 3) + +let () = winch_handler_on () + +let kup = tigetstr "kcuu1" +let () = assert (addstr kup) + +let acs = get_acs_codes () +let () = assert (addch acs.Acs.ulcorner) + +let i = getch () + +let (nc, np, can) = (colors (), color_pairs (), can_change_color ()) + +let (c1, c2) = pair_content 1 + +let l = ref [] +let () = assert (tputs "totoping" 1 (fun c -> l := (int_of_char c) :: !l)) + +let (tr, tc) = get_size () + +let () = endwin () + +let () = Array.iter (fun x -> print_int x; print_newline ()) t + +let () = print_string "key="; print_int i; print_newline () +let () = print_int tr; print_string " "; print_int tc; print_newline () +let () = print_int nc; print_string " " +let () = print_int np; print_string " " +let () = print_string (if can then "oui" else "non"); print_newline () +let () = print_int c1; print_string " " +let () = print_int c2; print_newline () +let () = print_int ncol; print_newline () +let () = List.iter (fun x -> print_int x; print_string " ") !l; + print_newline () + +(*let i = ref 0 +let () = while + let (a, b, c) = str_terminfo_variable !i in + (a <> "") && (print_string (a ^ "\t" ^ b ^ "\t" ^ c); + print_newline (); true) do + i := !i + 1 +done*) +(*let () = Hashtbl.iter (fun a (b,c) -> + print_string (a ^ "\t" ^ b ^ "\t" ^ c); print_newline ()) + str_terminfo_variables*) +