From 068022d5ec6ee8f1382675302a6a59ec62f73d29 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Tue, 11 Feb 2020 20:13:07 -0700 Subject: [PATCH] Version 6.1. --- ocaml-ppx-tools-build.patch | 41 ------------------ ocaml-ppx-tools-ocaml-4.10.patch | 70 ------------------------------ ocaml-ppx-tools.spec | 74 ++++++++++++++++++++++---------- sources | 2 +- 4 files changed, 52 insertions(+), 135 deletions(-) delete mode 100644 ocaml-ppx-tools-build.patch delete mode 100644 ocaml-ppx-tools-ocaml-4.10.patch diff --git a/ocaml-ppx-tools-build.patch b/ocaml-ppx-tools-build.patch deleted file mode 100644 index d24020c..0000000 --- a/ocaml-ppx-tools-build.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -8,8 +8,8 @@ PACKAGE = ppx_tools - VERSION = 5.3 - # Don't forget to change META file as well - --OCAMLC = ocamlc -bin-annot --OCAMLOPT = ocamlopt -+OCAMLC = ocamlc -bin-annot -g -+OCAMLOPT = ocamlopt -bin-annot -g - COMPFLAGS = -w +A-4-17-44-45 -I +compiler-libs -safe-string - - .PHONY: all -@@ -22,6 +22,19 @@ all: ppx_tools.cmxs - endif - endif - -+ifneq ($(ARCH),none) -+genlifter$(EXE): ppx_tools.cmxa genlifter.cmx -+ $(OCAMLOPT) $(COMPFLAGS) -o genlifter$(EXE) ocamlcommon.cmxa ppx_tools.cmxa genlifter.cmx -+ -+dumpast$(EXE): dumpast.cmx -+ $(OCAMLOPT) $(COMPFLAGS) -o dumpast$(EXE) ocamlcommon.cmxa ocamlbytecomp.cmxa ast_lifter.cmx dumpast.cmx -+ -+ppx_metaquot$(EXE): ppx_metaquot.cmx -+ $(OCAMLOPT) $(COMPFLAGS) -o ppx_metaquot$(EXE) ocamlcommon.cmxa ppx_tools.cmxa ast_lifter.cmx ppx_metaquot.cmx -+ -+rewriter$(EXE): rewriter.cmx -+ $(OCAMLOPT) $(COMPFLAGS) -o rewriter$(EXE) ocamlcommon.cmxa rewriter.cmx -+else - genlifter$(EXE): ppx_tools.cma genlifter.cmo - $(OCAMLC) $(COMPFLAGS) -o genlifter$(EXE) ocamlcommon.cma ppx_tools.cma genlifter.cmo - -@@ -33,6 +46,7 @@ ppx_metaquot$(EXE): ppx_metaquot.cmo - - rewriter$(EXE): rewriter.cmo - $(OCAMLC) $(COMPFLAGS) -o rewriter$(EXE) ocamlcommon.cma rewriter.cmo -+endif - - ast_lifter.ml: genlifter$(EXE) - ./genlifter$(EXE) -I +compiler-libs Parsetree.expression > ast_lifter.ml || rm -rf ast_lifter.ml diff --git a/ocaml-ppx-tools-ocaml-4.10.patch b/ocaml-ppx-tools-ocaml-4.10.patch deleted file mode 100644 index 82dc00b..0000000 --- a/ocaml-ppx-tools-ocaml-4.10.patch +++ /dev/null @@ -1,70 +0,0 @@ ---- a/ast_mapper_class.ml -+++ b/ast_mapper_class.ml -@@ -162,6 +162,10 @@ module CT = struct - (List.map (sub # class_type_field) pcsig_fields) - end - -+let map_functor_param sub = function -+ | Unit -> Unit -+ | Named (s, mt) -> Named (map_loc sub s, sub # module_type mt) -+ - module MT = struct - (* Type expressions for the module language *) - -@@ -173,10 +177,10 @@ module MT = struct - | Pmty_ident s -> ident ~loc ~attrs (map_loc sub s) - | Pmty_alias s -> alias ~loc ~attrs (map_loc sub s) - | Pmty_signature sg -> signature ~loc ~attrs (sub # signature sg) -- | Pmty_functor (s, mt1, mt2) -> -- functor_ ~loc ~attrs (map_loc sub s) -- (map_opt (sub # module_type) mt1) -- (sub # module_type mt2) -+ | Pmty_functor (param, mt) -> -+ functor_ ~loc ~attrs -+ (map_functor_param sub param) -+ (sub # module_type mt) - | Pmty_with (mt, l) -> - with_ ~loc ~attrs (sub # module_type mt) - (List.map (sub # with_constraint) l) -@@ -227,9 +231,9 @@ module M = struct - match desc with - | Pmod_ident x -> ident ~loc ~attrs (map_loc sub x) - | Pmod_structure str -> structure ~loc ~attrs (sub # structure str) -- | Pmod_functor (arg, arg_ty, body) -> -- functor_ ~loc ~attrs (map_loc sub arg) -- (map_opt (sub # module_type) arg_ty) -+ | Pmod_functor (param, body) -> -+ functor_ ~loc ~attrs -+ (map_functor_param sub param) - (sub # module_expr body) - | Pmod_apply (m1, m2) -> - apply ~loc ~attrs (sub # module_expr m1) (sub # module_expr m2) ---- a/genlifter.ml -+++ b/genlifter.ml -@@ -50,7 +50,7 @@ module Main : sig end = struct - if Hashtbl.mem printed ty then () - else let tylid = Longident.parse ty in - let td = -- try Env.find_type (Env.lookup_type tylid env) env -+ try snd (Env.lookup_type ~loc:(mknoloc tylid).loc tylid env) - with Not_found -> - Format.eprintf "** Cannot resolve type %s@." ty; - exit 2 ---- a/ppx_tools.opam -+++ b/ppx_tools.opam -@@ -10,6 +10,6 @@ tags: [ "syntax" ] - build: [[make "all"]] - install: [[make "install"]] - depends: [ -- "ocaml" {>= "4.08.0"} -+ "ocaml" {>= "4.10.0"} - "ocamlfind" {build & >= "1.5.0"} - ] ---- a/.travis.yml -+++ b/.travis.yml -@@ -9,4 +9,4 @@ env: - - PACKAGE="ppx_tools" - - PRE_INSTALL_HOOK="cd /home/opam/opam-repository && git pull origin master && opam update -u -y" - matrix: -- - DISTRO=ubuntu-16.04 OCAML_VERSION=4.08.0 -+ - DISTRO=ubuntu-16.04 OCAML_VERSION=4.10.0+beta1 OCAML_BETA=enable diff --git a/ocaml-ppx-tools.spec b/ocaml-ppx-tools.spec index 88e0a27..463e40a 100644 --- a/ocaml-ppx-tools.spec +++ b/ocaml-ppx-tools.spec @@ -4,25 +4,21 @@ %global srcname ppx-tools %global upname ppx_tools -%global ocamlvr 4.08.0 +%global ocamlvr 4.10.0 Name: ocaml-%{srcname} -Version: 5.3 +Version: 6.1 Release: 1%{?dist} Summary: Tools for authors of ppx rewriters License: MIT URL: https://github.com/ocaml-ppx/%{upname} Source0: %{url}/archive/%{version}+%{ocamlvr}/%{upname}-%{version}.tar.gz -# Build with debug information. Build the binaries natively when possible. -Patch0: %{name}-build.patch -# Adapt to OCaml 4.10. -# https://github.com/ocaml-ppx/ppx_tools/pull/79 -Patch1: %{name}-ocaml-4.10.patch BuildRequires: ocaml >= %{ocamlvr} +BuildRequires: ocaml-dune >= 1.6 BuildRequires: ocaml-findlib -BuildRequires: ocaml-ocamldoc +BuildRequires: ocaml-odoc %description Tools for authors of syntactic tools (such as ppx rewriters). @@ -35,54 +31,86 @@ Requires: %{name}%{?_isa} = %{version}-%{release} The %{name}-devel package contains libraries and signature files for developing applications that use %{name}. +%package doc +Summary: Documentation for %{name} +BuildArch: noarch + +%description doc +Documentation for %{name}. + %prep %autosetup -n %{upname}-%{version}-%{ocamlvr} -p1 -# Generate debuginfo -sed -ri 's/OCAML(C|OPT) = .*/& -g/' Makefile - %build -# Parallel build does not work reliably -make - -# Build the documentation -mkdir html -ocamldoc -html -d html -I +compiler-libs *.mli +dune build %{?_smp_mflags} +dune build %{?_smp_mflags} @doc %install -export DESTDIR=%{buildroot} -export OCAMLFIND_DESTDIR=%{buildroot}%{_libdir}/ocaml -mkdir -p %{buildroot}%{_libdir}/ocaml -make install -cp -p %{upname}.opam %{buildroot}%{_libdir}/ocaml/%{upname}/opam +dune install --destdir=%{buildroot} + +# We do not want the dune markers +find _build/default/_doc/_html -name .dune-keep -delete + +# We do not want the ml files +find %{buildroot}%{_libdir}/ocaml -name \*.ml -delete + +# We install the documentation with the doc macro +rm -fr %{buildroot}%{_prefix}/doc + +%ifarch %{ocaml_native_compiler} +# Add missing executable bits +find %{buildroot}%{_libdir}/ocaml -name \*.cmxs -exec chmod a+x {} \+ +%endif + +%check +dune runtest %files %doc README.md %license LICENSE %dir %{_libdir}/ocaml/%{upname}/ +%dir %{_libdir}/ocaml/%{upname}/ast_lifter/ +%dir %{_libdir}/ocaml/%{upname}/metaquot/ %{_libdir}/ocaml/%{upname}/META %{_libdir}/ocaml/%{upname}/dumpast %{_libdir}/ocaml/%{upname}/genlifter %{_libdir}/ocaml/%{upname}/ppx_metaquot %{_libdir}/ocaml/%{upname}/rewriter +%{_libdir}/ocaml/%{upname}/metaquot/ppx.exe %{_libdir}/ocaml/%{upname}/*.cma %{_libdir}/ocaml/%{upname}/*.cmi +%{_libdir}/ocaml/%{upname}/*/*.cma +%{_libdir}/ocaml/%{upname}/*/*.cmi %ifarch %{ocaml_native_compiler} %{_libdir}/ocaml/%{upname}/*.cmxs +%{_libdir}/ocaml/%{upname}/*/*.cmxs %endif %files devel -%doc html/* +%{_libdir}/ocaml/%{upname}/dune-package %{_libdir}/ocaml/%{upname}/opam %ifarch %{ocaml_native_compiler} %{_libdir}/ocaml/%{upname}/*.a %{_libdir}/ocaml/%{upname}/*.cmx %{_libdir}/ocaml/%{upname}/*.cmxa +%{_libdir}/ocaml/%{upname}/*/*.a +%{_libdir}/ocaml/%{upname}/*/*.cmx +%{_libdir}/ocaml/%{upname}/*/*.cmxa %endif %{_libdir}/ocaml/%{upname}/*.cmt %{_libdir}/ocaml/%{upname}/*.cmti %{_libdir}/ocaml/%{upname}/*.mli +%{_libdir}/ocaml/%{upname}/*/*.cmt + +%files doc +%doc _build/default/_doc/_html/ +%doc _build/default/_doc/_mlds/ +%doc _build/default/_doc/_odoc/ +%license LICENSE %changelog +* Wed Feb 12 2020 Jerry James - 6.1-1 +- Version 6.1 + * Wed Feb 5 2020 Jerry James - 5.3-1 - Initial RPM diff --git a/sources b/sources index 70ae4aa..852eacf 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ppx_tools-5.3.tar.gz) = 817e2688d60f013fa42ffa263cfcc15cfae820240d2e54dfedf1f4a4191f9b9fc365a190cc7eeb9082ed72fbf3c94d6ba72c38c7db3e2bcac49a17ba590d71b5 +SHA512 (ppx_tools-6.1.tar.gz) = 596dd6c9682eb1f36376a9fb60b9dff58ce7416bd83d5d0f5b36517b917b9466c99f621bcccc012255eefcd07d9c1663c2900eae60d89492c2e62c3173ed9311