|
1 |
| -# Template for Coq Plugins using Dune |
| 1 | +# Coq Plugin Template using Dune |
2 | 2 |
|
3 |
| -This repository contains a template for writing a plugin for the |
| 3 | +[![Docker CI][docker-action-shield]][docker-action-link] |
| 4 | + |
| 5 | +[docker-action-shield]: https://github.com/coq-community/coq-plugin-template/workflows/Docker%20CI/badge.svg?branch=v8.17 |
| 6 | +[docker-action-link]: https://github.com/coq-community/coq-plugin-template/actions?query=workflow:"Docker%20CI" |
| 7 | + |
| 8 | +Template repository writing a plugin in [OCaml](https://ocaml.org) for the |
4 | 9 | [Coq](https://coq.inria.fr) proof assistant using the [Dune](https://dune.build)
|
5 | 10 | build system. It showcases a few advanced features such as linking to C code or
|
6 | 11 | to external libraries.
|
7 | 12 |
|
8 |
| -The current version is tested (and requires): |
9 |
| - |
10 |
| -- Dune 2.9 |
11 |
| -- Coq 8.16 |
12 |
| - |
13 |
| -Minimal historical requirements are Coq 8.9 and Dune 1.10, but they |
14 |
| -are not supported anymore. See template history / branches for |
15 |
| -changes at your own risk. |
| 13 | +## Meta |
16 | 14 |
|
17 |
| -See the [Dune documentation](https://dune.readthedocs.io/en/latest/) for more help. |
| 15 | +- License: [Unlicense](LICENSE) (change to your license of choice) |
| 16 | +- Compatible Coq versions: 8.17 or later |
| 17 | +- Additional dependencies: |
| 18 | + - [Dune](https://dune.build) 3.8.1 or later |
| 19 | +- Coq namespace: `MyPlugin` |
18 | 20 |
|
19 |
| -## See also |
20 |
| - |
21 |
| -The [official tutorial](https://github.com/coq/coq/tree/master/doc/plugin_tutorial) |
22 |
| -for writing Coq plugins in the Coq repository, which already includes `dune` files |
23 |
| -for OCaml parts. |
24 |
| - |
25 |
| -## How to build |
| 21 | +## Building instructions |
26 | 22 |
|
| 23 | +To install dependencies via [opam](https://opam.ocaml.org/doc/Install.html): |
27 | 24 | ```shell
|
28 |
| -$ dune build |
| 25 | +$ opam install dune.3.8.2 coq.8.17.0 |
29 | 26 | ```
|
30 |
| -and the rest of the regular Dune commands. To test your library, you can use |
31 | 27 |
|
| 28 | +To build the plugin when all dependencies are installed: |
32 | 29 | ```shell
|
33 |
| -$ dune exec -- coqtop -R _build/default/theories MyPlugin |
| 30 | +$ dune build |
34 | 31 | ```
|
35 | 32 |
|
36 |
| -or starting with Dune 3.2 |
| 33 | +The plugin can be tested manually: |
37 | 34 | ```shell
|
38 | 35 | $ dune coq top theories/Test.v
|
39 |
| -``` |
40 | 36 |
|
41 |
| -## Releasing OPAM packages |
| 37 | +Welcome to Coq 8.17.0 |
42 | 38 |
|
43 |
| -You can use |
44 |
| -[`dune-release`](https://github.com/ocamllabs/dune-release) to |
45 |
| -automatically release OPAM packages. |
| 39 | +Coq < Require Import MyPlugin. |
| 40 | +[Loading ML file my_plugin.cmxs (using legacy method) ... done] |
46 | 41 |
|
47 |
| -For that, you need to update the included `.opam` file, and configure |
48 |
| -your Github tokens as described in the documentation of `dune-release`. |
| 42 | +Coq < CallC. |
| 43 | +Toplevel input, characters 0-6: |
| 44 | +> CallC. |
| 45 | +> ^^^^^^ |
| 46 | +Warning: 546 |
| 47 | +``` |
49 | 48 |
|
50 |
| -## Linking with external libraries |
| 49 | +See also the [Dune documentation](https://dune.readthedocs.io/en/latest/) for more help, |
| 50 | +and the [official tutorial](https://github.com/coq/coq/tree/master/doc/plugin_tutorial) |
| 51 | +for writing Coq plugins in the Coq repository which already includes `dune` files |
| 52 | +for the OCaml parts. |
51 | 53 |
|
52 |
| -Starting with Coq 8.16, Coq will load dependencies of your |
53 |
| -plugin. This requires that your plugin is named as a findlib package. |
| 54 | +## Releasing opam packages |
54 | 55 |
|
55 |
| -See [Coq documentation](https://coq.github.io/doc/master/refman/proof-engine/vernacular-commands.html#coq:cmd.Declare-ML-Module) for more information. |
| 56 | +You can use [`dune-release`](https://github.com/tarides/dune-release) to |
| 57 | +automatically release opam packages. |
| 58 | + |
| 59 | +For that, you need to update the included `.opam` file, and configure |
| 60 | +your Github tokens as described in the documentation of `dune-release`. |
0 commit comments