[93740] trunk/dports/devel/ocaml-extunix

mww at macports.org mww at macports.org
Tue May 29 03:33:50 PDT 2012


Revision: 93740
          https://trac.macports.org/changeset/93740
Author:   mww at macports.org
Date:     2012-05-29 03:33:47 -0700 (Tue, 29 May 2012)
Log Message:
-----------
ocaml-extunix: version 0.0.4 (incl. fix from upstream)

Modified Paths:
--------------
    trunk/dports/devel/ocaml-extunix/Portfile

Added Paths:
-----------
    trunk/dports/devel/ocaml-extunix/files/patch-discover-sendmsg.diff

Removed Paths:
-------------
    trunk/dports/devel/ocaml-extunix/files/patch-src-discover.ml.diff

Modified: trunk/dports/devel/ocaml-extunix/Portfile
===================================================================
--- trunk/dports/devel/ocaml-extunix/Portfile	2012-05-29 09:01:46 UTC (rev 93739)
+++ trunk/dports/devel/ocaml-extunix/Portfile	2012-05-29 10:33:47 UTC (rev 93740)
@@ -4,8 +4,7 @@
 PortGroup ocaml 1.0
 
 name                ocaml-extunix
-version             0.0.3
-revision            1
+version             0.0.4
 categories          devel ml
 maintainers         mww openmaintainer
 license             LGPL-2.1
@@ -13,15 +12,15 @@
 long_description    A User-supported Extended Unix Library for OCaml
 homepage            http://extunix.forge.ocamlcore.org/
 platforms           darwin
-master_sites        https://forge.ocamlcore.org/frs/download.php/646/
+master_sites        http://forge.ocamlcore.org/frs/download.php/878/
 
-checksums           md5     82c72d2201301788347763509682d023 \
-                    rmd160  cf16ec5bbec91ca12b6598f9a22db87d0a8923eb \
-                    sha256  c44b921227e074f0d13292e78c081252590dbf6fd9f751945d29823d990e2eeb
+checksums           md5     e39517d74e74be000896c2ffe3172267 \
+                    rmd160  86b4070c4cd7cb8e95da0b97244adc85c85e68e0 \
+                    sha256  7ee29febc413718c8728c57179aba454fb1e9be5d4586ddc4af3c73e0ec52db7
 
 depends_lib-append  port:ocaml-ounit
 
-patchfiles          patch-src-discover.ml.diff
+patchfiles          patch-discover-sendmsg.diff
 
 use_oasis yes
 use_oasis_doc yes

