From a05a0ef62b7c9ce273c63da628449ba32effb327 Mon Sep 17 00:00:00 2001 From: chrisz Date: Thu, 26 Sep 2019 09:33:14 +0000 Subject: [PATCH] Import graphics/ocaml-graphics This was formally shipped with the OCaml compiler distribution, but is now a seperate project. ok jca@, krw@, sthen@ --- graphics/ocaml-graphics/Makefile | 30 +++++++++++++++++++ graphics/ocaml-graphics/distinfo | 2 ++ .../patches/patch-src_unix_open_c | 14 +++++++++ graphics/ocaml-graphics/pkg/DESCR | 2 ++ graphics/ocaml-graphics/pkg/PFRAG.native | 6 ++++ graphics/ocaml-graphics/pkg/PLIST | 25 ++++++++++++++++ 6 files changed, 79 insertions(+) create mode 100644 graphics/ocaml-graphics/Makefile create mode 100644 graphics/ocaml-graphics/distinfo create mode 100644 graphics/ocaml-graphics/patches/patch-src_unix_open_c create mode 100644 graphics/ocaml-graphics/pkg/DESCR create mode 100644 graphics/ocaml-graphics/pkg/PFRAG.native create mode 100644 graphics/ocaml-graphics/pkg/PLIST diff --git a/graphics/ocaml-graphics/Makefile b/graphics/ocaml-graphics/Makefile new file mode 100644 index 00000000000..944c795b195 --- /dev/null +++ b/graphics/ocaml-graphics/Makefile @@ -0,0 +1,30 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2019/09/26 09:33:14 chrisz Exp $ + +COMMENT = graphics library providing basic drawing primitives +CATEGORIES = graphics + +V = 5.0.0 +DISTNAME = graphics-$V +PKGNAME = ocaml-graphics-$V + +# LGPL 2.1 with linking exception +PERMIT_PACKAGE = Yes + +WANTLIB += X11 + +MASTER_SITES = https://github.com/ocaml/graphics/releases/download/${V}/ +EXTRACT_SUFX = .tbz + +MODULES = lang/ocaml + +BUILD_DEPENDS = devel/dune + +MAKE_ENV = CPATH=${X11BASE}/include \ + LIBRARY_PATH=${X11BASE}/lib + +ALL_TARGET = default + +post-install: + mv ${PREFIX}/doc/graphics ${PREFIX}/share/doc/ocaml-graphics + +.include diff --git a/graphics/ocaml-graphics/distinfo b/graphics/ocaml-graphics/distinfo new file mode 100644 index 00000000000..1e6c64f4494 --- /dev/null +++ b/graphics/ocaml-graphics/distinfo @@ -0,0 +1,2 @@ +SHA256 (graphics-5.0.0.tbz) = Lc9g1VKusri/bB/hlkxa/+i/44vEuGJZ7k3L66IwFV0= +SIZE (graphics-5.0.0.tbz) = 39856 diff --git a/graphics/ocaml-graphics/patches/patch-src_unix_open_c b/graphics/ocaml-graphics/patches/patch-src_unix_open_c new file mode 100644 index 00000000000..a2f345f74fe --- /dev/null +++ b/graphics/ocaml-graphics/patches/patch-src_unix_open_c @@ -0,0 +1,14 @@ +$OpenBSD: patch-src_unix_open_c,v 1.1.1.1 2019/09/26 09:33:14 chrisz Exp $ + +Index: src/unix/open.c +--- src/unix/open.c.orig ++++ src/unix/open.c +@@ -365,7 +365,7 @@ value caml_gr_sigio_handler(void) + + /* Processing of graphic errors */ + +-static value * graphic_failure_exn = NULL; ++const static value * graphic_failure_exn = NULL; + + void caml_gr_fail(const char *fmt, const char *arg) + { diff --git a/graphics/ocaml-graphics/pkg/DESCR b/graphics/ocaml-graphics/pkg/DESCR new file mode 100644 index 00000000000..4fb33d16c3e --- /dev/null +++ b/graphics/ocaml-graphics/pkg/DESCR @@ -0,0 +1,2 @@ +The Graphics module provides portable basic drawing primitives. +It used to be distributed with the OCaml compiler up to OCaml 4.08. diff --git a/graphics/ocaml-graphics/pkg/PFRAG.native b/graphics/ocaml-graphics/pkg/PFRAG.native new file mode 100644 index 00000000000..501ad3d6bcb --- /dev/null +++ b/graphics/ocaml-graphics/pkg/PFRAG.native @@ -0,0 +1,6 @@ +@comment $OpenBSD: PFRAG.native,v 1.1.1.1 2019/09/26 09:33:14 chrisz Exp $ +lib/ocaml/graphics/graphics.a +lib/ocaml/graphics/graphics.cmx +lib/ocaml/graphics/graphics.cmxa +lib/ocaml/graphics/graphics.cmxs +lib/ocaml/graphics/graphicsX11.cmx diff --git a/graphics/ocaml-graphics/pkg/PLIST b/graphics/ocaml-graphics/pkg/PLIST new file mode 100644 index 00000000000..553fab53088 --- /dev/null +++ b/graphics/ocaml-graphics/pkg/PLIST @@ -0,0 +1,25 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2019/09/26 09:33:14 chrisz Exp $ +@pkgpath lang/ocaml,-graphics +%%native%% +doc/ +lib/ocaml/graphics/ +lib/ocaml/graphics/META +lib/ocaml/graphics/dune-package +lib/ocaml/graphics/graphics.cma +lib/ocaml/graphics/graphics.cmi +lib/ocaml/graphics/graphics.cmt +lib/ocaml/graphics/graphics.cmti +lib/ocaml/graphics/graphics.ml +lib/ocaml/graphics/graphics.mli +lib/ocaml/graphics/graphicsX11.cmi +lib/ocaml/graphics/graphicsX11.cmt +lib/ocaml/graphics/graphicsX11.cmti +lib/ocaml/graphics/graphicsX11.ml +lib/ocaml/graphics/graphicsX11.mli +lib/ocaml/graphics/libgraphics_stubs.a +lib/ocaml/graphics/opam +lib/ocaml/stublibs/dllgraphics_stubs.so +share/doc/ocaml-graphics/ +share/doc/ocaml-graphics/CHANGES.md +share/doc/ocaml-graphics/LICENSE +share/doc/ocaml-graphics/README.md