Include all upstream pre-7.12 patches.

Fixes support for OCaml 4.11.
This commit is contained in:
Richard W.M. Jones 2020-05-04 17:13:38 +01:00
parent 3a8d4d777e
commit 9b92758266
11 changed files with 4662 additions and 16 deletions

View File

@ -0,0 +1,75 @@
From 46067702024061c693fc034bfedf1fce4313c4ce Mon Sep 17 00:00:00 2001
From: Chet Murthy <chetsky@gmail.com>
Date: Tue, 24 Mar 2020 20:06:53 -0700
Subject: [PATCH 01/10] added etc/topfind.camlp5"
---
Makefile | 2 ++
etc/topfind.camlp5 | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+)
create mode 100644 etc/topfind.camlp5
diff --git a/Makefile b/Makefile
index f6811269..12c69b70 100644
--- a/Makefile
+++ b/Makefile
@@ -57,6 +57,7 @@ install:
for i in $(DIRS) compile; do \
(cd $$i; $(MAKE) install DESTDIR=$(DESTDIR); cd ..); \
done
+ cp etc/topfind.camlp5 "$(DESTDIR)$(LIBDIR)/$(OCAMLN)/."
uninstall:
@if test -z "$(LIBDIR)"; then \
@@ -66,6 +67,7 @@ uninstall:
$(RM) -rf "$(DESTDIR)$(LIBDIR)/$(CAMLP5N)"
cd "$(DESTDIR)$(BINDIR)"; $(RM) -f *$(CAMLP5N)* odyl ocpp; cd ..
cd "$(DESTDIR)$(MANDIR)/man1"; $(RM) -f *$(CAMLP5N)* odyl ocpp
+ $(RM) -f "$(DESTDIR)$(LIBDIR)/$(OCAMLN)/"topfind.camlp5
clean::
$(MAKE) clean_hot clean_cold
diff --git a/etc/topfind.camlp5 b/etc/topfind.camlp5
new file mode 100644
index 00000000..5a260beb
--- /dev/null
+++ b/etc/topfind.camlp5
@@ -0,0 +1,35 @@
+#use "topfind";;
+
+(* Add "#camlp5o" directive: *)
+
+let _ =
+Hashtbl.add
+ Toploop.directive_table
+ "camlp5o"
+ (Toploop.Directive_none
+ Topfind.(fun () ->
+ (*protect*) (fun () ->
+ syntax "camlp5o" ;
+ load_deeply ["camlp5"]) ()
+ )) ;
+
+
+(* Add "#camlp4r" directive: *)
+
+Hashtbl.add
+ Toploop.directive_table
+ "camlp5r"
+ (Toploop.Directive_none
+ Topfind.(fun () ->
+ (*protect*) (fun () ->
+ syntax "camlp5r";
+ load_deeply ["camlp5"]) ()
+ )) ;
+
+
+print_endline
+ ("Additional Camlp5 directives:\n" ^
+ " #camlp5o;; to load camlp5 (standard syntax)\n" ^
+ " #camlp5r;; to load camlp5 (revised syntax)\n" ^
+ "")
+;;
--
2.24.1

View File

@ -0,0 +1,28 @@
From 3967bad790cc9d886a5a4cfa5f2e4183ddf383d3 Mon Sep 17 00:00:00 2001
From: Chet Murthy <chetsky@gmail.com>
Date: Tue, 24 Mar 2020 20:14:38 -0700
Subject: [PATCH 02/10] fix raw-string lexing bug
---
lib/plexer.ml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/plexer.ml b/lib/plexer.ml
index 2b179c34..591cc1e6 100644
--- a/lib/plexer.ml
+++ b/lib/plexer.ml
@@ -391,7 +391,10 @@ value rec rawstring1 (ofs, delim) ctx buf =
ctx.line_cnt bp c;
let buf = $add c in
if String.get delim ofs <> c then
- rawstring1 (0, delim) ctx buf strm
+ if String.get delim 0 = c then
+ rawstring1 (1, delim) ctx buf strm
+ else
+ rawstring1 (0, delim) ctx buf strm
else if ofs+1 < String.length delim then
rawstring1 (ofs+1, delim) ctx buf strm
else
--
2.24.1

View File

