Skip to content

Commit

Permalink
Generate OPAM files from dune-project
Browse files Browse the repository at this point in the history
This has some advantages, e.g. auto-generating the correct dune
incantation as well as deduplicating some of the OPAM stanzas.
  • Loading branch information
Leonidas-from-XIV committed Aug 16, 2022
1 parent 2c80a24 commit b7dbc91
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 30 deletions.
35 changes: 35 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
(lang dune 2.7)
(name yojson)
(formatting (enabled_for dune))

(generate_opam_files true)
(source (github ocaml-community/yojson))
(license BSD-3-Clause)

(maintainers "[email protected]" "[email protected]" "[email protected]")
(authors "Martin Jambon")
(documentation "https://ocaml-community.github.io/yojson")

(package
(name yojson)
(synopsis "Yojson is an optimized parsing and printing library for the JSON format")
(description "Yojson is an optimized parsing and printing library for the JSON format.
ydump is a pretty-printing command-line program provided with the
yojson package.")
(depends
(ocaml (>= 4.02.3))
(cppo :build)
(alcotest (and :with-test (>= 0.8.5)))
(seq (>= 0.2.2))))

(package
(name yojson-bench)
(synopsis "Run Yojson benchmarks")
(description "Yojson benchmarks require `Core_bench` which is not a dependency of Yojson,
because it is not part of the regular installation/testing flow. This is solely
meant for developers that are worried about performance changes in Yojson.")
(depends
(ocaml (>= 4.08))
(yojson (= :version))
(core_bench (>= v0.15.0))
(core (>= v0.14.0))
(core_unix (>= v0.14.0))
(sexplib (>= v0.9.0))))
36 changes: 25 additions & 11 deletions yojson-bench.opam
Original file line number Diff line number Diff line change
@@ -1,26 +1,40 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
maintainer: ["[email protected]" "[email protected]" "[email protected]"]
synopsis: "Run Yojson benchmarks"
description: """
Yojson benchmarks require `Core_bench` which is not a dependency of Yojson,
because it is not part of the regular installation/testing flow. This is solely
meant for developers that are worried about performance changes in Yojson."""
maintainer: [
"[email protected]" "[email protected]" "[email protected]"
]
authors: ["Martin Jambon"]
license: "BSD-3-Clause"
homepage: "https://github.com/ocaml-community/yojson"
doc: "https://ocaml-community.github.io/yojson"
bug-reports: "https://github.com/ocaml-community/yojson/issues"
dev-repo: "git+https://github.com/ocaml-community/yojson.git"
doc: "https://ocaml-community.github.io/yojson/"
license: "BSD-3-Clause"
depends: [
"dune" {>= "2.7"}
"ocaml" {>= "4.08"}
"yojson" {= version}
"dune" {>= "2.7.0"}
"core_bench" {>= "v0.15.0"}
"core" {>= "v0.14.0"}
"core_unix" {>= "v0.14.0"}
"sexplib" {>= "v0.9.0"}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
["dune" "build" "-p" name "-j" jobs]
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
synopsis: "Run Yojson benchmarks"
description: """\
Yojson benchmarks require `Core_bench` which is not a dependency of Yojson,
because it is not part of the regular installation/testing flow. This is solely
meant for developers that are worried about performance changes in Yojson."""
dev-repo: "git+https://github.com/ocaml-community/yojson.git"
49 changes: 30 additions & 19 deletions yojson.opam
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
maintainer: ["[email protected]" "[email protected]"]
synopsis:
"Yojson is an optimized parsing and printing library for the JSON format"
description: """
Yojson is an optimized parsing and printing library for the JSON format.

ydump is a pretty-printing command-line program provided with the
yojson package."""
maintainer: [
"[email protected]" "[email protected]" "[email protected]"
]
authors: ["Martin Jambon"]
license: "BSD-3-Clause"
homepage: "https://github.com/ocaml-community/yojson"
doc: "https://ocaml-community.github.io/yojson"
bug-reports: "https://github.com/ocaml-community/yojson/issues"
dev-repo: "git+https://github.com/ocaml-community/yojson.git"
doc: "https://ocaml-community.github.io/yojson/"
license: "BSD-3-Clause"
build: [
["dune" "subst"] {dev}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
["dune" "build" "@doc" "-p" name "-j" jobs] {with-doc}
]
depends: [
"dune" {>= "2.7"}
"ocaml" {>= "4.02.3"}
"dune" {>= "2.7.0"}
"cppo" {build}
"alcotest" {with-test & >= "0.8.5"}
"odoc" {with-doc}
"seq" {>= "0.2.2"}
"odoc" {with-doc}
]
synopsis:
"Yojson is an optimized parsing and printing library for the JSON format"
description: """
Yojson is an optimized parsing and printing library for the JSON format.

ydump is a pretty-printing command-line program provided with the
yojson package."""
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/ocaml-community/yojson.git"

0 comments on commit b7dbc91

Please sign in to comment.