aboutsummaryrefslogtreecommitdiffstats
path: root/ftp
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2012-07-18 22:21:51 +0800
committerMartin Matuska <mm@FreeBSD.org>2012-07-18 22:21:51 +0800
commit33399e10184f2f03a64da985c45a244f447468d0 (patch)
tree549698cb3df27f489a14e7f0ed824c3076ac7f85 /ftp
parent3030240c9ad7e67219b040fef9a3f6b1b4c1c7ef (diff)
downloadfreebsd-ports-gnome-33399e10184f2f03a64da985c45a244f447468d0.tar.gz
freebsd-ports-gnome-33399e10184f2f03a64da985c45a244f447468d0.tar.zst
freebsd-ports-gnome-33399e10184f2f03a64da985c45a244f447468d0.zip
This is a static version of the libcurl library for use with lang/hiphop-php
WWW: https://github.com/facebook/hiphop-php/wiki/
Diffstat (limited to 'ftp')
-rw-r--r--ftp/Makefile1
-rw-r--r--ftp/curl-hiphop/Makefile33
-rw-r--r--ftp/curl-hiphop/files/extra-patch-hiphop106
-rw-r--r--ftp/curl-hiphop/pkg-descr3
-rw-r--r--ftp/curl-hiphop/pkg-plist16
5 files changed, 159 insertions, 0 deletions
diff --git a/ftp/Makefile b/ftp/Makefile
index 5b981a5f8581..f0b5eefaa729 100644
--- a/ftp/Makefile
+++ b/ftp/Makefile
@@ -13,6 +13,7 @@
SUBDIR += cftp
SUBDIR += cmdftp
SUBDIR += curl
+ SUBDIR += curl-hiphop
SUBDIR += curlpp
SUBDIR += dmachine
SUBDIR += fget
diff --git a/ftp/curl-hiphop/Makefile b/ftp/curl-hiphop/Makefile
new file mode 100644
index 000000000000..f50778cd0bad
--- /dev/null
+++ b/ftp/curl-hiphop/Makefile
@@ -0,0 +1,33 @@
+# New ports collection makefile for: curl-hiphop
+# Date created: 16 July 2012
+# Whom: Martin Matuska <mm@FreeBSd.org>
+#
+# $FreeBSD$
+#
+
+PKGNAMESUFFIX= -hiphop
+
+MAINTAINER= mm@FreeBSD.org
+COMMENT= Static libcurl with custom patches for HipHop
+
+BUILDING_HIPHOP= yes
+
+HIPHOP_DIR= share/hiphop-php
+EXTRA_PATCHES= ${.CURDIR}/files/extra-patch-hiphop
+GNU_CONFIGURE_PREFIX= ${PREFIX}/${HIPHOP_DIR}/ext
+CONFIGURE_ARGS+= --disable-shared --enable-static
+PLIST_SUB+= HIPHOP_DIR="${HIPHOP_DIR}"
+LATEST_LINK= curl-hiphop
+PLIST= ${.CURDIR}/pkg-plist
+DESCR= ${.CURDIR}/pkg-descr
+
+MASTERDIR= ${.CURDIR}/../curl
+
+do-install:
+.for dir in include lib
+ @cd ${WRKSRC}/${dir} && \
+ ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} \
+ ${MAKE_ARGS} ${INSTALL_TARGET}
+.endfor
+
+.include "${MASTERDIR}/Makefile"
diff --git a/ftp/curl-hiphop/files/extra-patch-hiphop b/ftp/curl-hiphop/files/extra-patch-hiphop
new file mode 100644
index 000000000000..834181a2b2a4
--- /dev/null
+++ b/ftp/curl-hiphop/files/extra-patch-hiphop
@@ -0,0 +1,106 @@
+--- include/curl/multi.h.orig 20 May 2008 10:21:50 -0000 1.45
++++ include/curl/multi.h 29 Jan 2010 23:45:18 -0000
+@@ -135,6 +135,19 @@
+ int *max_fd);
+
+ /*
++ * Name: curl_multi_select()
++ *
++ * Desc: Calls select() or poll() internally so app can call
++ * curl_multi_perform() as soon as one of them is ready. This is to
++ * fix FD_SETSIZE problem curl_multi_fdset() has.
++ *
++ * Returns: CURLMcode type, general multi error code.
++ */
++CURL_EXTERN CURLMcode curl_multi_select(CURLM *multi_handle,
++ int timeout_ms,
++ int *ret);
++
++ /*
+ * Name: curl_multi_perform()
+ *
+ * Desc: When the app thinks there's data available for curl it calls this
+
+--- lib/multi.c.orig 2012-01-23 16:31:30.000000000 +0100
++++ lib/multi.c 2012-07-13 13:50:34.314507221 +0200
+@@ -941,6 +941,80 @@
+ return CURLM_OK;
+ }
+
++CURLMcode curl_multi_select(CURLM *multi_handle, int timeout_ms, int *ret) {
++ struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
++ struct Curl_one_easy *easy;
++ curl_socket_t sockbunch[MAX_SOCKSPEREASYHANDLE];
++ int bitmap;
++ int i;
++ unsigned int nfds = 0;
++ struct pollfd *ufds;
++ int nret = -1;
++
++ if(!GOOD_MULTI_HANDLE(multi))
++ return CURLM_BAD_HANDLE;
++
++ easy=multi->easy.next;
++ while(easy != &multi->easy) {
++ bitmap = multi_getsock(easy, sockbunch, MAX_SOCKSPEREASYHANDLE);
++
++ for(i=0; i< MAX_SOCKSPEREASYHANDLE; i++) {
++ curl_socket_t s = CURL_SOCKET_BAD;
++
++ if(bitmap & GETSOCK_READSOCK(i)) {
++ ++nfds;
++ s = sockbunch[i];
++ }
++ if(bitmap & GETSOCK_WRITESOCK(i)) {
++ ++nfds;
++ s = sockbunch[i];
++ }
++ if(s == CURL_SOCKET_BAD) {
++ break;
++ }
++ }
++
++ easy = easy->next; /* check next handle */
++ }
++
++ ufds = (struct pollfd *)malloc(nfds * sizeof(struct pollfd));
++ nfds = 0;
++
++ easy=multi->easy.next;
++ while(easy != &multi->easy) {
++ bitmap = multi_getsock(easy, sockbunch, MAX_SOCKSPEREASYHANDLE);
++
++ for(i=0; i< MAX_SOCKSPEREASYHANDLE; i++) {
++ curl_socket_t s = CURL_SOCKET_BAD;
++
++ if(bitmap & GETSOCK_READSOCK(i)) {
++ ufds[nfds].fd = sockbunch[i];
++ ufds[nfds].events = POLLIN;
++ ++nfds;
++ s = sockbunch[i];
++ }
++ if(bitmap & GETSOCK_WRITESOCK(i)) {
++ ufds[nfds].fd = sockbunch[i];
++ ufds[nfds].events = POLLOUT;
++ ++nfds;
++ s = sockbunch[i];
++ }
++ if(s == CURL_SOCKET_BAD) {
++ break;
++ }
++ }
++
++ easy = easy->next; /* check next handle */
++ }
++
++ nret = Curl_poll(ufds, nfds, timeout_ms);
++ free(ufds);
++ if (ret) {
++ *ret = nret;
++ }
++ return CURLM_OK;
++}
++
+ static CURLMcode multi_runsingle(struct Curl_multi *multi,
+ struct timeval now,
+ struct Curl_one_easy *easy)
diff --git a/ftp/curl-hiphop/pkg-descr b/ftp/curl-hiphop/pkg-descr
new file mode 100644
index 000000000000..7b47816cc95e
--- /dev/null
+++ b/ftp/curl-hiphop/pkg-descr
@@ -0,0 +1,3 @@
+This is a static version of the libcurl library for use with lang/hiphop-php
+
+WWW: https://github.com/facebook/hiphop-php/wiki/
diff --git a/ftp/curl-hiphop/pkg-plist b/ftp/curl-hiphop/pkg-plist
new file mode 100644
index 000000000000..0794afb98b31
--- /dev/null
+++ b/ftp/curl-hiphop/pkg-plist
@@ -0,0 +1,16 @@
+%%HIPHOP_DIR%%/ext/include/curl/curl.h
+%%HIPHOP_DIR%%/ext/include/curl/curlbuild.h
+%%HIPHOP_DIR%%/ext/include/curl/curlrules.h
+%%HIPHOP_DIR%%/ext/include/curl/curlver.h
+%%HIPHOP_DIR%%/ext/include/curl/easy.h
+%%HIPHOP_DIR%%/ext/include/curl/mprintf.h
+%%HIPHOP_DIR%%/ext/include/curl/multi.h
+%%HIPHOP_DIR%%/ext/include/curl/stdcheaders.h
+%%HIPHOP_DIR%%/ext/include/curl/typecheck-gcc.h
+@dirrm %%HIPHOP_DIR%%/ext/include/curl
+%%HIPHOP_DIR%%/ext/lib/libcurl.a
+%%HIPHOP_DIR%%/ext/lib/libcurl.la
+@dirrmtry %%HIPHOP_DIR%%/ext/include
+@dirrmtry %%HIPHOP_DIR%%/ext/lib
+@dirrmtry %%HIPHOP_DIR%%/ext
+@dirrmtry %%HIPHOP_DIR%% \ No newline at end of file