diff -Nru ocaml-cairo2-0.6.1+dfsg/cairo2-gtk.opam ocaml-cairo2-0.6.2+dfsg/cairo2-gtk.opam --- ocaml-cairo2-0.6.1+dfsg/cairo2-gtk.opam 2019-03-25 23:10:18.000000000 +0000 +++ ocaml-cairo2-0.6.2+dfsg/cairo2-gtk.opam 2020-11-25 10:41:22.000000000 +0000 @@ -2,7 +2,7 @@ maintainer: "Christophe Troestler " authors: [ "Christophe Troestler " "Pierre Hauweele " ] -license: "LGPL-3.0 with OCaml linking exception" +license: "LGPL-3.0" homepage: "https://github.com/Chris00/ocaml-cairo" dev-repo: "git+https://github.com/Chris00/ocaml-cairo.git" bug-reports: "https://github.com/Chris00/ocaml-cairo/issues" @@ -16,7 +16,7 @@ depends: [ "ocaml" {>= "4.02"} "base-bigarray" - "dune" {build} + "dune" "conf-pkg-config" {build} "conf-cairo" "cairo2" {= version} diff -Nru ocaml-cairo2-0.6.1+dfsg/cairo2.opam ocaml-cairo2-0.6.2+dfsg/cairo2.opam --- ocaml-cairo2-0.6.1+dfsg/cairo2.opam 2019-03-25 23:10:18.000000000 +0000 +++ ocaml-cairo2-0.6.2+dfsg/cairo2.opam 2020-11-25 10:41:22.000000000 +0000 @@ -2,7 +2,7 @@ maintainer: "Christophe Troestler " authors: [ "Christophe Troestler " "Pierre Hauweele " ] -license: "LGPL-3.0 with OCaml linking exception" +license: "LGPL-3.0" homepage: "https://github.com/Chris00/ocaml-cairo" dev-repo: "git+https://github.com/Chris00/ocaml-cairo.git" bug-reports: "https://github.com/Chris00/ocaml-cairo/issues" @@ -17,7 +17,8 @@ depends: [ "ocaml" {>= "4.02"} "base-bigarray" - "dune" {build} + "dune" + "dune-configurator" "conf-cairo" ] depopts: [ diff -Nru ocaml-cairo2-0.6.1+dfsg/cairo2-pango.opam ocaml-cairo2-0.6.2+dfsg/cairo2-pango.opam --- ocaml-cairo2-0.6.1+dfsg/cairo2-pango.opam 2019-03-25 23:10:18.000000000 +0000 +++ ocaml-cairo2-0.6.2+dfsg/cairo2-pango.opam 2020-11-25 10:41:22.000000000 +0000 @@ -2,7 +2,7 @@ maintainer: "Christophe Troestler " authors: [ "Christophe Troestler " "Pierre Hauweele " ] -license: "LGPL-3.0 with OCaml linking exception" +license: "LGPL-3.0" homepage: "https://github.com/Chris00/ocaml-cairo" dev-repo: "git+https://github.com/Chris00/ocaml-cairo.git" bug-reports: "https://github.com/Chris00/ocaml-cairo/issues" @@ -16,7 +16,7 @@ depends: [ "ocaml" {>= "4.02"} "base-bigarray" - "dune" {build} + "dune" "conf-pkg-config" {build} "conf-cairo" "cairo2" {= version} diff -Nru ocaml-cairo2-0.6.1+dfsg/CHANGES.md ocaml-cairo2-0.6.2+dfsg/CHANGES.md --- ocaml-cairo2-0.6.1+dfsg/CHANGES.md 2019-03-25 23:10:18.000000000 +0000 +++ ocaml-cairo2-0.6.2+dfsg/CHANGES.md 2020-11-25 10:41:22.000000000 +0000 @@ -1,3 +1,11 @@ +0.6.2 2020-11-23 +---------------- + +- Fix a memory leak (#19). +- Fix GCC warnings, in particular the “multiple definition of …” (#23). +- Clarify the license. +- Use `dune-configurator`. + 0.6.1 2019-03-20 ---------------- diff -Nru ocaml-cairo2-0.6.1+dfsg/config/dune ocaml-cairo2-0.6.2+dfsg/config/dune --- ocaml-cairo2-0.6.1+dfsg/config/dune 2019-03-25 23:10:18.000000000 +0000 +++ ocaml-cairo2-0.6.2+dfsg/config/dune 2020-11-25 10:41:22.000000000 +0000 @@ -2,4 +2,4 @@ (executable (name discover) (modules discover) - (libraries dune.configurator str)) + (libraries dune-configurator str)) diff -Nru ocaml-cairo2-0.6.1+dfsg/debian/changelog ocaml-cairo2-0.6.2+dfsg/debian/changelog --- ocaml-cairo2-0.6.1+dfsg/debian/changelog 2020-11-02 13:08:38.000000000 +0000 +++ ocaml-cairo2-0.6.2+dfsg/debian/changelog 2021-02-01 19:46:56.000000000 +0000 @@ -1,8 +1,12 @@ -ocaml-cairo2 (0.6.1+dfsg-6build1) hirsute; urgency=medium +ocaml-cairo2 (0.6.2+dfsg-1) unstable; urgency=medium - * No-change rebuild for ocaml abi changes. + * Team upload. + * New minor upstream release (which fixes a memory leak) + - Drop patch 0002-Fix-multiple-definitions-of-variables.patch, merged + upstream + - Drop patch 0003-Fix-FTBFS-with-OCaml-4.11.1.patch, fixed upstream - -- Matthias Klose Mon, 02 Nov 2020 14:08:38 +0100 + -- Mehdi Dogguy Mon, 01 Feb 2021 20:46:56 +0100 ocaml-cairo2 (0.6.1+dfsg-6) unstable; urgency=medium @@ -57,4 +61,3 @@ * Initial packaging (closes: #929313) -- Ralf Treinen Thu, 06 Jun 2019 09:23:06 +0200 - diff -Nru ocaml-cairo2-0.6.1+dfsg/debian/patches/0002-Fix-multiple-definitions-of-variables.patch ocaml-cairo2-0.6.2+dfsg/debian/patches/0002-Fix-multiple-definitions-of-variables.patch --- ocaml-cairo2-0.6.1+dfsg/debian/patches/0002-Fix-multiple-definitions-of-variables.patch 2020-10-13 10:30:03.000000000 +0000 +++ ocaml-cairo2-0.6.2+dfsg/debian/patches/0002-Fix-multiple-definitions-of-variables.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,102 +0,0 @@ -From: Stephane Glondu -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 - - #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 -Nru ocaml-cairo2-0.6.1+dfsg/debian/patches/0003-Fix-FTBFS-with-OCaml-4.11.1.patch ocaml-cairo2-0.6.2+dfsg/debian/patches/0003-Fix-FTBFS-with-OCaml-4.11.1.patch --- ocaml-cairo2-0.6.1+dfsg/debian/patches/0003-Fix-FTBFS-with-OCaml-4.11.1.patch 2020-10-13 10:30:03.000000000 +0000 +++ ocaml-cairo2-0.6.2+dfsg/debian/patches/0003-Fix-FTBFS-with-OCaml-4.11.1.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -From: Stephane Glondu -Date: Tue, 13 Oct 2020 12:28:47 +0200 -Subject: Fix FTBFS with OCaml 4.11.1 - ---- - src/cairo_stubs.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/cairo_stubs.c b/src/cairo_stubs.c -index de35aca..1dc782a 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(Bytes_val(s), data, length); - r = caml_callback_exn(* ((value *) fn), s); - if (Is_exception_result(r)) - CAMLreturn(CAIRO_STATUS_WRITE_ERROR); diff -Nru ocaml-cairo2-0.6.1+dfsg/debian/patches/series ocaml-cairo2-0.6.2+dfsg/debian/patches/series --- ocaml-cairo2-0.6.1+dfsg/debian/patches/series 2020-10-13 10:30:03.000000000 +0000 +++ ocaml-cairo2-0.6.2+dfsg/debian/patches/series 2021-02-01 19:42:11.000000000 +0000 @@ -1,3 +1 @@ ignore-gtk-and-pango -0002-Fix-multiple-definitions-of-variables.patch -0003-Fix-FTBFS-with-OCaml-4.11.1.patch diff -Nru ocaml-cairo2-0.6.1+dfsg/dune-project ocaml-cairo2-0.6.2+dfsg/dune-project --- ocaml-cairo2-0.6.1+dfsg/dune-project 2019-03-25 23:10:18.000000000 +0000 +++ ocaml-cairo2-0.6.2+dfsg/dune-project 2020-11-25 10:41:22.000000000 +0000 @@ -1,3 +1,3 @@ -(lang dune 1.1) +(lang dune 1.0) (name cairo2) diff -Nru ocaml-cairo2-0.6.1+dfsg/src/cairo_macros.h ocaml-cairo2-0.6.2+dfsg/src/cairo_macros.h --- ocaml-cairo2-0.6.1+dfsg/src/cairo_macros.h 2019-03-25 23:10:18.000000000 +0000 +++ ocaml-cairo2-0.6.2+dfsg/src/cairo_macros.h 2020-11-25 10:41:22.000000000 +0000 @@ -173,7 +173,7 @@ /* holds the pointer to the Unavailable exception; shared several functions. */ -value * caml_cairo_Unavailable = NULL; +const value * caml_cairo_Unavailable; #define RAISE_UNAVAILABLE(name, args ...) \ CAMLexport value caml_##name(args) \ diff -Nru ocaml-cairo2-0.6.1+dfsg/src/cairo_ocaml.h.p ocaml-cairo2-0.6.2+dfsg/src/cairo_ocaml.h.p --- ocaml-cairo2-0.6.1+dfsg/src/cairo_ocaml.h.p 2019-03-25 23:10:18.000000000 +0000 +++ ocaml-cairo2-0.6.2+dfsg/src/cairo_ocaml.h.p 2020-11-25 10:41:22.000000000 +0000 @@ -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 @@ /* 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 @@ ***********************************************************************/ #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 @@ ***********************************************************************/ #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 @@ ***********************************************************************/ #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 @@ #include #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 -Nru ocaml-cairo2-0.6.1+dfsg/src/cairo_ocaml_types.h ocaml-cairo2-0.6.2+dfsg/src/cairo_ocaml_types.h --- ocaml-cairo2-0.6.1+dfsg/src/cairo_ocaml_types.h 2019-03-25 23:10:18.000000000 +0000 +++ ocaml-cairo2-0.6.2+dfsg/src/cairo_ocaml_types.h 2020-11-25 10:41:22.000000000 +0000 @@ -45,7 +45,7 @@ /* 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) { @@ -275,8 +275,8 @@ custom_serialize_default, custom_deserialize_default }; +value caml_cairo_font_type[5]; -/* caml_cairo_font_type is defined in "cairo_ocaml.h". */ CAMLexport value caml_cairo_font_type_init(value unit) { /* noalloc */ diff -Nru ocaml-cairo2-0.6.1+dfsg/src/cairo_stubs.c ocaml-cairo2-0.6.2+dfsg/src/cairo_stubs.c --- ocaml-cairo2-0.6.1+dfsg/src/cairo_stubs.c 2019-03-25 23:10:18.000000000 +0000 +++ ocaml-cairo2-0.6.2+dfsg/src/cairo_stubs.c 2020-11-25 10:41:22.000000000 +0000 @@ -1494,7 +1494,7 @@ /* Adapted from caml_ba_finalize in the OCaml library sources. */ if (-- proxy->refcount == 0) { free(proxy->data); - caml_stat_free(proxy); + free(proxy); } #undef proxy } @@ -1573,13 +1573,14 @@ if (proxy == NULL) return(CAIRO_STATUS_NO_MEMORY); proxy->refcount = 2; /* original array + surface */ proxy->data = b->data; - proxy->size = 0; /* CAML_BA_MANAGED_MASK excluded by the calling fun */ + proxy->size = 0; /* CAML_BA_MAPPED_FILE excluded by the calling fun */ b->proxy = proxy; } return cairo_surface_set_user_data(surf, &image_bigarray_key, b->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 @@ 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 @@ 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) \ @@ -1681,7 +1682,7 @@ CAMLlocal2(s, r); s = caml_alloc_string(length); - memmove(String_val(s), data, length); + memmove((char *) String_val(s), data, length); r = caml_callback_exn(* ((value *) fn), s); if (Is_exception_result(r)) CAMLreturn(CAIRO_STATUS_WRITE_ERROR); diff -Nru ocaml-cairo2-0.6.1+dfsg/tests/image_create.ml ocaml-cairo2-0.6.2+dfsg/tests/image_create.ml --- ocaml-cairo2-0.6.1+dfsg/tests/image_create.ml 2019-03-25 23:10:18.000000000 +0000 +++ ocaml-cairo2-0.6.2+dfsg/tests/image_create.ml 2020-11-25 10:41:22.000000000 +0000 @@ -10,6 +10,7 @@ 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 @@ 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()