Skip to content

Commit

Permalink
generate opam files with dune (#2704)
Browse files Browse the repository at this point in the history
* generate opam files with dune

* Use dune 2.9

* Specify utop in rtop and add dune-build-info

* Rename formatTest to test in default.nix

---------

Co-authored-by: David Sancho Moreno <dsnxmoreno@gmail.com>
  • Loading branch information
anmonteiro and davesnx authored Mar 28, 2023
1 parent 4373783 commit c6817db
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 42 deletions.
56 changes: 55 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,7 +1,61 @@
(lang dune 2.8)
(lang dune 2.9)

(name reason)

(using menhir 2.0)

(cram enable)

(version 3.8.2)

(generate_opam_files true)

(source
(github reasonml/reason))

(authors "Jordan Walke <jordojw@gmail.com>")

(maintainers
"Jordan Walke <jordojw@gmail.com>"
"Antonio Nuno Monteiro <anmonteiro@gmail.com>")

(homepage "https://reasonml.github.io/")

(bug_reports "https://github.com/reasonml/reason/issues")

(license "MIT")

(package
(name reason)
(synopsis "Reason: Syntax & Toolchain for OCaml")
(description
"Reason gives OCaml a new syntax that is remniscient of languages like\nJavaScript. It's also the umbrella project for a set of tools for the OCaml &\nJavaScript ecosystem.")
(depends
(ocaml
(and
(>= "4.03")
(< "5.1")))
(ocamlfind :build)
(dune-build-info
(>= 2.9.3))
(menhir
(>= "20180523"))
(merlin-extend
(>= "0.6"))
fix
ppx_derivers))

(package
(name rtop)
(synopsis "Reason toplevel")
(description
"rtop is the toplevel (or REPL) for Reason, based on utop (https://github.com/diml/utop).")
(depends
(ocaml
(and
(>= "4.03")
(< "5.1")))
(reason
(= :version))
(utop
(>= "2.0"))))
2 changes: 1 addition & 1 deletion nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ocamlPackages.buildDunePackage {

src = nix-filter.filter {
root = ./..;
include = [ "dune" "dune-project" "reason.opam" "rtop.opam" "scripts" "src" "formatTest" ];
include = [ "dune" "dune-project" "reason.opam" "rtop.opam" "scripts" "src" "test" ];
};

useDune2 = true;
Expand Down
50 changes: 33 additions & 17 deletions reason.opam
Original file line number Diff line number Diff line change
@@ -1,28 +1,44 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
maintainer: "Jordan Walke <jordojw@gmail.com>"
authors: [ "Jordan Walke <jordojw@gmail.com>" ]
version: "3.8.2"
synopsis: "Reason: Syntax & Toolchain for OCaml"
description: """
Reason gives OCaml a new syntax that is remniscient of languages like
JavaScript. It's also the umbrella project for a set of tools for the OCaml &
JavaScript ecosystem."""
maintainer: [
"Jordan Walke <jordojw@gmail.com>"
"Antonio Nuno Monteiro <anmonteiro@gmail.com>"
]
authors: ["Jordan Walke <jordojw@gmail.com>"]
license: "MIT"
homepage: "https://github.com/reasonml/reason"
doc: "https://reasonml.github.io/"
homepage: "https://reasonml.github.io/"
bug-reports: "https://github.com/reasonml/reason/issues"
dev-repo: "git+https://github.com/reasonml/reason.git"
tags: [ "syntax" ]
build: [
["dune" "build" "-p" name "-j" jobs]
]
depends: [
"dune" {>= "2.9"}
"ocaml" {>= "4.03" & < "5.1"}
"dune" {>= "2.9.3"}
"dune-build-info" {>= "2.9.3"}
"ocamlfind" {build}
"dune-build-info" {>= "2.9.3"}
"menhir" {>= "20180523"}
"merlin-extend" {>= "0.6"}
"fix"
"result"
"ppx_derivers"
"odoc" {with-doc}
]
synopsis: "Reason: Syntax & Toolchain for OCaml"
description: """
Reason gives OCaml a new syntax that is remniscient of languages like
JavaScript. It's also the umbrella project for a set of tools for the OCaml &
JavaScript ecosystem."""
build: [
["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/reasonml/reason.git"
8 changes: 0 additions & 8 deletions rtop.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@
"dependencies": {
"@esy-ocaml/substs": "^0.0.1",
"@opam/ocamlfind": "*",
<<<<<<< HEAD
"@opam/result": "*",
"@opam/dune": ">= 2.9.3",
||||||| e745752
"@opam/result": "*",
"@opam/dune": "2.9.3",
=======
"@opam/dune": "2.9.3",
>>>>>>> 0c763cd00440dada442c025c05cdd0e407827a8c
"@opam/reason": "^3.8.0",
"@opam/utop": " >= 1.17.0",
"ocaml": ">= 4.3.0 < 5.1.0"
Expand Down
46 changes: 31 additions & 15 deletions rtop.opam
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
maintainer: "Jordan Walke <jordojw@gmail.com>"
authors: [ "Jordan Walke <jordojw@gmail.com>" ]
version: "3.8.2"
synopsis: "Reason toplevel"
description:
"rtop is the toplevel (or REPL) for Reason, based on utop (https://github.com/diml/utop)."
maintainer: [
"Jordan Walke <jordojw@gmail.com>"
"Antonio Nuno Monteiro <anmonteiro@gmail.com>"
]
authors: ["Jordan Walke <jordojw@gmail.com>"]
license: "MIT"
homepage: "https://github.com/reasonml/reason"
doc: "https://reasonml.github.io/"
homepage: "https://reasonml.github.io/"
bug-reports: "https://github.com/reasonml/reason/issues"
dev-repo: "git+https://github.com/reasonml/reason.git"
tags: [ "syntax" ]
build: [
["dune" "build" "-p" name "-j" jobs]
]
depends: [
"dune" {>= "2.9"}
"ocaml" {>= "4.03" & < "5.1"}
"dune" {>= "2.9.3"}
"reason" {=version}
"reason" {= version}
"utop" {>= "2.0"}
"odoc" {with-doc}
]
synopsis: "Reason toplevel"
description:
"rtop is the toplevel (or REPL) for Reason, based on utop (https://github.com/diml/utop)."

build: [
["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/reasonml/reason.git"

0 comments on commit c6817db

Please sign in to comment.