Import math/ocaml-num, the deprecated arbitrary precision library formerly

distributed with the OCaml compiler distribution.
Needed to build mldonkey.
Marked as BROKEN till the next OCaml upgrade.

OK jca@
This commit is contained in:
chrisz 2018-07-11 15:10:47 +00:00
parent 953d5285f4
commit a998d40574
7 changed files with 129 additions and 0 deletions

39
math/ocaml-num/Makefile Normal file
View File

@ -0,0 +1,39 @@
# $OpenBSD: Makefile,v 1.1.1.1 2018/07/11 15:10:47 chrisz Exp $
BROKEN = in preparation for OCaml 4.06
COMMENT = library for arithmetic on big integers and rationals
CATEGORIES = math
V = 1.1
GH_ACCOUNT = ocaml
GH_PROJECT = num
#GH_TAGNAME = v${V}
# This commit includes a necessary fix for installing via findlib.
# XXX: Switch back to GH_TAGNAME on next update
GH_COMMIT = 7dd5e935aaa2b902585b3b2d0e55ad9b2442fff0
DISTNAME = ${GH_PROJECT}-${V}
PKGNAME = ocaml-${DISTNAME}
HOMEPAGE = https://github.com/ocaml/num/
MAINTAINER = Christopher Zimmermann <chrisz@openbsd.org>
# LGPL 2.1
PERMIT_PACKAGE_CDROM = Yes
MODULES = lang/ocaml
BUILD_DEPENDS = sysutils/findlib
USE_GMAKE = Yes
.include <bsd.port.arch.mk>
.if ${PROPERTIES:Mocaml_native}
MAKE_ENV = NATIVE=true
.else
MAKE_ENV = NATIVE=false
.endif
INSTALL_TARGET = findlib-install
.include <bsd.port.mk>

2
math/ocaml-num/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (num-1.1-7dd5e935.tar.gz) = ozvJ3zJCJVU1swCqVGpeU06tVb2MawfVAHLyDIoD08M=
SIZE (num-1.1-7dd5e935.tar.gz) = 65379

View File

@ -0,0 +1,41 @@
$OpenBSD: patch-src_Makefile,v 1.1.1.1 2018/07/11 15:10:47 chrisz Exp $
Allow building bytecode-only on native archs.
Index: src/Makefile
--- src/Makefile.orig
+++ src/Makefile
@@ -37,13 +37,17 @@ COBJS=bng.$(O) nat_stubs.$(O)
all:: libnums.$(A) nums.cma
+ifeq "$(NATIVE)" "true"
ifneq "$(ARCH)" "none"
all:: nums.cmxa
endif
+endif
+ifeq "$(NATIVE)" "true"
ifeq "$(NATDYNLINK)" "true"
all:: nums.cmxs
endif
+endif
libnums.$(A): $(COBJS)
$(OCAMLMKLIB) -oc nums $(COBJS)
@@ -75,11 +79,15 @@ nat_stubs.$(O): bng.h nat.h
# is installed via findlib
TOINSTALL=nums.cma libnums.$(A) $(CMIS) $(CMIS:.cmi=.mli) $(CMIS:.cmi=.cmti)
+ifeq "$(NATIVE)" "true"
ifneq "$(ARCH)" "none"
TOINSTALL+=nums.cmxa nums.$(A) $(CMIS:.cmi=.cmx)
endif
+endif
+ifeq "$(NATIVE)" "true"
ifeq "$(NATDYNLINK)" "true"
TOINSTALL+=nums.cmxs
+endif
endif
ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true"
TOINSTALL_STUBS=dllnums$(EXT_DLL)

8
math/ocaml-num/pkg/DESCR Normal file
View File

@ -0,0 +1,8 @@
Arbitrary-precision arithmetic on big integers and on rationals.
This is a legacy library. It used to be part of the core OCaml distribution (in
otherlibs/num) but is now distributed separately. New applications that need
arbitrary-precision arithmetic should use the Zarith library
(https://github.com/ocaml/Zarith) instead of the Num library, and older
applications that already use Num are encouraged to switch to Zarith. Zarith
delivers much better performance than Num and has a nicer API.

View File

@ -0,0 +1,2 @@
@comment $OpenBSD: PFRAG.dynlink-native,v 1.1.1.1 2018/07/11 15:10:47 chrisz Exp $
@bin lib/ocaml/num/nums.cmxs

View File

@ -0,0 +1,9 @@
@comment $OpenBSD: PFRAG.native,v 1.1.1.1 2018/07/11 15:10:47 chrisz Exp $
%%dynlink%%
lib/ocaml/num/arith_status.cmx
lib/ocaml/num/big_int.cmx
lib/ocaml/num/nat.cmx
lib/ocaml/num/num.cmx
lib/ocaml/num/nums.a
lib/ocaml/num/nums.cmxa
lib/ocaml/num/ratio.cmx

28
math/ocaml-num/pkg/PLIST Normal file
View File

@ -0,0 +1,28 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2018/07/11 15:10:47 chrisz Exp $
%%native%%
lib/ocaml/num/
lib/ocaml/num-top/
lib/ocaml/num-top/META
lib/ocaml/num-top/num_top.cma
lib/ocaml/num-top/num_top.cmi
lib/ocaml/num-top/num_top_printers.cmi
lib/ocaml/num/META
lib/ocaml/num/arith_status.cmi
lib/ocaml/num/arith_status.cmti
lib/ocaml/num/arith_status.mli
lib/ocaml/num/big_int.cmi
lib/ocaml/num/big_int.cmti
lib/ocaml/num/big_int.mli
lib/ocaml/num/libnums.a
lib/ocaml/num/nat.cmi
lib/ocaml/num/nat.cmti
lib/ocaml/num/nat.mli
lib/ocaml/num/num.cmi
lib/ocaml/num/num.cmti
lib/ocaml/num/num.mli
lib/ocaml/num/nums.cma
lib/ocaml/num/ratio.cmi
lib/ocaml/num/ratio.cmti
lib/ocaml/num/ratio.mli
lib/ocaml/stublibs/dllnums.so
@comment lib/ocaml/stublibs/dllnums.so.owner