diff --git a/labltk-8.06.4-remove-ocaml-406-isms.patch b/labltk-8.06.4-remove-ocaml-406-isms.patch new file mode 100644 index 0000000..2800dae --- /dev/null +++ b/labltk-8.06.4-remove-ocaml-406-isms.patch @@ -0,0 +1,94 @@ +diff -ur labltk-8.06.4.old/builtin/rawimg.ml labltk-8.06.4/builtin/rawimg.ml +--- labltk-8.06.4.old/builtin/rawimg.ml 2017-10-30 09:19:07.000000000 +0000 ++++ labltk-8.06.4/builtin/rawimg.ml 2018-04-17 12:31:55.769002974 +0100 +@@ -10,8 +10,6 @@ + pixmap_data: bytes + } + +-let (.![]<-) = Bytes.set +- + type pixel = string (* 3 chars *) + + (* pixmap will be an abstract type *) +@@ -74,9 +72,9 @@ + (* Char.chr does range checking *) + let pixel r g b = + let s = Bytes.create 3 in +- s.![0] <- Char.chr r; +- s.![1] <- Char.chr g; +- s.![2] <- Char.chr b; ++ Bytes.set s 0 (Char.chr r); ++ Bytes.set s 1 (Char.chr g); ++ Bytes.set s 2 (Char.chr b); + Bytes.unsafe_to_string s + + ##ifdef CAMLTK +diff -ur labltk-8.06.4.old/compiler/printer.ml labltk-8.06.4/compiler/printer.ml +--- labltk-8.06.4.old/compiler/printer.ml 2017-10-30 09:19:07.000000000 +0000 ++++ labltk-8.06.4/compiler/printer.ml 2018-04-17 12:31:55.769002974 +0100 +@@ -18,8 +18,6 @@ + + open Format;; + +-let (.![]<-) = Bytes.set ;; +- + let escape_string s = + let more = ref 0 in + for i = 0 to String.length s - 1 do +@@ -33,8 +31,12 @@ + for i = 0 to String.length s - 1 do + let c = s.[i] in + match c with +- | '\\' | '\"' |'\'' -> res.![!j] <- '\\'; incr j; res.![!j] <- c; incr j +- | _ -> res.![!j] <- c; incr j ++ | '\\' | '\"' |'\'' -> ++ Bytes.set res !j '\\'; ++ incr j; ++ Bytes.set res !j c; ++ incr j ++ | _ -> Bytes.set res !j c; incr j + done; + Bytes.to_string res + ;; +diff -ur labltk-8.06.4.old/configure labltk-8.06.4/configure +--- labltk-8.06.4.old/configure 2017-10-30 09:19:07.000000000 +0000 ++++ labltk-8.06.4/configure 2018-04-17 12:51:29.609484064 +0100 +@@ -158,7 +158,7 @@ + has_tk=true + fi + +-cc=`cat $where/Makefile.config | grep '^CC=' | sed -e 's/^CC=//'` ++cc=`cat $where/Makefile.config | grep '^NATIVECC=' | sed -e 's/^NATIVECC=//'` + cclibs=`cat $where/Makefile.config | grep '^NATIVECCLIBS=' | sed -e 's/^NATIVECCLIBS=//'` + export cc cclibs + +diff -ur labltk-8.06.4.old/Makefile labltk-8.06.4/Makefile +--- labltk-8.06.4.old/Makefile 2017-10-30 09:19:07.000000000 +0000 ++++ labltk-8.06.4/Makefile 2018-04-17 13:00:33.216962824 +0100 +@@ -17,7 +17,7 @@ + # Top Makefile for mlTk + + SUBDIRS=compiler support lib jpf frx examples_labltk \ +- examples_camltk browser ++ examples_camltk + SUBDIRS_GENERATED=camltk labltk + include config/Makefile + +@@ -31,7 +31,7 @@ + cd lib; $(MAKE) + cd jpf; $(MAKE) + cd frx; $(MAKE) +- cd browser; $(MAKE) ++# cd browser; $(MAKE) + + allopt: + cd support; $(MAKE) opt +@@ -78,7 +78,7 @@ + cd compiler; $(MAKE) install + cd jpf; $(MAKE) install + cd frx; $(MAKE) install +- cd browser; $(MAKE) install ++# cd browser; $(MAKE) install + if test -f lib/labltk.cmxa; then $(MAKE) installopt; else :; fi + + installopt: diff --git a/ocaml-labltk.spec b/ocaml-labltk.spec index 37cec03..8114758 100644 --- a/ocaml-labltk.spec +++ b/ocaml-labltk.spec @@ -19,6 +19,9 @@ Source0: https://forge.ocamlcore.org/frs/download.php/1727/labltk-8.06.4.t Patch1: labltk-8.06.0-enable-debugging.patch Patch2: labltk-8.06.4-enable-more-debugging.patch +# Remove some OCaml 4.06-isms. +Patch3: labltk-8.06.4-remove-ocaml-406-isms.patch + BuildRequires: ocaml BuildRequires: tcl-devel, tk-devel @@ -46,6 +49,7 @@ This package contains the development files. %patch1 -p1 %patch2 -p1 +%patch3 -p1 # Remove version control files which might get copied into documentation. find -name .gitignore -delete @@ -94,7 +98,7 @@ install -m 0644 camltk/*.o $RPM_BUILD_ROOT%{_libdir}/ocaml/labltk %doc examples_camltk %doc examples_labltk %{_bindir}/labltk -%{_bindir}/ocamlbrowser +#%{_bindir}/ocamlbrowser %{_libdir}/ocaml/labltk/labltktop %{_libdir}/ocaml/labltk/pp %{_libdir}/ocaml/labltk/tkcompiler