Skip to content

Commit

Permalink
Auto-generate opam files using Dune.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zimmi48 committed Jul 4, 2023
1 parent d3f2126 commit f4d75a0
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 17 deletions.
10 changes: 6 additions & 4 deletions coq-core.opam
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ depends: [
"ocamlfind" {>= "1.8.1"}
"zarith" {>= "1.11"}
"ounit2" {with-test}
"odoc" {with-doc}
]
depopts: ["coq-native"]
dev-repo: "git+https://github.com/coq/coq.git"
build: [
# Requires dune 2.8 due to https://github.com/ocaml/dune/issues/3219
# ["dune" "subst"] {pinned}
["dune" "subst"] {dev}
[ "./configure"
"-prefix" prefix
"-mandir" man
Expand All @@ -49,10 +51,10 @@ build: [
name
"-j"
jobs
"--promote-install-files=false"
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
["dune" "install" "-p" name "--create-install-files" name]
]
dev-repo: "git+https://github.com/coq/coq.git"
depopts: ["coq-native"]
22 changes: 22 additions & 0 deletions coq-core.opam.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
build: [
["dune" "subst"] {dev}
[ "./configure"
"-prefix" prefix
"-mandir" man
"-libdir" "%{lib}%/coq"
"-native-compiler" "yes" {coq-native:installed} "no" {!coq-native:installed}
]
[
"dune"
"build"
"-p"
name
"-j"
jobs
"--promote-install-files=false"
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
["dune" "install" "-p" name "--create-install-files" name]
]
13 changes: 7 additions & 6 deletions coq-stdlib.opam
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ bug-reports: "https://github.com/coq/coq/issues"
depends: [
"dune" {>= "2.9"}
"coq-core" {= version}
"odoc" {with-doc}
]
depopts: ["coq-native"]
dev-repo: "git+https://github.com/coq/coq.git"
build: [
# Requires dune 2.8 due to https://github.com/ocaml/dune/issues/3219
# ["dune" "subst"] {pinned}
#
# XXX need to run configure as in coq-core, or else dunestrap will
["dune" "subst"] {dev}
# need to run configure as in coq-core, or else dunestrap will
# use the default rule in config
[ "./configure"
"-prefix" prefix
Expand All @@ -46,10 +47,10 @@ build: [
name
"-j"
jobs
"--promote-install-files=false"
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
["dune" "install" "-p" name "--create-install-files" name]
]
dev-repo: "git+https://github.com/coq/coq.git"
depopts: ["coq-native"]
25 changes: 25 additions & 0 deletions coq-stdlib.opam.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
build: [
["dune" "subst"] {dev}
# need to run configure as in coq-core, or else dunestrap will
# use the default rule in config
[ "./configure"
"-prefix" prefix
"-mandir" man
"-libdir" "%{lib}%/coq"
"-native-compiler" "yes" {coq-native:installed} "no" {!coq-native:installed}
]
[ make "dunestrap" "COQ_DUNE_EXTRA_OPT=-split" ]
[
"dune"
"build"
"-p"
name
"-j"
jobs
"--promote-install-files=false"
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
["dune" "install" "-p" name "--create-install-files" name]
]
5 changes: 4 additions & 1 deletion coq.opam
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,22 @@ depends: [
"coq-core" {= version}
"coq-stdlib" {= version}
"coqide-server" {= version}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {pinned}
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"--promote-install-files=false"
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
["dune" "install" "-p" name "--create-install-files" name]
]
dev-repo: "git+https://github.com/coq/coq.git"
6 changes: 4 additions & 2 deletions coqide-server.opam
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,22 @@ bug-reports: "https://github.com/coq/coq/issues"
depends: [
"dune" {>= "2.9"}
"coq-core" {= version}
"odoc" {with-doc}
]
build: [
# Requires dune 2.8 due to https://github.com/ocaml/dune/issues/3219
# ["dune" "subst"] {pinned}
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"--promote-install-files=false"
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
["dune" "install" "-p" name "--create-install-files" name]
]
dev-repo: "git+https://github.com/coq/coq.git"
6 changes: 4 additions & 2 deletions coqide.opam
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,22 @@ depends: [
"coqide-server" {= version}
"cairo2" {>= "0.6.4"}
"lablgtk3-sourceview3" {>= "3.1.2"}
"odoc" {with-doc}
]
build: [
# Requires dune 2.8 due to https://github.com/ocaml/dune/issues/3219
# ["dune" "subst"] {pinned}
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"--promote-install-files=false"
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
["dune" "install" "-p" name "--create-install-files" name]
]
dev-repo: "git+https://github.com/coq/coq.git"
3 changes: 1 addition & 2 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
(formatting
(enabled_for ocaml))

; After Dune 2.8 we can use this, but let's wait for the build consolidation PR
; (generate_opam_files true)
(generate_opam_files true)

(license LGPL-2.1-only)
(maintainers "The Coq development team <coqdev@inria.fr>")
Expand Down

0 comments on commit f4d75a0

Please sign in to comment.