[opam-devel] the available field in 1.1.1

Anil Madhavapeddy anil at recoil.org
Sun Aug 31 08:56:40 BST 2014


I'm trying to get the available field working in camlp4 so that we can select a system camlp4 if its a preinstalled switch.  I have the following camlp4 packages:

diff --git a/packages/camlp4/camlp4.4.02.0+system/opam b/packages/camlp4/camlp4.4.02.0+system/opam
new file mode 100644
index 0000000..4e3bc40
--- /dev/null
+++ b/packages/camlp4/camlp4.4.02.0+system/opam
@@ -0,0 +1,8 @@
+opam-version: "1"
+maintainer: "jeremie at dimino.org"
+homepage: "https://github.com/ocaml/camlp4"
+license: "LGPLv2"
+build: [
+  ["camlp4" "-v"]
+]
+available: [ preinstalled & ocaml-version = "4.02.0" ]
diff --git a/packages/camlp4/camlp4.4.02.0/opam b/packages/camlp4/camlp4.4.02.0/opam
index 32f02e6..0fc662d 100644
--- a/packages/camlp4/camlp4.4.02.0/opam
+++ b/packages/camlp4/camlp4.4.02.0/opam
@@ -17,4 +17,4 @@ remove: [
              "%{bin}%/camlp4o.opt" "%{bin}%/camlp4oof.opt" "%{bin}%/camlp4r.opt"
   ]
 ]
-ocaml-version: [>="4.02.0" & <"4.03.0"]
+available: [ !preinstalled & ocaml-version = "4.02.0" ]

This works fine OPAM 1.2, but OPAM 1.1.1 complains with a parse error.  Is there
anything that'll work for both?

See https://travis-ci.org/ocaml/opam-repository/jobs/34006191
and https://github.com/ocaml/opam-repository/pull/2558

errors are:
[WARNING] Errors while parsing camlp4.4.02.0 OPAM file, skipping.
[WARNING] Errors while parsing camlp4.4.02.0+system OPAM file, skipping.
[WARNING] Errors while parsing camlp4.4.02.0 OPAM file, skipping.
[WARNING] Errors while parsing camlp4.4.02.0+system OPAM file, skipping.

(Also, an env var to turn these parse warnings into failures would be a useful Travis knob to have in 1.2 perhaps)

-anil


More information about the opam-devel mailing list