From 4caffe42776e463a7cbad6d161cb05a71ed43637 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sat, 18 Sep 2021 21:23:19 +0200 Subject: [PATCH] - added ocaml406 patch from gentoo (fixes String vs Bytes issue) - updated META files location - release 11 --- ocaml-cairo-ocaml406.patch | 20 ++++++++++++++++++ ocaml-cairo.spec | 42 ++++++++++++++++++++++---------------- 2 files changed, 44 insertions(+), 18 deletions(-) create mode 100644 ocaml-cairo-ocaml406.patch diff --git a/ocaml-cairo-ocaml406.patch b/ocaml-cairo-ocaml406.patch new file mode 100644 index 0000000..2ef9931 --- /dev/null +++ b/ocaml-cairo-ocaml406.patch @@ -0,0 +1,20 @@ +Index: cairo-ocaml-1.2.0/src/cairo_png.ml +=================================================================== +--- cairo-ocaml-1.2.0.orig/src/cairo_png.ml ++++ cairo-ocaml-1.2.0/src/cairo_png.ml +@@ -7,13 +7,13 @@ + (**************************************************************************) + + external image_surface_create_from_stream_unsafe : +- (string -> int -> unit) -> Cairo.image_surface = "ml_cairo_image_surface_create_from_png_stream_unsafe" ++ (bytes -> int -> unit) -> Cairo.image_surface = "ml_cairo_image_surface_create_from_png_stream_unsafe" + + let image_surface_create_from_channel ic = + image_surface_create_from_stream_unsafe + (fun s n -> + for i = 0 to n - 1 do +- String.unsafe_set s i (input_char ic) ++ Bytes.unsafe_set s i (input_char ic) + done) + + let image_surface_create_from_file fname = diff --git a/ocaml-cairo.spec b/ocaml-cairo.spec index 5878f70..30fc157 100644 --- a/ocaml-cairo.spec +++ b/ocaml-cairo.spec @@ -1,9 +1,9 @@ # # Conditional build: -%bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built) +%bcond_without ocaml_opt # native optimized binaries (bytecode is always built) # not yet available on x32 (ocaml 4.02.1), update when upstream will support it -%ifnarch %{ix86} %{x8664} arm aarch64 ppc sparc sparcv9 +%ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9 %undefine with_ocaml_opt %endif @@ -11,13 +11,15 @@ Summary: Cairo binding for OCaml Summary(pl.UTF-8): Wiązania Cairo dla OCamla Name: ocaml-cairo Version: 1.2.0 -Release: 10 +Release: 11 License: LGPL v2.1 Group: Libraries #Source0Download: http://cgit.freedesktop.org/cairo-ocaml/ Source0: http://cgit.freedesktop.org/cairo-ocaml/snapshot/cairo-ocaml-%{version}.tar.bz2 # Source0-md5: 5d0096328f210a6ed032fec68e1bc141 Patch0: %{name}-install.patch +# https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-ml/cairo-ocaml/files/ocaml406.patch?id=05cb735234f0cb37b593d8cabf893bc4a8452cde +Patch1: %{name}-ocaml406.patch URL: http://cairographics.org/cairo-ocaml/ BuildRequires: autoconf >= 2.50 BuildRequires: automake @@ -59,6 +61,7 @@ biblioteki Cairo. %prep %setup -q -n cairo-ocaml-%{version} %patch0 -p1 +%patch1 -p1 %build %{__aclocal} -I support @@ -79,8 +82,7 @@ install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} cp -r test/{Makefile,*.ml} $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/cairo -cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/cairo/META < $RPM_BUILD_ROOT%{_libdir}/ocaml/cairo/META < $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/cairo-lablgtk/META < $RPM_BUILD_ROOT%{_libdir}/ocaml/cairo-lablgtk/META < $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/pangocairo/META < $RPM_BUILD_ROOT%{_libdir}/ocaml/pangocairo/META < $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/svgcairo/META < $RPM_BUILD_ROOT%{_libdir}/ocaml/svgcairo/META <