update to lwt-2.4.1

- patches now upstream, so remove local versions
- add missing GMAKE dependency (I am fixing this requirement in OASIS directly too)
This commit is contained in:
avsm 2012-09-05 21:39:09 +00:00
parent 6265a75a69
commit c0728d2077
6 changed files with 11 additions and 174 deletions

View File

@ -1,12 +1,11 @@
# $OpenBSD: Makefile,v 1.2 2012/09/01 14:36:57 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.3 2012/09/05 21:39:09 avsm Exp $
COMMENT = cooperative lightweight thread library
CATEGORIES = devel
DISTNAME = lwt-2.4.0
DISTNAME = lwt-2.4.1
PKGNAME = ocaml-${DISTNAME}
MASTER_SITES = http://ocsigen.org/download/
REVISION= 0
HOMEPAGE = http://ocsigen.org/lwt/
@ -29,6 +28,7 @@ WANTLIB = glib-2.0 ev iconv intl pthread
CONFIGURE_STYLE = oasis
CONFIGURE_ARGS = --enable-tests --enable-react --enable-glib --enable-ssl
USE_GMAKE = Yes
post-install:

View File

@ -1,2 +1,2 @@
SHA256 (lwt-2.4.0.tar.gz) = mY0rIcnq9SrWPHysF5SABh/tTmp1hdh5eMZs7var30g=
SIZE (lwt-2.4.0.tar.gz) = 501062
SHA256 (lwt-2.4.1.tar.gz) = XBKjEaFo0o8ZwQ4IeoRr6VSKzIvQOORBESuR3FsNIx8=
SIZE (lwt-2.4.1.tar.gz) = 501789

View File

