aboutsummaryrefslogtreecommitdiff
path: root/devel/ocaml-sem
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2005-04-23 12:35:36 +0000
committerPav Lucistnik <pav@FreeBSD.org>2005-04-23 12:35:36 +0000
commita22f63ba68abf6248439980ceae5b861ae420f47 (patch)
tree42f69d124dbc329085b4557049a95c4fc15f05b0 /devel/ocaml-sem
parent2f07eb9c92cce8fd0eb89cf0b99c4e61b9756301 (diff)
downloadports-a22f63ba68abf6248439980ceae5b861ae420f47.tar.gz
ports-a22f63ba68abf6248439980ceae5b861ae420f47.zip
Notes
Diffstat (limited to 'devel/ocaml-sem')
-rw-r--r--devel/ocaml-sem/Makefile45
-rw-r--r--devel/ocaml-sem/distinfo2
-rw-r--r--devel/ocaml-sem/files/patch-sem_stubs.c18
-rw-r--r--devel/ocaml-sem/pkg-descr5
-rw-r--r--devel/ocaml-sem/pkg-install10
5 files changed, 80 insertions, 0 deletions
diff --git a/devel/ocaml-sem/Makefile b/devel/ocaml-sem/Makefile
new file mode 100644
index 000000000000..c48aa161abeb
--- /dev/null
+++ b/devel/ocaml-sem/Makefile
@@ -0,0 +1,45 @@
+# New ports collection makefile for: ocaml-sem
+# Date created: 19 April 2005
+# Whom: asmith
+#
+# $FreeBSD$
+#
+
+PORTNAME= sem
+PORTVERSION= 0.0.1
+CATEGORIES= devel
+MASTER_SITES= ftp://ftp.rtelekom.ru/pub/FreeBSD/ports/distfiles/
+PKGNAMEPREFIX= ocaml-
+
+MAINTAINER= argentoff@gmail.com
+COMMENT= POSIX semaphores for OCaml
+
+BUILD_DEPENDS= ocamlc:${PORTSDIR}/lang/ocaml \
+ ocamlfind:${PORTSDIR}/devel/ocaml-findlib
+
+MAKE_ENV= OCAML_LIB_INSTALL="${PREFIX}/lib/ocaml/site-lib/sem" \
+ INCDIRS="${LOCALBASE}/include" LIBDIRS="${LOCALBASE}/lib"
+
+.if !defined(WITH_CUSTOM)
+MAKE_ENV+= NO_CUSTOM=y
+.endif
+ALL_TARGET= all
+
+PORTDOCS= html README
+DOCSDIR= ${PREFIX}/share/doc/${PKGNAMEPREFIX}${PORTNAME}
+
+USE_BZIP2= yes
+USE_GMAKE= yes
+
+PKGDEINSTALL= ${PKGINSTALL}
+
+post-install:
+ @${FIND} ${PREFIX}/lib/ocaml/site-lib/sem -type f | \
+ ${SED} "s,^${PREFIX}/,," >> ${TMPPLIST}
+ @${ECHO_CMD} "@dirrm lib/ocaml/site-lib/sem" >> ${TMPPLIST}
+ @${ECHO_CMD} "@unexec ocamlfind remove sem 2>/dev/null || true" >> ${TMPPLIST}
+ @${MKDIR} ${DOCSDIR}
+ ${CP} -R ${WRKSRC}/doc/ ${DOCSDIR}
+ ${CP} ${WRKSRC}/README ${DOCSDIR}
+
+.include <bsd.port.mk>
diff --git a/devel/ocaml-sem/distinfo b/devel/ocaml-sem/distinfo
new file mode 100644
index 000000000000..c4b6d7f2d8ff
--- /dev/null
+++ b/devel/ocaml-sem/distinfo
@@ -0,0 +1,2 @@
+MD5 (sem-0.0.1.tar.bz2) = 28ddb9f9842b564abf9f0ca8ff82fe56
+SIZE (sem-0.0.1.tar.bz2) = 10871
diff --git a/devel/ocaml-sem/files/patch-sem_stubs.c b/devel/ocaml-sem/files/patch-sem_stubs.c
new file mode 100644
index 000000000000..81bdba6bf7db
--- /dev/null
+++ b/devel/ocaml-sem/files/patch-sem_stubs.c
@@ -0,0 +1,18 @@
+--- sem_stubs.c.orig Tue Apr 19 16:20:34 2005
++++ sem_stubs.c Sat Apr 23 14:18:56 2005
+@@ -137,12 +137,14 @@
+ };
+
+ value stub_sem_getvalue(value sem) {
++ int * vp;
++
+ CAMLparam1(sem);
+ CAMLlocal2(estr, v);
+
+ estr = copy_string("");
+
+- int * vp = calloc(1, sizeof(int));
++ vp = calloc(1, sizeof(int));
+ if (sem_getvalue((sem_t *)sem,vp) == -1) {
+ uerror("sem_getvalue", estr);
+ };
diff --git a/devel/ocaml-sem/pkg-descr b/devel/ocaml-sem/pkg-descr
new file mode 100644
index 000000000000..5c9cf5a8e52d
--- /dev/null
+++ b/devel/ocaml-sem/pkg-descr
@@ -0,0 +1,5 @@
+POSIX semaphores for OCaml. The library mimics things found under "man sem"
+and "man sem_open".
+
+- Paul Argentoff
+argentoff@gmail.com
diff --git a/devel/ocaml-sem/pkg-install b/devel/ocaml-sem/pkg-install
new file mode 100644
index 000000000000..61774bb649e4
--- /dev/null
+++ b/devel/ocaml-sem/pkg-install
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+if [ "$2" = "POST-INSTALL" ]; then
+ echo "${PKG_PREFIX}/lib/ocaml/site-lib/sem" >> ${PKG_PREFIX}/lib/ocaml/ld.conf
+elif [ "$2" = "DEINSTALL" ]; then
+ mv ${PKG_PREFIX}/lib/ocaml/ld.conf ${PKG_PREFIX}/lib/ocaml/ld.conf.tmp
+ grep -v sem ${PKG_PREFIX}/lib/ocaml/ld.conf.tmp > ${PKG_PREFIX}/lib/ocaml/ld.conf
+ rm -f ${PKG_PREFIX}/lib/ocaml/ld.conf.tmp
+ chmod 0444 ${PKG_PREFIX}/lib/ocaml/ld.conf
+fi