forked from mirage/mirage-clock
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
port to dune and port opam metadata to 2.0
* Port library to Dune from jbuilder and the builtin `dune.configurator` to reduce the build dependency cone * Remove unused variable warnings (@avsm). * Update opam package metadata to 2.0 format (@avsm).
- Loading branch information
Showing
26 changed files
with
149 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,19 @@ | ||
|
||
.PHONY: build clean test | ||
|
||
build: | ||
jbuilder build @install | ||
dune build @install | ||
|
||
test: | ||
jbuilder runtest | ||
dune runtest | ||
|
||
install: | ||
jbuilder install | ||
dune install | ||
|
||
uninstall: | ||
jbuilder uninstall | ||
|
||
clean: | ||
rm -rf _build *.install | ||
dune uninstall | ||
|
||
REPO=../../mirage/opam-repository | ||
PACKAGES=$(REPO)/packages | ||
# until we have https://github.com/ocaml/opam-publish/issues/38 | ||
pkg-%: | ||
topkg opam pkg -n $* | ||
mkdir -p $(PACKAGES)/$* | ||
cp -r _build/$*.* $(PACKAGES)/$*/ | ||
cd $(PACKAGES) && git add $* | ||
doc: | ||
dune build @doc | ||
|
||
PKGS=$(basename $(wildcard *.opam)) | ||
opam-pkg: | ||
$(MAKE) $(PKGS:%=pkg-%) | ||
clean: | ||
dune clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
open Base | ||
open Stdio | ||
module C = Configurator | ||
|
||
let write_sexp fn sexp = | ||
Out_channel.write_all fn ~data:(Sexp.to_string sexp) | ||
module C = Configurator.V1 | ||
|
||
let () = | ||
C.main ~name:"mirage-clock-unix" (fun c -> | ||
let ccflags = | ||
match C.ocaml_config_var c "system" with | ||
| Some "linux" -> ["-lrt"] | ||
| _ -> [] in | ||
write_sexp "cclib.sexp" (Sexp.List (List.map ~f:(fun x -> Sexp.Atom x) ccflags)); | ||
Out_channel.write_all "cclib" ~data:(String.concat ccflags ~sep:" ") | ||
C.Flags.write_sexp "cclib.sexp" ccflags; | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(executables | ||
(names discover) | ||
(libraries dune.configurator)) | ||
|
||
(rule | ||
(targets cclib.sexp) | ||
(deps discover.exe) | ||
(action (run ./discover.exe))) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
(lang dune 1.0) | ||
(name mirage-clock) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(library | ||
(name mirage_clock_freestanding) | ||
(wrapped false) | ||
(public_name mirage-clock-freestanding) | ||
(libraries mirage-clock mirage-clock-lwt)) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(test | ||
(name portable) | ||
(libraries lwt.unix mirage-clock-unix)) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(library | ||
(name mirage_clock_lwt) | ||
(public_name mirage-clock-lwt) | ||
(libraries mirage-clock lwt)) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
opam-version: "1.2" | ||
authors: ["Anil Madhavapeddy" "Daniel C. Bünzli" "Matthew Gray"] | ||
opam-version: "2.0" | ||
maintainer: "anil@recoil.org" | ||
authors: ["Anil Madhavapeddy" "Daniel C. Bünzli" "Matthew Gray"] | ||
license: "ISC" | ||
tags: "org:mirage" | ||
homepage: "https://github.com/mirage/mirage-clock" | ||
bug-reports: "https://github.com/mirage/mirage-clock/issues" | ||
dev-repo: "git://github.com/mirage/mirage-clock" | ||
license: "ISC" | ||
tags: ["org:mirage"] | ||
synopsis: "Paravirtual implementation of the MirageOS Clock interface" | ||
description: """ | ||
This 'freestanding' implementation of the MirageOS CLOCK interface | ||
is designed to be linked against an embedded runtime that provides | ||
a concrete implementation of the clock source. Example implementations | ||
include the [Solo5](https://github.com/solo5/solo5) backend of | ||
MirageOS. | ||
""" | ||
depends: [ | ||
"jbuilder" {build & >="1.0+beta9"} | ||
"mirage-clock" {>= "1.2.0"} | ||
"mirage-clock-lwt" {>= "1.2.0"} | ||
"ocaml" {>= "4.04.2"} | ||
"dune" {build} | ||
"mirage-clock" {>= version} | ||
"mirage-clock-lwt" {>= version} | ||
"lwt" | ||
] | ||
build: [ | ||
[ "jbuilder" "subst" ] {pinned} | ||
[ "jbuilder" "build" "-p" name "-j" jobs ] | ||
["dune" "subst"] {pinned} | ||
["dune" "build" "-p" name "-j" jobs] | ||
] | ||
available: [ ocaml-version >= "4.04.2" ] | ||
dev-repo: "git://github.com/mirage/mirage-clock" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
opam-version: "1.2" | ||
authors: ["Anil Madhavapeddy" "Daniel C. Bünzli" "Matthew Gray"] | ||
maintainer: "anil@recoil.org" | ||
homepage: "https://github.com/mirage/mirage-clock" | ||
bug-reports: "https://github.com/mirage/mirage-clock/issues" | ||
dev-repo: "https://github.com/mirage/mirage-clock.git" | ||
doc: "https://mirage.github.io/mirage-clock/" | ||
license: "ISC" | ||
tags: ["org:mirage"] | ||
|
||
opam-version: "2.0" | ||
maintainer: "anil@recoil.org" | ||
authors: ["Anil Madhavapeddy" "Daniel C. Bünzli" "Matthew Gray"] | ||
license: "ISC" | ||
tags: "org:mirage" | ||
homepage: "https://github.com/mirage/mirage-clock" | ||
doc: "https://mirage.github.io/mirage-clock/" | ||
bug-reports: "https://github.com/mirage/mirage-clock/issues" | ||
synopsis: "Lwt-based implementation of the MirageOS Clock interface" | ||
description: """ | ||
This implementation of the MirageOS CLOCK interface specialises | ||
the `io` type to use the Lwt concurrency monad. | ||
""" | ||
depends: [ | ||
"jbuilder" {build & >="1.0+beta9"} | ||
"mirage-clock" {>= "1.2.0"} | ||
"ocaml" {>= "4.04.2"} | ||
"dune" {build} | ||
"mirage-clock" {>= version} | ||
"lwt" | ||
] | ||
build: [ | ||
[ "jbuilder" "subst" ] {pinned} | ||
[ "jbuilder" "build" "-p" name "-j" jobs ] | ||
["dune" "subst"] {pinned} | ||
["dune" "build" "-p" name "-j" jobs] | ||
] | ||
available: [ ocaml-version >= "4.04.2" ] | ||
dev-repo: "git+https://github.com/mirage/mirage-clock.git" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
opam-version: "1.2" | ||
authors: ["Anil Madhavapeddy" "Daniel C. Bünzli" "Matthew Gray"] | ||
maintainer: "anil@recoil.org" | ||
homepage: "https://github.com/mirage/mirage-clock" | ||
bug-reports: "https://github.com/mirage/mirage-clock/issues" | ||
dev-repo: "https://github.com/mirage/mirage-clock.git" | ||
doc: "https://mirage.github.io/mirage-clock/" | ||
license: "ISC" | ||
tags: ["org:mirage"] | ||
|
||
opam-version: "2.0" | ||
maintainer: "anil@recoil.org" | ||
authors: ["Anil Madhavapeddy" "Daniel C. Bünzli" "Matthew Gray"] | ||
license: "ISC" | ||
tags: "org:mirage" | ||
homepage: "https://github.com/mirage/mirage-clock" | ||
doc: "https://mirage.github.io/mirage-clock/" | ||
bug-reports: "https://github.com/mirage/mirage-clock/issues" | ||
synopsis: "Unix-based implementation for the MirageOS Clock interface" | ||
description: """ | ||
The Unix implementation of the MirageOS Clock interface uses | ||
`gettimeofday` or `clock_gettime`, depending on | ||
which OS is in use (see [clock_stubs.c](https://github.com/mirage/mirage-clock/blob/master/unix/clock_stubs.c)). | ||
""" | ||
depends: [ | ||
"jbuilder" {build & >="1.0+beta9"} | ||
"mirage-clock" {>= "1.2.0"} | ||
"mirage-clock-lwt" {>= "1.2.0"} | ||
"ocaml" {>= "4.04.2"} | ||
"dune" {build} | ||
"mirage-clock" {>= version} | ||
"mirage-clock-lwt" {>= versionn} | ||
"lwt" | ||
"configurator" {build} | ||
] | ||
build: [ | ||
[ "jbuilder" "subst" ] {pinned} | ||
[ "jbuilder" "build" "-p" name "-j" jobs ] | ||
["dune" "subst"] {pinned} | ||
["dune" "build" "-p" name "-j" jobs] | ||
["dune" "runtest" "-p" name] {with-test} | ||
] | ||
build-test: ["jbuilder" "runtest" "-p" name] | ||
available: [ ocaml-version >= "4.04.2" ] | ||
dev-repo: "git+https://github.com/mirage/mirage-clock.git" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,28 @@ | ||
opam-version: "1.2" | ||
authors: ["Anil Madhavapeddy" "Daniel C. Bünzli" "Matthew Gray"] | ||
maintainer: "anil@recoil.org" | ||
homepage: "https://github.com/mirage/mirage-clock" | ||
bug-reports: "https://github.com/mirage/mirage-clock/issues" | ||
dev-repo: "https://github.com/mirage/mirage-clock.git" | ||
doc: "https://mirage.github.io/mirage-clock/" | ||
license: "ISC" | ||
tags: ["org:mirage"] | ||
opam-version: "2.0" | ||
maintainer: "anil@recoil.org" | ||
authors: ["Anil Madhavapeddy" "Daniel C. Bünzli" "Matthew Gray"] | ||
license: "ISC" | ||
tags: "org:mirage" | ||
homepage: "https://github.com/mirage/mirage-clock" | ||
doc: "https://mirage.github.io/mirage-clock/" | ||
bug-reports: "https://github.com/mirage/mirage-clock/issues" | ||
synopsis: "Libraries and module types for portable clocks" | ||
description: """ | ||
This library implements portable support for an operating system timesource | ||
that is compatible with the [MirageOS](https://mirage.io) library interfaces | ||
found in: <https://github.com/mirage/mirage> | ||
|
||
It implements an `MCLOCK` module that represents a monotonic timesource | ||
since an arbitrary point, and `PCLOCK` which counts time since the Unix | ||
epoch. | ||
""" | ||
depends: [ | ||
"jbuilder" {build & >="1.0+beta9"} | ||
"ocaml" {>= "4.04.2"} | ||
"dune" {build} | ||
"mirage-device" {>= "1.0.0"} | ||
] | ||
build: [ | ||
[ "jbuilder" "subst" ] {pinned} | ||
[ "jbuilder" "build" "-p" name "-j" jobs ] | ||
["dune" "subst"] {pinned} | ||
["dune" "build" "-p" name "-j" jobs] | ||
] | ||
available: [ ocaml-version >= "4.04.2" ] | ||
dev-repo: "git+https://github.com/mirage/mirage-clock.git" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(library | ||
(name mirage_clock) | ||
(public_name mirage-clock) | ||
(libraries mirage-device)) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(library | ||
(name mirage_clock_unix) | ||
(wrapped false) | ||
(public_name mirage-clock-unix) | ||
(libraries mirage-clock mirage-clock-lwt) | ||
(c_names clock_stubs) | ||
(c_flags ((:standard \ -Wall -g -O2))) | ||
(c_library_flags (:standard (:include ../config/cclib.sexp)))) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.