@ -0,0 +1,25 @@
From 5d0a7fdb62e80593f17ad7cde5ec93d4cd84fcb6 Mon Sep 17 00:00:00 2001
From: kakadu <kakadu.hafanana@gmail.com>
Date: Thu, 26 Mar 2020 12:43:49 +0300
Subject: [PATCH 03/10] mkcamlp5: fix removing files in script
---
etc/mkcamlp5.sh.tpl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/etc/mkcamlp5.sh.tpl b/etc/mkcamlp5.sh.tpl
index 616e2be3..9bc653a9 100644
--- a/etc/mkcamlp5.sh.tpl
+++ b/etc/mkcamlp5.sh.tpl
@@ -4,7 +4,7 @@
OLIB=`OCAMLNc -where`
LIB=LIBDIR/CAMLP5N
-RM=rm -f
+RM="rm -f"
INTERFACES=
OPTS=
INCL="-I ."
--
2.24.1

View File

@ -0,0 +1,35 @@
From c4272733efcc0347af313950c40f0642fe34c8ab Mon Sep 17 00:00:00 2001
From: kakadu <kakadu.hafanana@gmail.com>
Date: Thu, 26 Mar 2020 15:11:42 +0300
Subject: [PATCH 04/10] Add pr_o and pr_dump as packages in META file
---
etc/META.tpl | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/etc/META.tpl b/etc/META.tpl
index dbf0ea4e..d8fbbf2c 100644
--- a/etc/META.tpl
+++ b/etc/META.tpl
@@ -28,6 +28,18 @@ archive(syntax,preprocessor,camlp5scheme) = "pa_scheme.cmo pr_dump.cmo"
archive(syntax,preprocessor,camlp5lisp) = "pa_lisp.cmo pr_dump.cmo"
preprocessor = "camlp5 -nolib"
+package "pr_o" (
+ requires(toploop) = "camlp5"
+ archive(syntax,preprocessor) = "pr_o.cmo"
+ archive(syntax,toploop) = "pr_o.cmo"
+)
+
+package "pr_dump" (
+ requires(toploop) = "camlp5"
+ archive(syntax,preprocessor) = "pr_dump.cmo"
+ archive(syntax,toploop) = "pr_dump.cmo"
+)
+
package "gramlib" (
requires(toploop) = "camlp5"
version = "@VERSION@"
--
2.24.1

View File

@ -0,0 +1,44 @@
From fae04042673def910291fad4a733becedab0e321 Mon Sep 17 00:00:00 2001
From: Chet Murthy <chetsky@gmail.com>
Date: Thu, 26 Mar 2020 14:23:46 -0700
Subject: [PATCH 05/10] add "pr_r" subpackage to META (to go with pr_{o,dump})
fix copy-paste error in topfind.camlp5
---
etc/META.tpl | 6 ++++++
etc/topfind.camlp5 | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/etc/META.tpl b/etc/META.tpl
index d8fbbf2c..a7e01e61 100644
--- a/etc/META.tpl
+++ b/etc/META.tpl
@@ -28,6 +28,12 @@ archive(syntax,preprocessor,camlp5scheme) = "pa_scheme.cmo pr_dump.cmo"
archive(syntax,preprocessor,camlp5lisp) = "pa_lisp.cmo pr_dump.cmo"
preprocessor = "camlp5 -nolib"
+package "pr_r" (
+ requires(toploop) = "camlp5"
+ archive(syntax,preprocessor) = "pr_r.cmo"
+ archive(syntax,toploop) = "pr_r.cmo"
+)
+
package "pr_o" (
requires(toploop) = "camlp5"
archive(syntax,preprocessor) = "pr_o.cmo"
diff --git a/etc/topfind.camlp5 b/etc/topfind.camlp5
index 5a260beb..9fd8f143 100644
--- a/etc/topfind.camlp5
+++ b/etc/topfind.camlp5
@@ -14,7 +14,7 @@ Hashtbl.add
)) ;
-(* Add "#camlp4r" directive: *)
+(* Add "#camlp5r" directive: *)
Hashtbl.add
Toploop.directive_table
--
2.24.1

View File

