From nobody Tue Nov 22 17:37:10 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NGrzp24hMz4j8FM; Tue, 22 Nov 2022 17:37:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NGrzp1T46z3h4Z; Tue, 22 Nov 2022 17:37:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669138630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=axqRk8wwNr+nBg0AL5cpVGxsPDR91iZoeqRQmgYXkN8=; b=jA1W42hYA6PVPtJjASkDAhiWRuezZBLShGr/UeEwik1VVAorQjDu4p/lPqGLez8s3Y6UaG LWvP9YNuXUjhAn8THuKT+UP8ZqJWwzlkQt0BctgXEisLSJUmkBA0jEW9wrS1I9Y30sKDqy 4Y45N/bOtQjpE1yTs13u5SfibEaNavCyH/M8pxZ/tw2u/pnUqrQPrpJG9W+jikxqXKhnDz V5/sz29D6wYJPNOv8BjLNQZrvWAI+gv5A6uYhytFQAidVwFDIXJ8LIRxhUqHnnhEF9g9+z GUZIc6osMuqUSc3YJ44WEvbN745UFmt8/olEwJwZPEKtrVqa8wSq3VGJ0/jxUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669138630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=axqRk8wwNr+nBg0AL5cpVGxsPDR91iZoeqRQmgYXkN8=; b=WCNJW1+lkixC8go2ZF5wHbGaRr0QpE+6pdd8jssU77qmtowsUlBFJC0nFpHLc3Zquymsvd crc/V6KZmOUCiBHp5qexTvQjwIPOf8UE1Hlgk7E8qqKjxfaTgevBMNurBNAbzQdRuUs2Ye +uGkFm9gEN2pXfn5l16ic4u5Zk1Qv5nuE8q2LhjMryf8TdcH8nwd4PlCtXvTrQzuv2TdpO I3rpNaidL9rdEzAbWRR3qUm0sBtlvN988jVIiN/U/NzynEGAdAo9UXtvljeE6c7ka5gK+7 MKbmaJ3KXvyK5dn/BcMn4AjTloCoRUf3Eqjgol1UD07hVeujsj2K0EcziFRjug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669138630; a=rsa-sha256; cv=none; b=NTH0T39oqLJYF/ONtTHOBjF/jDyVxzucsVCZl6kQ5zr4FiNOImXWy3t0vx6z/4RtZ1Ng/2 2FD/tfOqxeBJsmhGwQLT8K/D03LFcNGYFvxsGdzk90IA1vL4nFugWLFFn7NkRo0uZKaWdw zLC+wqlBCbkFPF3aaceSL4jix1B+dMTEzaKfKCf9hK4TEOvm/VPYPjBcwhFpucw/C0s9Ko tVIHDM2PYPqA6PaRkJ7hF5S30H6LDpbN3Dgv5re2Lu2OOhAQPHqm4IpBtOFcde2jN8qSdR rHCVMkPj+R/iJ9EFH/RMOvzWKvQoRom1lGDizqbOaGDxR93WNmvvqUFKfQuF2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NGrzp0WyWzr8J; Tue, 22 Nov 2022 17:37:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2AMHbAv3040084; Tue, 22 Nov 2022 17:37:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AMHbAp0040083; Tue, 22 Nov 2022 17:37:10 GMT (envelope-from git) Date: Tue, 22 Nov 2022 17:37:10 GMT Message-Id: <202211221737.2AMHbAp0040083@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Guido Falsi Subject: git: f2183b130f8a - main - graphics/ocaml-cairo: Objective Caml binding for the Cairo library List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: madpilot X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2183b130f8a2158ac036307c5f592962613b189 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by madpilot: URL: https://cgit.FreeBSD.org/ports/commit/?id=f2183b130f8a2158ac036307c5f592962613b189 commit f2183b130f8a2158ac036307c5f592962613b189 Author: Guido Falsi AuthorDate: 2022-11-22 17:33:49 +0000 Commit: Guido Falsi CommitDate: 2022-11-22 17:33:49 +0000 graphics/ocaml-cairo: Objective Caml binding for the Cairo library Importing a slightly outdated release that supports the ocaml and dune versions available in the ports tree. Including an upstream commit fixing a memory leak that was discovered in this release. --- graphics/Makefile | 1 + graphics/ocaml-cairo/Makefile | 40 +++++++++++++++++++ graphics/ocaml-cairo/distinfo | 3 ++ graphics/ocaml-cairo/files/patch-issue-19 | 64 +++++++++++++++++++++++++++++++ graphics/ocaml-cairo/pkg-descr | 2 + graphics/ocaml-cairo/pkg-plist | 53 +++++++++++++++++++++++++ 6 files changed, 163 insertions(+) diff --git a/graphics/Makefile b/graphics/Makefile index 92fe658afe02..ef1dd67f4d3f 100644 --- a/graphics/Makefile +++ b/graphics/Makefile @@ -588,6 +588,7 @@ SUBDIR += nsxiv SUBDIR += nurbs++ SUBDIR += nvidia-texture-tools + SUBDIR += ocaml-cairo SUBDIR += ocaml-images SUBDIR += ocaml-lablgl SUBDIR += ocrad diff --git a/graphics/ocaml-cairo/Makefile b/graphics/ocaml-cairo/Makefile new file mode 100644 index 000000000000..1285f883c22d --- /dev/null +++ b/graphics/ocaml-cairo/Makefile @@ -0,0 +1,40 @@ +PORTNAME= cairo +PORTVERSION= 0.6.1 +CATEGORIES= graphics +PKGNAMEPREFIX= ocaml- + +MAINTAINER= madpilot@FreeBSD.org +COMMENT= Objective Caml binding for the Cairo library +WWW= https://github.com/Chris00/ocaml-cairo + +LICENSE= LGPL3 +LICENSE_FILE= ${WRKSRC}/LICENSE.md + +BUILD_DEPENDS= dune:devel/ocaml-dune +LIB_DEPENDS+= libfreetype.so:print/freetype2 \ + libfontconfig.so:x11-fonts/fontconfig + +USES= gnome pkgconfig +USE_GNOME= cairo +USE_OCAML= yes + +USE_GITHUB= yes +GH_ACCOUNT= Chris00 +GH_PROJECT= ${PKGNAMEPREFIX}${PORTNAME} + +DOCSDIR= ${OCAML_DOCSDIR}/cairo2 +EXAMPLESDIR= ${OCAML_EXAMPLESDIR}/${PORTNAME} + +OPTIONS_DEFINE= DOCS EXAMPLES + +do-build: + cd ${BUILD_WRKSRC} && dune build --verbose -j ${MAKE_JOBS_NUMBER} -p cairo2 + +do-install: + cd ${INSTALL_WRKSRC} && dune install --destdir=${STAGEDIR} \ + --libdir=${OCAML_SITELIBDIR} cairo2 + +post-install-EXAMPLES-on: + @(cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}) + +.include diff --git a/graphics/ocaml-cairo/distinfo b/graphics/ocaml-cairo/distinfo new file mode 100644 index 000000000000..47a0b8e02d71 --- /dev/null +++ b/graphics/ocaml-cairo/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1669022120 +SHA256 (Chris00-ocaml-cairo-0.6.1_GH0.tar.gz) = 2d4492b62b31e714a7a98fcf54b98a46ae5f6430ebc7f1620568a9a28498ad11 +SIZE (Chris00-ocaml-cairo-0.6.1_GH0.tar.gz) = 109786 diff --git a/graphics/ocaml-cairo/files/patch-issue-19 b/graphics/ocaml-cairo/files/patch-issue-19 new file mode 100644 index 000000000000..23a1a684d73e --- /dev/null +++ b/graphics/ocaml-cairo/files/patch-issue-19 @@ -0,0 +1,64 @@ +From 3c70f2ff18650c4794556049cd4ea22a58cc719e Mon Sep 17 00:00:00 2001 +From: Christophe Troestler +Date: Sun, 27 Sep 2020 23:20:52 +0200 +Subject: [PATCH] Do not store the Caml_ba_array_val pointer during surface + creation + +Fixes https://github.com/Chris00/ocaml-cairo/issues/19 +--- + src/cairo_stubs.c | 3 ++- + tests/image_create.ml | 5 +++-- + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/cairo_stubs.c b/src/cairo_stubs.c +index 641ee2c..200abf3 100644 +--- src/cairo_stubs.c ++++ src/cairo_stubs.c +@@ -1580,6 +1580,7 @@ static cairo_status_t caml_cairo_image_bigarray_attach_proxy + caml_cairo_image_bigarray_finalize); + } + ++#define b (Caml_ba_array_val(vb)) + #define SURFACE_CREATE_DATA(name) \ + CAMLexport value caml_cairo_image_surface_create_for_##name \ + (value vb, value vformat, value vwidth, value vheight, value vstride) \ +@@ -1588,7 +1589,6 @@ static cairo_status_t caml_cairo_image_bigarray_attach_proxy + CAMLlocal1(vsurf); \ + cairo_surface_t* surf; \ + const int width = Int_val(vwidth); \ +- struct caml_ba_array *b = Caml_ba_array_val(vb); \ + cairo_status_t status; \ + \ + if ((b->flags & CAML_BA_MANAGED_MASK) == CAML_BA_MAPPED_FILE) \ +@@ -1610,6 +1610,7 @@ static cairo_status_t caml_cairo_image_bigarray_attach_proxy + + SURFACE_CREATE_DATA(data8) + SURFACE_CREATE_DATA(data32) ++#undef b + + #define SURFACE_GET_DATA(type, num_dims, dims ...) \ + CAMLexport value caml_cairo_image_surface_get_##type(value vsurf) \ +diff --git a/tests/image_create.ml b/tests/image_create.ml +index eec98d6..b13c206 100644 +--- tests/image_create.ml ++++ tests/image_create.ml +@@ -10,6 +10,7 @@ let create() = + + let () = + let cr = create() in ++ printf "With Cairo handle:\n%!"; + set_source_rgb cr 1. 1. 1.; + rectangle cr 0. 0. ~w:300. ~h:300.; + fill cr; +@@ -21,9 +22,9 @@ let () = + show_text cr "Hello"; + Gc.compact(); Gc.compact(); + +- eprintf "Write image\n%!"; ++ eprintf "- Write image\n%!"; + PNG.write (get_target cr) "test_image.png"; +- eprintf "Finish surface\n%!"; ++ eprintf "- Finish surface\n%!"; + Surface.finish (get_target cr); + Gc.compact() + diff --git a/graphics/ocaml-cairo/pkg-descr b/graphics/ocaml-cairo/pkg-descr new file mode 100644 index 000000000000..9e1b6f841de9 --- /dev/null +++ b/graphics/ocaml-cairo/pkg-descr @@ -0,0 +1,2 @@ +This is an OCaml binding for the Cairo library, a 2D graphics library +with support for multiple output devices. diff --git a/graphics/ocaml-cairo/pkg-plist b/graphics/ocaml-cairo/pkg-plist new file mode 100644 index 000000000000..f6511b7207d8 --- /dev/null +++ b/graphics/ocaml-cairo/pkg-plist @@ -0,0 +1,53 @@ +%%OCAML_SITELIBDIR%%/cairo2/META +%%OCAML_SITELIBDIR%%/cairo2/cairo.a +%%OCAML_SITELIBDIR%%/cairo2/cairo.cma +%%OCAML_SITELIBDIR%%/cairo2/cairo.cmi +%%OCAML_SITELIBDIR%%/cairo2/cairo.cmt +%%OCAML_SITELIBDIR%%/cairo2/cairo.cmti +%%OCAML_SITELIBDIR%%/cairo2/cairo.cmx +%%OCAML_SITELIBDIR%%/cairo2/cairo.cmxa +%%OCAML_SITELIBDIR%%/cairo2/cairo.cmxs +%%OCAML_SITELIBDIR%%/cairo2/cairo.ml +%%OCAML_SITELIBDIR%%/cairo2/cairo.mli +%%OCAML_SITELIBDIR%%/cairo2/cairo_ocaml.h +%%OCAML_SITELIBDIR%%/cairo2/dune-package +%%OCAML_SITELIBDIR%%/cairo2/libcairo_stubs.a +%%OCAML_SITELIBDIR%%/cairo2/opam +%%OCAML_SITELIBDIR%%/stublibs/dllcairo_stubs.so +%%PORTDOCS%%%%DOCSDIR%%/CHANGES.md +%%PORTDOCS%%%%DOCSDIR%%/LICENSE.md +%%PORTDOCS%%%%DOCSDIR%%/README.md +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/arcs.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/clip.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/curve_to.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/dash.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/diagram.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/draw.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/dune +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fill.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fill_stroke.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fill_style.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/gradient.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/graphics_demo.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/mask.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/paint.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/path_close.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pythagoras_tree.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/recording.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/set_line_cap.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/set_line_join.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/setsourcegradient.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/setsourcergba.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/showtext.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/stroke.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text_align_center.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text_extents.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/text_rotate.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/textextents.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tips_ellipse.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tips_font.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tips_letter.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/word_cloud/cloud.ml +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/word_cloud/cloud.mli +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/word_cloud/run.ml