summaryrefslogtreecommitdiff
path: root/dev-ml/cairo2
diff options
context:
space:
mode:
Diffstat (limited to 'dev-ml/cairo2')
-rw-r--r--dev-ml/cairo2/Manifest6
-rw-r--r--dev-ml/cairo2/cairo2-0.6.1.ebuild39
-rw-r--r--dev-ml/cairo2/files/cairo2-0.6.1-Fix-multiple-definitions-of-variables.patch102
-rw-r--r--dev-ml/cairo2/files/cairo2-0.6.1-handle-safe-string.patch50
-rw-r--r--dev-ml/cairo2/files/cairo2-0.6.1-ignore-gtk-and-pango.patch82
-rw-r--r--dev-ml/cairo2/metadata.xml11
6 files changed, 290 insertions, 0 deletions
diff --git a/dev-ml/cairo2/Manifest b/dev-ml/cairo2/Manifest
new file mode 100644
index 000000000000..060d1efd8a1b
--- /dev/null
+++ b/dev-ml/cairo2/Manifest
@@ -0,0 +1,6 @@
+AUX cairo2-0.6.1-Fix-multiple-definitions-of-variables.patch 3920 BLAKE2B bb15a067dda446dffa1d43c7728216a4e2085d5f91553f133a096f497fec8c4474b2e26e06cd45a0217c7113caec4f82d2a55900d8e5f5889610e2b78a3294d3 SHA512 8f6695853529bbc8b442c6a825d9b7c2476b219ac4e5ac1c9af250ba385102c6258eff12475116d12be6de60ae6916b0e8044180ded28c9a3462be0fceee7148
+AUX cairo2-0.6.1-handle-safe-string.patch 1743 BLAKE2B 75c805c3db2b0ea7eb9a5fe8b6cb2732b89b800f17a84818d576a4f0c9dad32502f76b24ef51d7cf5fdfbc0b02bc4673fbae4e652c6e93e6c10aa5e831b6347f SHA512 75554a9405d9f9c66b9091e3f7f351af63f059eb7db37526d54c348116c5093fd391cda7e8320e314f8035645ccbd1b4160c5e74c847192bb393942cb02dcf70
+AUX cairo2-0.6.1-ignore-gtk-and-pango.patch 2168 BLAKE2B f444c6056af8708bd4dd838fab54390b12ae6f00002ea885111eca37d3f0469acb8fac38bffe235436f2b20020178a6310cf5baa9bc27cbca6d4f29e1ac463d9 SHA512 6443a64189113add46c5a1ec9eebd13c513d314b512db31ee4d025e3653711e4295a0819d31d5ed7f793921f8a6d53a3576982bb422e331745877265dce828bb
+DIST cairo2-0.6.1.tbz 90006 BLAKE2B 78f1a998f821aad9b2a1d2deacffd9290920e6d351e0c66b6cc2a6f4f6140fef67c0dde9c1c317e743b5930e09d68d6c1830beb554d23ac9bcc95738a4091850 SHA512 d09274624854a45cf914ffbe984f1bcdd30db6283e7a0fd73aeec2a19226ff8f68d3f7139bbab72ca5698b58b840d6fd8a35570efc228391a7c5d031421f5c1f
+EBUILD cairo2-0.6.1.ebuild 1142 BLAKE2B df968dbc173504e455cff04f29846e9fa108a3348dee3661d4e650dbb90d38c76f4b9b67272f70bd5d2feb29f416b614bd9594033678a754fed06ccaa2ba7ed0 SHA512 288e613137cf60be1da2851ac355479d1157d87e57b13e1ae3301411c8faee3acc7b42191708f77ccfd97934a1522a5601281c6c88fb3c36658353c692ced799
+MISC metadata.xml 328 BLAKE2B b0bd0dcd9ee412736d22a1d0390433ff61b851cbd7a9fa6e62dd59b3c6d70fcd5d85f13202c1308ce46d2e610edc9a4bc3e86518f0f1e2490ee4e70bf732da84 SHA512 49a293f3cd7d644237aef8cd9efd7b4d37fdbaf8fc9191e275426e25c1ced5b7eb87167deaad09c675b3797706747af5f32f6cb153891e2d27bd4ace85effcc3
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..3ad21d694225
--- /dev/null
+++ b/dev-ml/cairo2/cairo2-0.6.1.ebuild
@@ -0,0 +1,39 @@
+# 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 ~arm ~arm64 ~ppc ~ppc64 ~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
+
+# Remove lablgtk2 dep https://github.com/Chris00/ocaml-cairo/issues/21
+# Fix compiler warnings, from: https://github.com/Chris00/ocaml-cairo/pull/22
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.6.1-ignore-gtk-and-pango.patch
+ "${FILESDIR}"/${PN}-0.6.1-handle-safe-string.patch
+ "${FILESDIR}"/${PN}-0.6.1-Fix-multiple-definitions-of-variables.patch
+)
diff --git a/dev-ml/cairo2/files/cairo2-0.6.1-Fix-multiple-definitions-of-variables.patch b/dev-ml/cairo2/files/cairo2-0.6.1-Fix-multiple-definitions-of-variables.patch
new file mode 100644
index 000000000000..4f0eed297363
--- /dev/null
+++ b/dev-ml/cairo2/files/cairo2-0.6.1-Fix-multiple-definitions-of-variables.patch
@@ -0,0 +1,102 @@
+From: Stephane Glondu <steph@glondu.net>
+Date: Sat, 15 Aug 2020 09:08:30 +0200
+Subject: Fix multiple definitions of variables
+
+Bug-Debian: https://bugs.debian.org/968427
+Bug: https://github.com/Chris00/ocaml-cairo/issues/23
+Forwarded: https://github.com/Chris00/ocaml-cairo/issues/23
+---
+ src/cairo_ocaml.h.p | 18 +++++++++---------
+ src/cairo_ocaml_types.h | 4 +++-
+ 2 files changed, 12 insertions(+), 10 deletions(-)
+
+diff --git a/src/cairo_ocaml.h.p b/src/cairo_ocaml.h.p
+index 4192aed..1f05664 100644
+--- a/src/cairo_ocaml.h.p
++++ b/src/cairo_ocaml.h.p
+@@ -25,7 +25,7 @@
+ /* cairo_t
+ ***********************************************************************/
+ #define CAIRO_VAL(v) (* (cairo_t **) Data_custom_val(v))
+-struct custom_operations caml_cairo_ops;
++extern struct custom_operations caml_cairo_ops;
+
+ void caml_cairo_raise_Error(cairo_status_t status);
+ /* raise [Cairo.Error] if the status indicates a failure. */
+@@ -33,7 +33,7 @@ void caml_cairo_raise_Error(cairo_status_t status);
+ /* cairo_pattern_t
+ ***********************************************************************/
+ #define PATTERN_VAL(v) (* (cairo_pattern_t **) Data_custom_val(v))
+-struct custom_operations caml_pattern_ops;
++extern struct custom_operations caml_pattern_ops;
+
+ #define EXTEND_VAL(v) ((cairo_extend_t) Int_val(v))
+ #define VAL_EXTEND(v) Val_int(v)
+@@ -45,12 +45,12 @@ struct custom_operations caml_pattern_ops;
+ ***********************************************************************/
+
+ #define FONT_OPTIONS_VAL(v) (* (cairo_font_options_t**) Data_custom_val(v))
+-struct custom_operations caml_font_options_ops;
++extern struct custom_operations caml_font_options_ops;
+
+ /* cairo_font_type_t
+ ***********************************************************************/
+
+-value caml_cairo_font_type[5];
++extern value caml_cairo_font_type[5];
+
+ cairo_font_type_t caml_cairo_font_type_val(value vft);
+
+@@ -61,13 +61,13 @@ cairo_font_type_t caml_cairo_font_type_val(value vft);
+ ***********************************************************************/
+
+ #define SCALED_FONT_VAL(v) (* (cairo_scaled_font_t**) Data_custom_val(v))
+-struct custom_operations caml_scaled_font_ops;
++extern struct custom_operations caml_scaled_font_ops;
+
+ /* cairo_surface_t
+ ***********************************************************************/
+
+ #define SURFACE_VAL(v) (* (cairo_surface_t **) Data_custom_val(v))
+-struct custom_operations caml_surface_ops;
++extern struct custom_operations caml_surface_ops;
+
+ /* Type cairo_content_t */
+
+@@ -93,7 +93,7 @@ struct custom_operations caml_surface_ops;
+ ***********************************************************************/
+
+ #define PATH_VAL(v) (* (cairo_path_t **) Data_custom_val(v))
+-struct custom_operations caml_path_ops;
++extern struct custom_operations caml_path_ops;
+
+ #define PATH_DATA_ASSIGN(vdata, data) \
+ switch (data->header.type) { \
+@@ -151,10 +151,10 @@ struct custom_operations caml_path_ops;
+ #include <cairo-ft.h>
+
+ #define FT_LIBRARY_VAL(v) (* (FT_Library*) Data_custom_val(v))
+-struct custom_operations caml_cairo_ft_library_ops;
++extern struct custom_operations caml_cairo_ft_library_ops;
+
+ #define FT_FACE_VAL(v) (* (FT_Face*) Data_custom_val(v))
+-struct custom_operations caml_cairo_ft_face_ops;
++extern struct custom_operations caml_cairo_ft_face_ops;
+
+ #endif /* OCAML_CAIRO_HAS_FT */
+
+diff --git a/src/cairo_ocaml_types.h b/src/cairo_ocaml_types.h
+index b850ae2..84dde3d 100644
+--- a/src/cairo_ocaml_types.h
++++ b/src/cairo_ocaml_types.h
+@@ -276,7 +276,9 @@ struct custom_operations caml_font_options_ops = {
+ custom_deserialize_default };
+
+
+-/* caml_cairo_font_type is defined in "cairo_ocaml.h". */
++/* caml_cairo_font_type is exported in "cairo_ocaml.h". */
++value caml_cairo_font_type[5];
++
+ CAMLexport value caml_cairo_font_type_init(value unit)
+ {
+ /* noalloc */
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/files/cairo2-0.6.1-ignore-gtk-and-pango.patch b/dev-ml/cairo2/files/cairo2-0.6.1-ignore-gtk-and-pango.patch
new file mode 100644
index 000000000000..90fc00f1ddcf
--- /dev/null
+++ b/dev-ml/cairo2/files/cairo2-0.6.1-ignore-gtk-and-pango.patch
@@ -0,0 +1,82 @@
+From: Debian OCaml Maintainers <debian-ocaml-maint@lists.debian.org>
+Date: Sat, 15 Aug 2020 08:56:03 +0200
+Subject: ignore-gtk-and-pango
+
+===================================================================
+---
+ examples-gtk/dune | 8 --------
+ examples-pango/dune | 8 --------
+ gtk/dune | 13 -------------
+ pango/dune | 13 -------------
+ 4 files changed, 42 deletions(-)
+ delete mode 100644 examples-gtk/dune
+ delete mode 100644 examples-pango/dune
+ delete mode 100644 gtk/dune
+ delete mode 100644 pango/dune
+
+diff --git a/examples-gtk/dune b/examples-gtk/dune
+deleted file mode 100644
+index 10d8fcb..0000000
+--- a/examples-gtk/dune
++++ /dev/null
+@@ -1,8 +0,0 @@
+-
+-(executables
+- (names gtk_demo)
+-(libraries cairo2-gtk))
+-
+-(alias
+- (name examples)
+- (deps gtk_demo.exe))
+diff --git a/examples-pango/dune b/examples-pango/dune
+deleted file mode 100644
+index c8ae49e..0000000
+--- a/examples-pango/dune
++++ /dev/null
+@@ -1,8 +0,0 @@
+-
+-(executables
+- (names pango_demo rendering)
+- (libraries cairo2-pango))
+-
+-(alias
+- (name examples)
+- (deps pango_demo.exe rendering.exe))
+diff --git a/gtk/dune b/gtk/dune
+deleted file mode 100644
+index 6ef367e..0000000
+--- a/gtk/dune
++++ /dev/null
+@@ -1,13 +0,0 @@
+-
+-(library
+- (name cairo_gtk)
+- (public_name cairo2-gtk)
+- (c_names cairo_gtk_stubs)
+- (c_flags :standard (:include c_flags.sexp))
+- (c_library_flags :standard (:include c_library_flags.sexp))
+- (libraries threads lablgtk2 cairo2)
+- (synopsis "Rendering Cairo on Gtk canvas"))
+-
+-(rule
+- (targets c_flags.sexp c_library_flags.sexp)
+- (action (run ../config/discover.exe --gtk)))
+diff --git a/pango/dune b/pango/dune
+deleted file mode 100644
+index 816cc49..0000000
+--- a/pango/dune
++++ /dev/null
+@@ -1,13 +0,0 @@
+-
+-(library
+- (name cairo_pango)
+- (public_name cairo2-pango)
+- (c_names cairo_pango_stubs)
+- (c_flags :standard (:include c_flags.sexp))
+- (c_library_flags :standard (:include c_library_flags.sexp))
+- (libraries threads lablgtk2 cairo2)
+- (synopsis "Interface between Cairo and Pango"))
+-
+-(rule
+- (targets c_flags.sexp c_library_flags.sexp)
+- (action (run ../config/discover.exe --gtk)))
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>