diff options
author | Mark Wright <gienah@gentoo.org> | 2020-10-13 15:57:20 +1100 |
---|---|---|
committer | Mark Wright <gienah@gentoo.org> | 2020-10-13 23:53:21 +1100 |
commit | d59ce4d3530bbb97d51eb12f372794d1c60b6d35 (patch) | |
tree | a632bdb9497116cf0aad8253a164980ba6d92d55 /dev-ml/cairo2 | |
parent | dev-ml/bin_prot: Dependency of dev-ml/ppx_bin_prot (diff) | |
download | gentoo-d59ce4d3530bbb97d51eb12f372794d1c60b6d35.tar.gz gentoo-d59ce4d3530bbb97d51eb12f372794d1c60b6d35.tar.bz2 gentoo-d59ce4d3530bbb97d51eb12f372794d1c60b6d35.zip |
dev-ml/cairo2: Dependency of dev-ml/lablgtk
Co-Author: Alexis Ballier <aballier@gentoo.org>
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Mark Wright <gienah@gentoo.org>
Diffstat (limited to 'dev-ml/cairo2')
-rw-r--r-- | dev-ml/cairo2/Manifest | 1 | ||||
-rw-r--r-- | dev-ml/cairo2/cairo2-0.6.1.ebuild | 34 | ||||
-rw-r--r-- | dev-ml/cairo2/files/cairo2-0.6.1-handle-safe-string.patch | 50 | ||||
-rw-r--r-- | dev-ml/cairo2/metadata.xml | 11 |
4 files changed, 96 insertions, 0 deletions
diff --git a/dev-ml/cairo2/Manifest b/dev-ml/cairo2/Manifest new file mode 100644 index 000000000000..3be8165a41ce --- /dev/null +++ b/dev-ml/cairo2/Manifest @@ -0,0 +1 @@ +DIST cairo2-0.6.1.tbz 90006 BLAKE2B 78f1a998f821aad9b2a1d2deacffd9290920e6d351e0c66b6cc2a6f4f6140fef67c0dde9c1c317e743b5930e09d68d6c1830beb554d23ac9bcc95738a4091850 SHA512 d09274624854a45cf914ffbe984f1bcdd30db6283e7a0fd73aeec2a19226ff8f68d3f7139bbab72ca5698b58b840d6fd8a35570efc228391a7c5d031421f5c1f diff --git a/dev-ml/cairo2/cairo2-0.6.1.ebuild b/dev-ml/cairo2/cairo2-0.6.1.ebuild new file mode 100644 index 000000000000..9466d8e1db24 --- /dev/null +++ b/dev-ml/cairo2/cairo2-0.6.1.ebuild @@ -0,0 +1,34 @@ +# Copyright 2019-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit dune + +DESCRIPTION="Binding to Cairo, a 2D Vector Graphics Library" +HOMEPAGE="https://github.com/Chris00/ocaml-cairo" +SRC_URI="https://github.com/Chris00/ocaml-cairo/releases/download/${PV}/cairo2-${PV}.tbz" + +LICENSE="LGPL-3" +SLOT="0/${PV}" +KEYWORDS="~amd64 ~x86" +IUSE="+ocamlopt" + +DEPEND=" + x11-libs/cairo:= + dev-ml/dune-configurator:= +" +RDEPEND="${DEPEND} + !dev-ml/ocaml-cairo +" +BDEPEND="" + +# >>> Test phase: dev-ml/cairo2-0.6.1 +# image_create alias tests/runtest (got signal SEGV) +# (cd _build/default/tests && ./image_create.exe) +# DESTROY bigarray 'data' +# Done: 70/72 (jobs: 1) * ERROR: dev-ml/cairo2-0.6.1::x-portage failed (test phase): +RESTRICT=test + +# Fix compiler warnings, from: https://github.com/Chris00/ocaml-cairo/pull/22 +PATCHES=( "${FILESDIR}"/${PN}-0.6.1-handle-safe-string.patch ) diff --git a/dev-ml/cairo2/files/cairo2-0.6.1-handle-safe-string.patch b/dev-ml/cairo2/files/cairo2-0.6.1-handle-safe-string.patch new file mode 100644 index 000000000000..8571da4ea9fe --- /dev/null +++ b/dev-ml/cairo2/files/cairo2-0.6.1-handle-safe-string.patch @@ -0,0 +1,50 @@ +commit 9881f6c861ccf1150fffd6ccdb8b93181ad14263 (HEAD -> const, origin/const) +Author: Olaf Hering <olaf@aepfle.de> +Date: Fri Jul 17 15:47:59 2020 +0200 + + handle safe-string + + String_val() returns 'const char *'. + caml_named_value returns 'const value *'. + + Signed-off-by: Olaf Hering <olaf@aepfle.de> + +diff --git a/src/cairo_macros.h b/src/cairo_macros.h +index d952c10..1348b27 100644 +--- a/src/cairo_macros.h ++++ b/src/cairo_macros.h +@@ -173,7 +173,7 @@ + + /* holds the pointer to the Unavailable exception; shared several + functions. */ +-value * caml_cairo_Unavailable = NULL; ++const value * caml_cairo_Unavailable = NULL; + + #define RAISE_UNAVAILABLE(name, args ...) \ + CAMLexport value caml_##name(args) \ +diff --git a/src/cairo_ocaml_types.h b/src/cairo_ocaml_types.h +index b850ae2..267f657 100644 +--- a/src/cairo_ocaml_types.h ++++ b/src/cairo_ocaml_types.h +@@ -45,7 +45,7 @@ DEFINE_CUSTOM_OPERATIONS(cairo, cairo_destroy, CAIRO_VAL) + /* raise [Error] if the status indicates a failure. */ + void caml_cairo_raise_Error(cairo_status_t status) + { +- static value * exn = NULL; ++ static const value * exn = NULL; + + if (status != CAIRO_STATUS_SUCCESS) { + if (exn == NULL) { +diff --git a/src/cairo_stubs.c b/src/cairo_stubs.c +index de35aca..597c0bf 100644 +--- a/src/cairo_stubs.c ++++ b/src/cairo_stubs.c +@@ -1681,7 +1681,7 @@ static cairo_status_t caml_cairo_output_string + CAMLlocal2(s, r); + + s = caml_alloc_string(length); +- memmove(String_val(s), data, length); ++ memmove(&Byte(String_val(s), 0), data, length); + r = caml_callback_exn(* ((value *) fn), s); + if (Is_exception_result(r)) + CAMLreturn(CAIRO_STATUS_WRITE_ERROR); diff --git a/dev-ml/cairo2/metadata.xml b/dev-ml/cairo2/metadata.xml new file mode 100644 index 000000000000..f3c04171cc2c --- /dev/null +++ b/dev-ml/cairo2/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>gienah@gentoo.org</email> + <name>Mark Wright</name> + </maintainer> + <upstream> + <remote-id type="github">Chris00/ocaml-cairo</remote-id> + </upstream> +</pkgmetadata> |