Added: trunk/dports/devel/ocaml-extunix/files/patch-discover-sendmsg.diff
===================================================================
--- trunk/dports/devel/ocaml-extunix/files/patch-discover-sendmsg.diff	                        (rev 0)
+++ trunk/dports/devel/ocaml-extunix/files/patch-discover-sendmsg.diff	2012-05-29 10:33:47 UTC (rev 93740)
@@ -0,0 +1,152 @@
+diff -u -r CHANGES.txt extunix/CHANGES.txt
+--- CHANGES.txt	2012-05-19 22:22:56.000000000 +0200
++++ extunix/CHANGES.txt	2012-05-29 11:42:25.000000000 +0200
+@@ -1,3 +1,9 @@
++? - ?
++* src/discover.ml :
++  * New option -q to suppress stderr
++  * --disable-* options to exclude selected features from build
++* More precise test for `sendmsg` (bug #1162)
++
+ 0.0.4 - 19 May 2012
+ * ExtUnix now depends on Bigarray and provides variants of 
+   some bindings operating on bigarray buffers (BA submodule)
+diff -u -r src/discover.ml extunix/src/discover.ml
+--- src/discover.ml	2012-05-19 22:22:56.000000000 +0200
++++ extunix/src/discover.ml	2012-05-29 11:42:25.000000000 +0200
+@@ -9,6 +9,7 @@
+   | S of string (* check symbol available *)
+   | V of string (* check value available (enum) *)
+   | D of string (* check symbol defined *)
++  | F of string * string (* check structure type available and specified field present in it *)
+ 
+ type test =
+   | L of arg list
+@@ -18,15 +19,8 @@
+ 
+ let ocamlc = ref "ocamlc"
+ let ext_obj = ref ".o"
+-let verbose = ref false
+-
+-let () =
+-  let args = [
+-    "-ocamlc", Arg.Set_string ocamlc, "<path> ocamlc";
+-    "-ext_obj", Arg.Set_string ext_obj, "<ext> C object files extension";
+-    "-v", Arg.Set verbose, " Show code for failed tests";
+-  ] in
+-  Arg.parse args (failwith) ("Options are:")
++let verbose = ref 1
++let disabled = ref []
+ 
+ let print_define b s = bprintf b "#define %s\n" s
+ let print_include b s = bprintf b "#include <%s>\n" s
+@@ -73,16 +67,19 @@
+     | D s -> pr "#ifndef %s" s; pr "#error %s not defined" s; pr "#endif"
+     | S s -> pr "size_t var_%d = (size_t)&%s;" (fresh ()) s
+     | V s -> pr "int var_%d = (0 == %s);" (fresh ()) s
++    | F (s,f) -> pr "size_t var_%d = (size_t)&((struct %s*)0)->%s" (fresh ()) s f
+     end args;
+   pr "int main() { return 0; }";
+   Buffer.contents b
+ 
++let dev_null = match Sys.os_type with "Win32" -> "NUL" | _ -> "/dev/null"
++
+ let execute code =
+   let (tmp,ch) = Filename.open_temp_file "discover" ".c" in
+   output_string ch code;
+   flush ch;
+   close_out ch;
+-  let cmd = sprintf "%s -c %s" !ocamlc (Filename.quote tmp) in
++  let cmd = sprintf "%s -c %s%s" !ocamlc (Filename.quote tmp) (if !verbose >= 1 then "" else " 2> " ^ dev_null) in
+   let ret = Sys.command cmd in
+   Sys.remove tmp;
+   (* assumption: C compiler puts object file in current directory *)
+@@ -96,11 +93,14 @@
+     let code = build_code args in
+     match execute code, other with
+     | false, [] -> 
+-        if !verbose then prerr_endline code;
++        if !verbose >= 2 then prerr_endline code;
+         print_endline "failed"; NO name
+     | false, (x::xs) -> loop x xs
+     | true, _ -> print_endline "ok"; YES (name,args)
+   in
++  match List.mem name !disabled with
++  | true -> print_endline "disabled"; NO name
++  | false ->
+   match test with
+   | L l -> loop l []
+   | ANY (x::xs) -> loop x xs
+@@ -160,8 +160,7 @@
+   show_c "src/config.h" result;
+   show_ml "src/config.ml" result
+ 
+-let () = 
+-  main 
++let features =
+   [
+     "EVENTFD", L[
+       I "sys/eventfd.h";
+@@ -260,7 +259,10 @@
+ 		 D"htobe64"; D"htole64"; D"be64toh"; D"le64toh"; ];
+     "READ_CREDENTIALS", L[ I"sys/types.h"; I"sys/socket.h"; D"SO_PEERCRED"; ];
+     "FEXECVE", L[ I "unistd.h"; S"fexecve"; ];
+-    "SENDMSG", L[ I"sys/types.h"; I"sys/socket.h"; S"sendmsg"; S"recvmsg" ];
++    "SENDMSG", ANY[
++      [ I"sys/types.h"; I"sys/socket.h"; S"sendmsg"; S"recvmsg"; D"CMSG_SPACE"; ];
++      [ I"sys/types.h"; I"sys/socket.h"; S"sendmsg"; S"recvmsg"; F("msghdr","msg_accrights"); ];
++    ];
+     "PREAD", L[ I "unistd.h"; S"pread"; ];
+     "PWRITE", L[ I "unistd.h"; S"pwrite"; ];
+     "READ", L[ I "unistd.h"; S"read"; ];
+@@ -270,3 +272,20 @@
+     "SETRESUID", L[ I"sys/types.h"; I"unistd.h"; S"setresuid"; S"setresgid" ];
+   ]
+ 
++let () = 
++  let args0 = [
++    "-ocamlc", Arg.Set_string ocamlc, "<path> ocamlc";
++    "-ext_obj", Arg.Set_string ext_obj, "<ext> C object files extension";
++    "-v", Arg.Unit (fun () -> verbose := 2), " Show code for failed tests";
++    "-q", Arg.Unit (fun () -> verbose := 0), " Do not show stderr from children";
++  ] in
++  let args1 = List.map (fun (name,_) ->
++    assert (not (String.contains name ' '));
++    "--disable-" ^ String.lowercase name,
++    Arg.Unit (fun () -> disabled := name :: !disabled),
++    " disable " ^ name) features 
++  in
++  let args = Arg.align (args0 @ args1) in
++  Arg.parse args failwith ("Options are:");
++  main features
++
+diff -u -r src/sendmsg.c extunix/src/sendmsg.c
+--- src/sendmsg.c	2012-05-19 22:22:56.000000000 +0200
++++ extunix/src/sendmsg.c	2012-05-29 11:42:25.000000000 +0200
+@@ -31,7 +31,7 @@
+ 
+   if (sendfd_val != Val_none) {
+     int sendfd = Int_val(Some_val(sendfd_val));
+-#if defined(CMSG_SPACE) && !defined(NO_MSGHDR_MSG_CONTROL)
++#if defined(CMSG_SPACE)
+     union {
+       struct cmsghdr cmsg; /* for alignment */
+       char control[CMSG_SPACE(sizeof sendfd)];
+@@ -84,7 +84,7 @@
+   struct iovec iov[1];
+   char buf[4096];
+ 
+-#if defined(CMSG_SPACE) && !defined(NO_MSGHDR_MSG_CONTROL)
++#if defined(CMSG_SPACE)
+   union {
+     struct cmsghdr cmsg; /* just for alignment */
+     char control[CMSG_SPACE(sizeof recvfd)];
+@@ -113,7 +113,7 @@
+ 
+   res = caml_alloc(2, 0);
+ 
+-#if defined(CMSG_SPACE) && !defined(NO_MSGHDR_MSG_CONTROL)
++#if defined(CMSG_SPACE)
+   cmsgp = CMSG_FIRSTHDR(&msg);
+   if (cmsgp == NULL) {
+     Store_field(res, 0, Val_none);

Deleted: trunk/dports/devel/ocaml-extunix/files/patch-src-discover.ml.diff
===================================================================
--- trunk/dports/devel/ocaml-extunix/files/patch-src-discover.ml.diff	2012-05-29 09:01:46 UTC (rev 93739)
+++ trunk/dports/devel/ocaml-extunix/files/patch-src-discover.ml.diff	2012-05-29 10:33:47 UTC (rev 93740)
@@ -1,19 +0,0 @@
---- src/discover.ml	2011-07-12 10:21:07.000000000 +0200
-+++ src/discover.ml	2011-09-28 11:33:04.000000000 +0200
-@@ -35,8 +35,6 @@
- let get_includes = filter_map (function I s -> Some s | _ -> None)
- 
- let config_defines = [
--  "_POSIX_C_SOURCE 200112L";
--  "_XOPEN_SOURCE 600";
-   "_BSD_SOURCE";
-   "_LARGEFILE64_SOURCE";
-   "WIN32_LEAN_AND_MEAN";
-@@ -243,6 +241,6 @@
-     "EXECINFO", L[ I"execinfo.h"; S"backtrace"; S"backtrace_symbols"; ];
-     "SETENV", L[ I"stdlib.h"; S"setenv"; S"unsetenv"; ];
-     "CLEARENV", L[ I"stdlib.h"; S"clearenv"; ];
--    "MKDTEMP", L[ I"stdlib.h"; S"mkdtemp"; ];
-+    "MKDTEMP", L[ I"stdlib.h"; I"unistd.h"; S"mkdtemp"; ];
-   ]
- 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120529/7de1a823/attachment-0001.html>


More information about the macports-changes mailing list