Skip to content

Commit

Permalink
Generate hello.opam from dune-project
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Lindig <[email protected]>
  • Loading branch information
Christian Lindig committed Sep 29, 2023
1 parent 5dcf810 commit fe893d2
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ utop:

format:
$(DUNE) build --auto-promote @fmt
opam lint --normalise hello.opam > hello.tmp && mv hello.tmp hello.opam
# opam lint --normalise hello.opam > hello.tmp && mv hello.tmp hello.opam
dune format-dune-file dune-project > $$$$ && mv $$$$ dune-project
git ls-files '**/*.[ch]' | xargs -n1 indent -nut -i8

# vim:ts=8:noet:
1 change: 0 additions & 1 deletion bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ let hello =
C.Cmd.v info @@ C.Term.(const Hello.hello $ name')

let main () = C.Cmd.eval hello

let () = if !Sys.interactive then () else main () |> exit
25 changes: 24 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
(lang dune 2.0)
(name hello)

(generate_opam_files true)

(source
(github lindig/hello))

(license Unlicense)

(authors "Christian Lindig <[email protected]>")

(maintainers "Christian Lindig <[email protected]>")

(package
(name hello)
(synopsis "Minimal OCaml project for starting a new one")
(description
"Hello is the classic hello world but organised as a proper OCaml project incuding command-line parsing and online help. It serves as a starting point for new projects.")
(depends
(dune
(>= "2.0"))
(ocaml
(>= 4.08.0))
(cmdliner
(>= 1.1.0))))
29 changes: 21 additions & 8 deletions hello.opam
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "Minimal OCaml project for starting a new one"
description: """
Hello is the classic hello world but organised as a proper
OCaml project incuding command-line parsing and online help. It serves
as a starting point for new projects."""
maintainer: "Christian Lindig <[email protected]>"
authors: "Christian Lindig <[email protected]>"
description:
"Hello is the classic hello world but organised as a proper OCaml project incuding command-line parsing and online help. It serves as a starting point for new projects."
maintainer: ["Christian Lindig <[email protected]>"]
authors: ["Christian Lindig <[email protected]>"]
license: "Unlicense"
homepage: "https://github.com/lindig/hello"
bug-reports: "https://github.com/lindig/hello/issues"
depends: [
"dune" {>= "2.0"}
"ocaml" {>= "4.08.0"}
"cmdliner" {>= "1.1.0"}
]
build: ["dune" "build" "-p" name "-j" jobs]
dev-repo: "https://github.com/lindig/hello.git"
build: [
["dune" "subst"] {pinned}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/lindig/hello.git"

0 comments on commit fe893d2

Please sign in to comment.