diff options
author | Stephane Glondu <steph@glondu.net> | 2021-11-28 10:55:25 +0100 |
---|---|---|
committer | Stephane Glondu <steph@glondu.net> | 2021-11-28 10:55:25 +0100 |
commit | 77fa4230860daf33d7476f3df07d26ad588f177e (patch) | |
tree | 898468ac3468d6a5c977010273074de1f0a578d2 | |
parent | 3557760702519d73ea25e698f8abfc4712b42236 (diff) |
New upstream version 1.6.7
-rw-r--r-- | Changes | 5 | ||||
-rw-r--r-- | INSTALL.md | 8 | ||||
-rw-r--r-- | cppo.opam | 6 | ||||
-rw-r--r-- | cppo_ocamlbuild.opam | 5 | ||||
-rw-r--r-- | src/compat.ml | 7 | ||||
-rw-r--r-- | src/cppo_main.ml | 6 | ||||
-rw-r--r-- | src/dune | 5 |
7 files changed, 29 insertions, 13 deletions
@@ -1,3 +1,8 @@ +## v1.6.7 (2020-12-21) +- [compat] Treat ~ and - the same in semver in order to parse + OCaml 4.12.0 pre-release versions. +- [compat] Restore 4.02.3 compatibility. + ## v1.6.6 (2019-05-27) - [pkg] port build system to dune from jbuilder. - [pkg] upgrade opam metadata to 2.0 format. @@ -13,11 +13,5 @@ make Install: ``` -make PREFIX=/some/path install -``` - -or - -``` -make BINDIR=/some/path/bin install +make DESTDIR=/some/path install ``` @@ -2,12 +2,12 @@ opam-version: "2.0" maintainer: "martin@mjambon.com" authors: "Martin Jambon" license: "BSD-3-Clause" -homepage: "http://mjambon.com/cppo.html" +homepage: "https://github.com/ocaml-community/cppo" doc: "https://ocaml-community.github.io/cppo/" bug-reports: "https://github.com/ocaml-community/cppo/issues" depends: [ - "ocaml" {>= "4.03"} - "dune" {build & >= "1.0"} + "ocaml" {>= "4.02.3"} + "dune" {>= "1.0"} "base-unix" ] build: [ diff --git a/cppo_ocamlbuild.opam b/cppo_ocamlbuild.opam index a81a6a8..96f1fdb 100644 --- a/cppo_ocamlbuild.opam +++ b/cppo_ocamlbuild.opam @@ -2,13 +2,14 @@ opam-version: "2.0" maintainer: "martin@mjambon.com" authors: "Martin Jambon" license: "BSD-3-Clause" -homepage: "http://mjambon.com/cppo.html" +homepage: "https://github.com/ocaml-community/cppo" doc: "https://ocaml-community.github.io/cppo/" bug-reports: "https://github.com/ocaml-community/cppo/issues" depends: [ "ocaml" - "dune" {build & >= "1.0"} + "dune" {>= "1.0"} "ocamlbuild" + "ocamlfind" ] build: [ ["dune" "subst"] {pinned} diff --git a/src/compat.ml b/src/compat.ml new file mode 100644 index 0000000..5cd4a1b --- /dev/null +++ b/src/compat.ml @@ -0,0 +1,7 @@ +if Filename.check_suffix Sys.argv.(1) ".ml" && + Scanf.sscanf Sys.ocaml_version "%d.%d" (fun a b -> (a, b)) < (4, 03) then + print_endline "\ +module String = struct + include String + let capitalize_ascii = capitalize +end" diff --git a/src/cppo_main.ml b/src/cppo_main.ml index 22792b3..93dd647 100644 --- a/src/cppo_main.ml +++ b/src/cppo_main.ml @@ -18,7 +18,7 @@ let semver_re = Str.regexp "\ \\([0-9]+\\)\ \\.\\([0-9]+\\)\ \\.\\([0-9]+\\)\ -\\(-\\([^+]*\\)\\)?\ +\\([~-]\\([^+]*\\)\\)?\ \\(\\+\\(.*\\)\\)?\ \r?$" @@ -108,6 +108,10 @@ let main () = VAR_VERSION_FULL is the original string Example: cppo -V OCAML:4.02.1 + + Note that cppo recognises both '-' and '~' preceding the pre-release + meaning -V OCAML:4.11.0+alpha1 sets OCAML_BUILD to alpha1 but + -V OCAML:4.12.0~alpha1 sets OCAML_PRERELEASE to alpha1. "; "-o", Arg.String (fun s -> out_file := Some s), @@ -13,4 +13,9 @@ (name cppo_main) (package cppo) (public_name cppo) + (modules :standard \ compat) + (preprocess (per_module + ((action (progn + (run ocaml %{dep:compat.ml} %{input-file}) + (cat %{input-file}))) cppo_eval))) (libraries unix str)) |