@ -1,74 +0,0 @@
$OpenBSD: patch-discover_ml,v 1.1.1.1 2012/08/19 00:27:50 avsm Exp $
--- discover.ml.orig Thu Jul 19 13:35:56 2012
+++ discover.ml Sat Aug 18 07:23:25 2012
@@ -114,15 +114,18 @@ CAMLprim value lwt_test()
}
"
-let get_credentials_code = "
+let get_credentials_code struct_name = "
+#define _GNU_SOURCE
#include <caml/mlvalues.h>
#include <sys/types.h>
#include <sys/socket.h>
CAMLprim value lwt_test()
{
- getsockopt(0, SOL_SOCKET, SO_PEERCRED, 0, 0);
- return Val_unit;
+ struct " ^ struct_name ^ " cred;
+ socklen_t cred_len = sizeof(cred);
+ getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, &cred_len);
+ return Val_unit;
}
"
@@ -133,10 +136,10 @@ let get_peereid_code = "
CAMLprim value lwt_test()
{
- uid_t euid;
- gid_t egid;
- getpeereid(0, &euid, &egid);
- return Val_unit;
+ uid_t euid;
+ gid_t egid;
+ getpeereid(0, &euid, &egid);
+ return Val_unit;
}
"
@@ -461,10 +464,32 @@ Lwt can use pthread or the win32 API.
test_feature ~do_check "fd passing" "HAVE_FD_PASSING" (fun () -> test_code ([], []) fd_passing_code);
test_feature ~do_check "sched_getcpu" "HAVE_GETCPU" (fun () -> test_code ([], []) getcpu_code);
test_feature ~do_check "affinity getting/setting" "HAVE_AFFINITY" (fun () -> test_code ([], []) affinity_code);
- test_feature ~do_check "credentials getting (getsockopt)" "HAVE_GET_CREDENTIALS" (fun () -> test_code ([], []) get_credentials_code);
+ test_feature ~do_check "credentials getting (Linux)" "HAVE_GET_CREDENTIALS_LINUX" (fun () -> test_code ([], []) (get_credentials_code "ucred"));
+ test_feature ~do_check "credentials getting (NetBSD)" "HAVE_GET_CREDENTIALS_NETBSD" (fun () -> test_code ([], []) (get_credentials_code "sockcred"));
+ test_feature ~do_check "credentials getting (OpenBSD)" "HAVE_GET_CREDENTIALS_OPENBSD" (fun () -> test_code ([], []) (get_credentials_code "sockpeercred"));
+ test_feature ~do_check "credentials getting (FreeBSD)" "HAVE_GET_CREDENTIALS_FREEBSD" (fun () -> test_code ([], []) (get_credentials_code "cmsgcred"));
test_feature ~do_check "credentials getting (getpeereid)" "HAVE_GETPEEREID" (fun () -> test_code ([], []) get_peereid_code);
test_feature ~do_check "fdatasync" "HAVE_FDATASYNC" (fun () -> test_code ([], []) fdatasync_code);
test_feature ~do_check "netdb_reentrant" "HAVE_NETDB_REENTRANT" (fun () -> test_code ([], []) netdb_reentrant_code);
+
+ let get_cred_vars = [
+ "HAVE_GET_CREDENTIALS_LINUX";
+ "HAVE_GET_CREDENTIALS_NETBSD";
+ "HAVE_GET_CREDENTIALS_OPENBSD";
+ "HAVE_GET_CREDENTIALS_FREEBSD";
+ "HAVE_GETPEEREID";
+ ] in
+
+ Printf.fprintf config "\
+#if %s
+# define HAVE_GET_CREDENTIALS
+#endif
+"
+ (String.concat " || " (List.map (Printf.sprintf "defined(%s)") get_cred_vars));
+
+ Printf.fprintf config_ml
+ "#let HAVE_GET_CREDENTIALS = %s\n"
+ (String.concat " || " get_cred_vars);
if !os_type = "Win32" then begin
output_string config "#define LWT_ON_WINDOWS\n";

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-setup_ml,v 1.1.1.1 2012/08/19 00:27:50 avsm Exp $
--- setup.ml.orig Thu Jul 19 13:36:00 2012
+++ setup.ml Fri Aug 17 15:44:30 2012
@@ -5748,7 +5748,7 @@ let setup_t =
$OpenBSD: patch-setup_ml,v 1.2 2012/09/05 21:39:09 avsm Exp $
--- setup.ml.orig Wed Sep 5 21:56:57 2012
+++ setup.ml Wed Sep 5 21:57:13 2012
@@ -5601,7 +5601,7 @@ let setup_t =
CustomPlugin.cmd_main =
[
(OASISExpr.EBool true,
@ -10,7 +10,7 @@ $OpenBSD: patch-setup_ml,v 1.1.1.1 2012/08/19 00:27:50 avsm Exp $
];
cmd_clean = [(OASISExpr.EBool true, None)];
cmd_distclean = [(OASISExpr.EBool true, None)];
@@ -5801,7 +5801,7 @@ let setup_t =
@@ -5654,7 +5654,7 @@ let setup_t =
CustomPlugin.cmd_main =
[
(OASISExpr.EBool true,
@ -19,7 +19,7 @@ $OpenBSD: patch-setup_ml,v 1.1.1.1 2012/08/19 00:27:50 avsm Exp $
];
cmd_clean = [(OASISExpr.EBool true, None)];
cmd_distclean = [(OASISExpr.EBool true, None)];
@@ -5852,7 +5852,7 @@ let setup_t =
@@ -5705,7 +5705,7 @@ let setup_t =
CustomPlugin.cmd_main =
[
(OASISExpr.EBool true,

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-src_unix_lwt_unix_ml,v 1.1.1.1 2012/08/19 00:27:50 avsm Exp $
--- src/unix/lwt_unix.ml.orig Thu Jul 19 13:35:56 2012
+++ src/unix/lwt_unix.ml Sat Aug 18 07:23:25 2012
@@ -1748,7 +1748,7 @@ type credentials = {
cred_gid : int;
}
-#if HAVE_GET_CREDENTIALS || HAVE_GETPEEREID
+#if HAVE_GET_CREDENTIALS
external stub_get_credentials : Unix.file_descr -> credentials = "lwt_unix_get_credentials"

View File

@ -1,77 +0,0 @@
$OpenBSD: patch-src_unix_lwt_unix_unix_c,v 1.1.1.1 2012/08/19 00:27:50 avsm Exp $
--- src/unix/lwt_unix_unix.c.orig Thu Jul 19 13:35:56 2012
+++ src/unix/lwt_unix_unix.c Sat Aug 18 09:30:51 2012
@@ -26,12 +26,17 @@
#define ARGS(args...) args
+#include <sys/uio.h>
+#include <sys/un.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <sys/wait.h>
+#include <poll.h>
+
/* +-----------------------------------------------------------------+
| Test for readability/writability |
+-----------------------------------------------------------------+ */
-#include <poll.h>
-
CAMLprim value lwt_unix_readable(value fd)
{
struct pollfd pollfd;
@@ -411,24 +416,36 @@ CAMLprim value lwt_unix_bytes_send_msg(value val_fd, v
| Credentials |
+-----------------------------------------------------------------+ */
-#if defined(HAVE_GET_CREDENTIALS)
+#if defined(HAVE_GET_CREDENTIALS_LINUX)
+# define CREDENTIALS_TYPE struct ucred
+# define CREDENTIALS_FIELD(id) id
+#elif defined(HAVE_GET_CREDENTIALS_NETBSD)
+# define CREDENTIALS_TYPE struct sockcred
+# define CREDENTIALS_FIELD(id) sc_ ## id
+#elif defined(HAVE_GET_CREDENTIALS_OPENBSD)
+# define CREDENTIALS_TYPE struct sockpeercred
+# define CREDENTIALS_FIELD(id) id
+#elif defined(HAVE_GET_CREDENTIALS_FREEBSD)
+# define CREDENTIALS_TYPE struct cmsgcred
+# define CREDENTIALS_FIELD(id) cmsgcred_ ## id
+#endif
-#include <sys/un.h>
+#if defined(CREDENTIALS_TYPE)
CAMLprim value lwt_unix_get_credentials(value fd)
{
CAMLparam1(fd);
CAMLlocal1(res);
- struct ucred cred;
+ CREDENTIALS_TYPE cred;
socklen_t cred_len = sizeof(cred);
if (getsockopt(Int_val(fd), SOL_SOCKET, SO_PEERCRED, &cred, &cred_len) == -1)
uerror("get_credentials", Nothing);
res = caml_alloc_tuple(3);
- Store_field(res, 0, Val_int(cred.pid));
- Store_field(res, 1, Val_int(cred.uid));
- Store_field(res, 2, Val_int(cred.gid));
+ Store_field(res, 0, Val_int(cred.CREDENTIALS_FIELD(pid)));
+ Store_field(res, 1, Val_int(cred.CREDENTIALS_FIELD(uid)));
+ Store_field(res, 2, Val_int(cred.CREDENTIALS_FIELD(gid)));
CAMLreturn(res);
}
@@ -458,10 +475,6 @@ CAMLprim value lwt_unix_get_credentials(value fd)
+-----------------------------------------------------------------+ */
/* Some code duplicated from OCaml's otherlibs/unix/wait.c */
-
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
CAMLextern int caml_convert_signal_number (int);
CAMLextern int caml_rev_convert_signal_number (int);