From 485e3029aa4dc108ab10212de5871564001bf773 Mon Sep 17 00:00:00 2001 From: Marcus Alves Grando Date: Wed, 29 Nov 2006 17:13:24 +0000 Subject: - Fix build in FreeBSD < 5.1 - Take MAINTAINER --- devel/libevent/Makefile | 13 +++--- devel/libevent/files/patch-event.h | 16 ++++++++ devel/libevent/files/patch-test-regress_http.c | 55 ++++++++++++++++++++++++-- 3 files changed, 72 insertions(+), 12 deletions(-) create mode 100644 devel/libevent/files/patch-event.h (limited to 'devel') diff --git a/devel/libevent/Makefile b/devel/libevent/Makefile index 7fbd57be2df3..77305a2ddf6d 100644 --- a/devel/libevent/Makefile +++ b/devel/libevent/Makefile @@ -11,9 +11,10 @@ PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= http://monkey.org/~provos/ -MAINTAINER= ports@FreeBSD.org +MAINTAINER= mnag@FreeBSD.org COMMENT= Provides an API to execute callback functions on certain events +USE_GETOPT_LONG=yes GNU_CONFIGURE= yes USE_LDCONFIG= yes @@ -88,11 +89,7 @@ MLINKS= event.3 event_init.3 \ post-patch: @${REINPLACE_CMD} -e 's,CFLAGS =,CFLAGS +=,' ${WRKSRC}/Makefile.in + @${REINPLACE_CMD} -e 's|||' \ + ${WRKSRC}/epoll.c ${WRKSRC}/epoll_sub.c ${WRKSRC}/evdns.c -.include - -.if ${OSVERSION} < 500000 -BROKEN= Does not compile on 4.x -.endif - -.include +.include diff --git a/devel/libevent/files/patch-event.h b/devel/libevent/files/patch-event.h new file mode 100644 index 000000000000..65232cbfa5bb --- /dev/null +++ b/devel/libevent/files/patch-event.h @@ -0,0 +1,16 @@ +# +# Define CLOCK_MONOTONIC if FreeBSD < 5.1 +# +--- event.h.orig Wed Nov 29 12:09:48 2006 ++++ event.h Wed Nov 29 12:10:25 2006 +@@ -56,6 +56,10 @@ + #define EV_SIGNAL 0x08 + #define EV_PERSIST 0x10 /* Persistant event */ + ++#if defined(__FreeBSD__) && (__FreeBSD_version < 501000) ++#define CLOCK_MONOTONIC 4 ++#endif ++ + /* Fix so that ppl dont have to run with */ + #ifndef TAILQ_ENTRY + #define _EVENT_DEFINED_TQENTRY diff --git a/devel/libevent/files/patch-test-regress_http.c b/devel/libevent/files/patch-test-regress_http.c index 8ffc604d0d91..3d49d6fe6d6e 100644 --- a/devel/libevent/files/patch-test-regress_http.c +++ b/devel/libevent/files/patch-test-regress_http.c @@ -1,6 +1,44 @@ ---- test/regress_http.c.orig Sun Oct 15 15:51:59 2006 -+++ test/regress_http.c Tue Oct 31 04:13:45 2006 -@@ -365,7 +365,7 @@ +--- test/regress_http.c.orig Sun Oct 15 18:51:59 2006 ++++ test/regress_http.c Wed Nov 29 15:00:35 2006 +@@ -125,13 +125,14 @@ + http_readcb(struct bufferevent *bev, void *arg) + { + const char *what = "This is funny"; ++ int done; + + event_debug(("%s: %s\n", __func__, EVBUFFER_DATA(bev->input))); + + if (evbuffer_find(bev->input, what, strlen(what)) != NULL) { + struct evhttp_request *req = evhttp_request_new(NULL, NULL); + req->kind = EVHTTP_RESPONSE; +- int done = evhttp_parse_lines(req, bev->input); ++ done = evhttp_parse_lines(req, bev->input); + + if (done == 1 && + evhttp_find_header(req->input_headers, +@@ -163,9 +164,11 @@ + void + http_basic_cb(struct evhttp_request *req, void *arg) + { ++ struct evbuffer *evb; ++ + event_debug((stderr, "%s: called\n", __func__)); + +- struct evbuffer *evb = evbuffer_new(); ++ evb = evbuffer_new(); + evbuffer_add_printf(evb, "This is funny"); + + evhttp_send_reply(req, HTTP_OK, "Everything is fine", evb); +@@ -355,6 +358,8 @@ + void + http_post_cb(struct evhttp_request *req, void *arg) + { ++ struct evbuffer *evb; ++ + event_debug((stderr, "%s: called\n", __func__)); + + /* Yes, we are expecting a post request */ +@@ -365,7 +370,7 @@ if (EVBUFFER_LENGTH(req->input_buffer) != strlen(POST_DATA)) { fprintf(stdout, "FAILED (length: %ld vs %ld)\n", @@ -9,7 +47,16 @@ exit(1); } -@@ -403,7 +403,7 @@ +@@ -377,7 +382,7 @@ + exit(1); + } + +- struct evbuffer *evb = evbuffer_new(); ++ evb = evbuffer_new(); + evbuffer_add_printf(evb, "This is funny"); + + evhttp_send_reply(req, HTTP_OK, "Everything is fine", evb); +@@ -403,7 +408,7 @@ if (EVBUFFER_LENGTH(req->input_buffer) != strlen(what)) { fprintf(stderr, "FAILED (length %ld vs %ld)\n", -- cgit v1.2.3