From 9024af45d60d20fe3cf0feff616f160d501628c8 Mon Sep 17 00:00:00 2001 From: John Marino Date: Mon, 2 Jun 2014 21:28:39 +0000 Subject: [PATCH] Add new Ocaml port: math/ocaml-zarith This is a new requirement for the latest veersion of alt-ergo. ================================================================ The Zarith library implements arithmetic and logical operations over arbitrary precision numbers. It uses GMP to efficiently implement arithmetic over large numbers. Small integers are represented as Caml unboxed integers for speed and space economy. WWW: http://forge.ocamlcore.org/projects/zarith --- math/Makefile | 1 + math/ocaml-zarith/Makefile | 45 +++++++++++++++++++++++++ math/ocaml-zarith/distinfo | 2 ++ math/ocaml-zarith/files/patch-configure | 26 ++++++++++++++ math/ocaml-zarith/pkg-descr | 6 ++++ math/ocaml-zarith/pkg-plist | 15 +++++++++ 6 files changed, 95 insertions(+) create mode 100644 math/ocaml-zarith/Makefile create mode 100644 math/ocaml-zarith/distinfo create mode 100644 math/ocaml-zarith/files/patch-configure create mode 100644 math/ocaml-zarith/pkg-descr create mode 100644 math/ocaml-zarith/pkg-plist diff --git a/math/Makefile b/math/Makefile index 9188af24b912..fc023f3f20af 100644 --- a/math/Makefile +++ b/math/Makefile @@ -274,6 +274,7 @@ SUBDIR += numdiff SUBDIR += nyh-hoc SUBDIR += ocaml-ocamlgraph + SUBDIR += ocaml-zarith SUBDIR += ocamlgsl SUBDIR += octave SUBDIR += octave-forge diff --git a/math/ocaml-zarith/Makefile b/math/ocaml-zarith/Makefile new file mode 100644 index 000000000000..aa7d75d5ff7f --- /dev/null +++ b/math/ocaml-zarith/Makefile @@ -0,0 +1,45 @@ +# Created by: John Marino +# $FreeBSD$ + +PORTNAME= zarith +PORTVERSION= 1.2.1 +CATEGORIES= math +MASTER_SITES= http://forge.ocamlcore.org/frs/download.php/1199/ +PKGNAMEPREFIX= ocaml- + +MAINTAINER= marino@FreeBSD.org +COMMENT= OCaml arithmetic library for arbitrary precision integers + +LICENSE= GPLv2 + +LIB_DEPENDS= libgmp.so:${PORTSDIR}/math/gmp + +USES= gmake perl5 shebangfix tar:tgz +USE_PERL5= build +USE_OCAML= yes +USE_OCAML_FINDLIB= yes +OCAMLFIND_LDCONF= /dev/null +HAS_CONFIGURE= yes +ALL_TARGET= all +SHEBANG_FILES= z_pp.pl +CONFIGURE_ENV+= DESTDIR=${STAGEDIR} +CPPFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib + +MAKE_JOBS_UNSAFE= yes +PORTDOCS= html +DOCSDIR= ${OCAML_DOCSDIR}/${PORTNAME} + +OPTIONS_DEFINE= DOCS + +.include + +.if ${PORT_OPTIONS:MDOCS} +ALL_TARGET+= doc + +post-install: + ${MKDIR} ${STAGEDIR}${DOCSDIR} + ${MV} ${WRKSRC}/html ${STAGEDIR}${DOCSDIR} +.endif + +.include diff --git a/math/ocaml-zarith/distinfo b/math/ocaml-zarith/distinfo new file mode 100644 index 000000000000..7acbd776f151 --- /dev/null +++ b/math/ocaml-zarith/distinfo @@ -0,0 +1,2 @@ +SHA256 (zarith-1.2.1.tgz) = 916801cc39599d3fca07384fbfeec4bfaa5ffcb497d68ef89320af40ba5e4144 +SIZE (zarith-1.2.1.tgz) = 68654 diff --git a/math/ocaml-zarith/files/patch-configure b/math/ocaml-zarith/files/patch-configure new file mode 100644 index 000000000000..d8022f7de1b1 --- /dev/null +++ b/math/ocaml-zarith/files/patch-configure @@ -0,0 +1,26 @@ +--- configure.orig 2013-06-12 07:13:59.000000000 +0000 ++++ configure +@@ -304,6 +304,14 @@ case $host in + arch='i686' + fi + ;; ++ i386-*freebsd* | i386-*dragonfly*) ++ ccdef="-DZ_ELF -DZ_DOT_LABEL_PREFIX $ccdef" ++ arch='i686' ++ ;; ++ amd64-*freebsd* | x86_64-*dragonfly*) ++ ccdef="-DZ_ELF -DZ_DOT_LABEL_PREFIX $ccdef" ++ arch='x86_64' ++ ;; + i386-*darwin* | x86_64-*darwin*) + ccdef="-DZ_UNDERSCORE_PREFIX -DZ_MACOS $ccdef" + if test "x$wordsize" = "x64"; then +@@ -401,7 +409,7 @@ CFLAGS=$ccinc $ccdef $ccopt + ASFLAGS=$ccdef $asopt + LIBS=$cclib + ARCH=$arch +-INSTALLDIR=$installdir ++INSTALLDIR=${DESTDIR}$installdir + AR=$ar + INSTALL=install + OCAMLFIND=ocamlfind diff --git a/math/ocaml-zarith/pkg-descr b/math/ocaml-zarith/pkg-descr new file mode 100644 index 000000000000..61b5b4c8d185 --- /dev/null +++ b/math/ocaml-zarith/pkg-descr @@ -0,0 +1,6 @@ +The Zarith library implements arithmetic and logical operations over +arbitrary precision numbers. It uses GMP to efficiently implement +arithmetic over large numbers. Small integers are represented as Caml +unboxed integers for speed and space economy. + +WWW: http://forge.ocamlcore.org/projects/zarith diff --git a/math/ocaml-zarith/pkg-plist b/math/ocaml-zarith/pkg-plist new file mode 100644 index 000000000000..d050699b5e7d --- /dev/null +++ b/math/ocaml-zarith/pkg-plist @@ -0,0 +1,15 @@ +%%OCAML_SITELIBDIR%%/zarith/META +%%OCAML_SITELIBDIR%%/zarith/big_int_Z.cmi +%%OCAML_SITELIBDIR%%/zarith/big_int_Z.mli +%%OCAML_SITELIBDIR%%/zarith/dllzarith.so +%%OCAML_SITELIBDIR%%/zarith/libzarith.a +%%OCAML_SITELIBDIR%%/zarith/q.cmi +%%OCAML_SITELIBDIR%%/zarith/q.mli +%%OCAML_SITELIBDIR%%/zarith/z.cmi +%%OCAML_SITELIBDIR%%/zarith/z.mli +%%OCAML_SITELIBDIR%%/zarith/zarith.a +%%OCAML_SITELIBDIR%%/zarith/zarith.cma +%%OCAML_SITELIBDIR%%/zarith/zarith.cmxa +%%OCAML_SITELIBDIR%%/zarith/zarith.cmxs +%%OCAML_SITELIBDIR%%/zarith/zarith.h +@dirrm %%OCAML_SITELIBDIR%%/zarith