[packages/ocaml-ulex] - added fix-bytes patch from Fedora, updated META file location; release 6

qboosh qboosh at pld-linux.org
Fri Nov 26 21:48:44 CET 2021


commit e5594bbe303e11f547cfe96f85c174d4c970984a
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Nov 26 21:49:05 2021 +0100

    - added fix-bytes patch from Fedora, updated META file location; release 6

 ocaml-ulex-fix-bytes.patch | 18 ++++++++++++++++++
 ocaml-ulex.spec            | 30 +++++++++++++-----------------
 2 files changed, 31 insertions(+), 17 deletions(-)
---
diff --git a/ocaml-ulex.spec b/ocaml-ulex.spec
index 6575e1a..31d6a10 100644
--- a/ocaml-ulex.spec
+++ b/ocaml-ulex.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), remove when upstream will support it
-%ifnarch %{ix86} %{x8664} arm aarch64 ppc sparc sparcv9
+# not yet available on x32 (ocaml 4.02.1), update when upstream will support it
+%ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9
 %undefine	with_ocaml_opt
 %endif
 
@@ -11,12 +11,14 @@ Summary:	Lexer generator for Unicode and OCaml
 Summary(pl.UTF-8):	Lexer dla OCamla i Unicode
 Name:		ocaml-ulex
 Version:	1.1
-Release:	5
+Release:	6
 License:	MIT
 Group:		Development/Tools
 Source0:	http://www.cduce.org/download/ulex-%{version}.tar.gz
 # Source0-md5:	ce49a013bc4a0e085977a9fe157017bf
-BuildRequires:	ocaml >= 3.09.0
+Patch0:		%{name}-fix-bytes.patch
+URL:		http://www.cduce.org/ulex/
+BuildRequires:	ocaml >= 1:3.10.0
 BuildRequires:	ocaml-findlib-devel
 %requires_eq	ocaml-runtime
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -29,9 +31,10 @@ ulex jest lexerem dla OCamla i Unicode.
 
 %prep
 %setup -q -n ulex-%{version}
+%patch0 -p1
 
 %build
-%{__make} -j1 all %{?with_ocaml_opt:all.opt} \
+%{__make} -j1 all %{?with_ocaml_opt:all.opt}
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -40,27 +43,20 @@ install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/ulex
 %{__make} install \
 	OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
 
-# move to dir pld ocamlfind looks
-install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/ulex
-mv $RPM_BUILD_ROOT%{_libdir}/ocaml/ulex/META \
-	$RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/ulex
-cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/ulex/META
-directory="+ulex"
-EOF
-
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc README
+%doc CHANGES LICENSE README
 %dir %{_libdir}/ocaml/ulex
+%{_libdir}/ocaml/ulex/META
 %{_libdir}/ocaml/ulex/*.cma
-%{_libdir}/ocaml/ulex/*.cm[xi]
+%{_libdir}/ocaml/ulex/*.cmi
 %if %{with ocaml_opt}
 %{_libdir}/ocaml/ulex/ulexing.a
+%{_libdir}/ocaml/ulex/*.cmx
 %{_libdir}/ocaml/ulex/*.cmxa
 %endif
 %{_libdir}/ocaml/ulex/ulexing.mli
 %{_libdir}/ocaml/ulex/utf8.mli
-%{_libdir}/ocaml/site-lib/ulex
diff --git a/ocaml-ulex-fix-bytes.patch b/ocaml-ulex-fix-bytes.patch
new file mode 100644
index 0000000..7041506
--- /dev/null
+++ b/ocaml-ulex-fix-bytes.patch
@@ -0,0 +1,18 @@
+diff -ur ulex-1.1.old/ulexing.mli ulex-1.1/ulexing.mli
+--- ulex-1.1.old/ulexing.mli	2008-04-18 13:42:18.000000000 +0100
++++ ulex-1.1/ulexing.mli	2017-11-08 22:24:38.727320352 +0000
+@@ -142,12 +142,12 @@
+   matched by the regular expression as an array of Unicode code point. *)
+ 
+ 
+-val latin1_lexeme: lexbuf -> string
++val latin1_lexeme: lexbuf -> bytes
+ (** As [Ulexing.lexeme] with a result encoded in Latin1.
+   This function throws an exception [InvalidCodepoint] if it is not possible
+   to encode the result in Latin1. *)
+ 
+-val latin1_sub_lexeme: lexbuf -> int -> int -> string
++val latin1_sub_lexeme: lexbuf -> int -> int -> bytes
+ (** As [Ulexing.sub_lexeme] with a result encoded in Latin1.
+   This function throws an exception [InvalidCodepoint] if it is not possible
+   to encode the result in Latin1. *)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ocaml-ulex.git/commitdiff/e5594bbe303e11f547cfe96f85c174d4c970984a



More information about the pld-cvs-commit mailing list