@ -0,0 +1,29 @@
From 021f50415cee57be88f1fa2280e846b75e4c5e3f Mon Sep 17 00:00:00 2001
From: Chet Murthy <chetsky@gmail.com>
Date: Thu, 26 Mar 2020 14:51:07 -0700
Subject: [PATCH 06/10] changelog comment for changes since rel7.11
---
CHANGES | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/CHANGES b/CHANGES
index 10673521..2796852d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,12 @@
Camlp5 Version 7.11:
--------------------
+* [26 Mar 20] forgot to add that this supports ocaml version 4.10.0.
+ added findlib packages for "camlp5.pr_o", "camlp5.pr_r" and "camlp5.pr_dump",
+ which load the appropriate archives into the toploop and preprocessor.
+ Added a "topfind.camlp5" file that can be "#use"ed instead of "topfind",
+ and will provide the commands "#camlp5o" and "#camlp5r".
+
* [29 Oct 19] Added compatibility with ocaml version 4.08.2.
* [29 Oct 19] Added compatibility with ocaml version 4.09.1.
* [03 Feb 20] Added compatibility with ocaml version 4.10+beta2.
--
2.24.1

2609
0007-start-on-4.11.0.patch Normal file

File diff suppressed because it is too large Load Diff

34
0008-meh.patch Normal file
View File

@ -0,0 +1,34 @@
From fd6806860d72522853ce2ec84142cc862b3dd16c Mon Sep 17 00:00:00 2001
From: Chet Murthy <chetsky@gmail.com>
Date: Wed, 29 Apr 2020 11:44:36 -0700
Subject: [PATCH 08/10] meh
---
ocaml_src/lib/versdep/4.11.0.ml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ocaml_src/lib/versdep/4.11.0.ml b/ocaml_src/lib/versdep/4.11.0.ml
index bb7124dd..3ebb16a4 100644
--- a/ocaml_src/lib/versdep/4.11.0.ml
+++ b/ocaml_src/lib/versdep/4.11.0.ml
@@ -244,14 +244,14 @@ let ocaml_pconst_char c = Pconst_char c;;
let ocaml_pconst_int i = Pconst_integer (string_of_int i, None);;
let ocaml_pconst_float s = Pconst_float (s, None);;
-let ocaml_const_string s = Const_string (s, None);;
-let ocaml_pconst_string s so = Pconst_string (s, so);;
+let ocaml_const_string s loc = Const_string (s, loc, None);;
+let ocaml_pconst_string s loc so = Pconst_string (s, loc, so);;
let pconst_of_const =
function
Const_int i -> ocaml_pconst_int i
| Const_char c -> ocaml_pconst_char c
- | Const_string (s, so) -> ocaml_pconst_string s so
+ | Const_string (s, loc, so) -> ocaml_pconst_string s loc so
| Const_float s -> ocaml_pconst_float s
| Const_int32 i32 -> Pconst_integer (Int32.to_string i32, Some 'l')
| Const_int64 i64 -> Pconst_integer (Int64.to_string i64, Some 'L')
--
2.24.1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,74 @@
From 8c49e5e2592be6a0c5564e6e02b02c4c731d7933 Mon Sep 17 00:00:00 2001
From: Chet Murthy <chetsky@gmail.com>
Date: Wed, 29 Apr 2020 13:10:20 -0700
Subject: [PATCH 10/10] bump version number
---
CHANGES | 8 ++++++++
README.md | 4 ++--
main/pcaml.ml | 2 +-
ocaml_src/main/pcaml.ml | 2 +-
4 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/CHANGES b/CHANGES
index 2796852d..b077be36 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,11 @@
+Camlp5 Version 7.12:
+--------------------
+
+* [29 Apr 20] upgrade to minimal support for Ocaml 4.11.0
+ (specifically 4.11.0+dev2-2020-04-22). This does not provide
+ support for any new stuff in 4.11.0; indeed, stuff may break. This
+ is just minimal "build and bootstrap" support.
+
Camlp5 Version 7.11:
--------------------
diff --git a/README.md b/README.md
index e8004a9f..cc0e6381 100644
--- a/README.md
+++ b/README.md
@@ -3,10 +3,10 @@
Camlp5 is a preprocessor-pretty-printer of ocaml.
It is (theoretically) compatible with all versions of ocaml from 1.07
-to 4.10.0 (when they compile), and jocaml 3.12.0 to 3.12.1, but
+to 4.11.0 (when they compile), and jocaml 3.12.0 to 3.12.1, but
maintainers only test against versions of ocaml >= 4.00.0.
-This Camlp5 version is 7.11.
+This Camlp5 version is 7.12.
## Requirements
diff --git a/main/pcaml.ml b/main/pcaml.ml
index ab9ac6ce..19fd851e 100644
--- a/main/pcaml.ml
+++ b/main/pcaml.ml
@@ -7,7 +7,7 @@
open Printf;
-value version = "7.11";
+value version = "7.12";
value syntax_name = ref "";
value ocaml_version =
diff --git a/ocaml_src/main/pcaml.ml b/ocaml_src/main/pcaml.ml
index 91bf00ed..86f741e9 100644
--- a/ocaml_src/main/pcaml.ml
+++ b/ocaml_src/main/pcaml.ml
@@ -7,7 +7,7 @@
open Printf;;
-let version = "7.11";;
+let version = "7.12";;
let syntax_name = ref "";;
let ocaml_version =
--
2.24.1

View File

@ -8,7 +8,7 @@
Name: ocaml-camlp5
Version: %{major}.%{minor}
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Classical version of camlp4 OCaml preprocessor
License: BSD
@ -19,6 +19,19 @@ Source0: https://github.com/camlp5/camlp5/archive/rel%{major}%{minor}.tar
# Kill -warn-error A
Patch0: camlp5-6.11-kill-warn-error.patch
# All patches in the pre-7.12 branch upstream. This includes
# support for OCaml 4.11.
Patch0001: 0001-added-etc-topfind.camlp5.patch
Patch0002: 0002-fix-raw-string-lexing-bug.patch
Patch0003: 0003-mkcamlp5-fix-removing-files-in-script.patch
Patch0004: 0004-Add-pr_o-and-pr_dump-as-packages-in-META-file.patch
Patch0005: 0005-add-pr_r-subpackage-to-META-to-go-with-pr_-o-dump.patch
Patch0006: 0006-changelog-comment-for-changes-since-rel7.11.patch
Patch0007: 0007-start-on-4.11.0.patch
Patch0008: 0008-meh.patch
Patch0009: 0009-builds-versdep-trip-test.patch
Patch0010: 0010-bump-version-number.patch
BuildRequires: ocaml
BuildRequires: ocaml-ocamldoc
@ -47,7 +60,7 @@ developing applications that use %{name}.
%prep
%setup -q -n camlp5-rel%{major}%{minor}
%patch0 -p1
%autopatch -p1
find . -name .gitignore -delete
# Build with debug information
@ -59,16 +72,13 @@ done
%build
./configure
# Upstream uses hand-written configure, grrrrrr.
./configure \
--prefix %{_prefix} \
--bindir %{_bindir} \
--libdir %{_libdir}/ocaml \
--mandir %{_mandir}
%if %opt
# For ppc64 we need a larger stack than default to compile some files
# because the stages in the OCaml compiler are not mutually tail
# recursive.
%ifarch ppc64 ppc64le
ulimit -a
ulimit -Hs 65536
ulimit -Ss 65536
%endif
make %{_smp_mflags} world.opt
%else
make %{_smp_mflags} world
@ -77,13 +87,13 @@ make -C doc/htmlp -j1
%install
mkdir -p $RPM_BUILD_ROOT%{_libdir}/ocaml
# This is a hack because the make install rule is broken upstream.
# We move the file later.
mkdir -p $RPM_BUILD_ROOT%{_libdir}/ocaml/ocaml
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_mandir}
make install \
LIBDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml \
OLIBDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml \
BINDIR=$RPM_BUILD_ROOT%{_bindir} \
MANDIR=$RPM_BUILD_ROOT%{_mandir}
make install DESTDIR=$RPM_BUILD_ROOT
mv $RPM_BUILD_ROOT%{_libdir}/ocaml/ocaml/topfind.camlp5 $RPM_BUILD_ROOT%{_libdir}/ocaml/
cp -p etc/META $RPM_BUILD_ROOT%{_libdir}/ocaml/camlp5
rm -f doc/htmlp/{*.sh,Makefile,html2*}
@ -108,6 +118,7 @@ rm -f doc/htmlp/{*.sh,Makefile,html2*}
%{_libdir}/ocaml/camlp5/*.cmx
%endif
%{_libdir}/ocaml/camlp5/*.mli
%{_libdir}/ocaml/topfind.camlp5
%{_bindir}/camlp5*
%{_bindir}/mkcamlp5*
%{_bindir}/ocpp5
@ -115,6 +126,10 @@ rm -f doc/htmlp/{*.sh,Makefile,html2*}
%changelog
* Mon May 04 2020 Richard W.M. Jones <rjones@redhat.com> - 7.11-4
- Include all upstream pre-7.12 patches.
- Fixes support for OCaml 4.11.
* Fri Apr 17 2020 Richard W.M. Jones <rjones@redhat.com> - 7.11-3
- OCaml 4.11.0 pre-release