From 2cf912aa9e029d10dc6896c657e87ed0ce9b967f Mon Sep 17 00:00:00 2001 From: Jochen Bartl Date: Mon, 25 Feb 2019 23:43:35 +0100 Subject: [PATCH] migrate from topkg-jbuilder to dune (#5) --- .merlin | 6 --- Makefile | 24 +++++------ _tags | 5 --- bin/dune | 5 +++ bin/jbuild | 10 ----- doc/style.css | 109 ------------------------------------------------ dune-project | 2 + lib/dune | 8 ++++ lib/jbuild | 15 ------- mrt-format.opam | 16 ++++--- pkg/pkg.ml | 3 -- 11 files changed, 37 insertions(+), 166 deletions(-) delete mode 100644 .merlin delete mode 100644 _tags create mode 100644 bin/dune delete mode 100644 bin/jbuild delete mode 100644 doc/style.css create mode 100644 dune-project create mode 100644 lib/dune delete mode 100644 lib/jbuild delete mode 100644 pkg/pkg.ml diff --git a/.merlin b/.merlin deleted file mode 100644 index eee7aa8..0000000 --- a/.merlin +++ /dev/null @@ -1,6 +0,0 @@ -PKG cstruct logs cstruct.ppx sexplib ipaddr mrt-format alcotest cstruct-lwt -S lib/** -S test/** - -B _build/lib/** -B _build/test/** \ No newline at end of file diff --git a/Makefile b/Makefile index 1e0fd13..d2d60ba 100644 --- a/Makefile +++ b/Makefile @@ -3,37 +3,35 @@ REPO = mrt-format .PHONY: build build: - jbuilder build --dev + dune build .PHONY: clean clean: - jbuilder clean + dune clean .PHONY: test test: - jbuilder runtest --dev + dune runtest .PHONY: install install: - jbuilder build @install - jbuilder install + dune build @install + dune install .PHONY: uninstall uninstall: - jbuilder uninstall + dune uninstall .PHONY: distrib distrib: - [ -x $$(opam config var root)/plugins/opam-publish/repos/$(REPO) ] || \ - opam-publish repo add $(REPO) $(ORG)/$(REPO) - topkg tag - topkg distrib + dune-release tag + dune-release distrib .PHONY: public publish: - topkg publish - topkg opam pkg - topkg opam submit + dune-release publish + dune-release opam pkg + dune-release opam submit .PHONY: release release: distrib publish diff --git a/_tags b/_tags deleted file mode 100644 index 994bcf5..0000000 --- a/_tags +++ /dev/null @@ -1,5 +0,0 @@ -true: package(logs), package(cstruct), package(cstruct.ppx), package(sexplib), package(alcotest), package(lwt), package(cstruct-lwt) -true: package(ipaddr) -"lib" : include -"test": include -true: debug \ No newline at end of file diff --git a/bin/dune b/bin/dune new file mode 100644 index 0000000..851ab9a --- /dev/null +++ b/bin/dune @@ -0,0 +1,5 @@ +(executables + (names omrt updates) + (public_names omrt updates) + (flags :standard -w A-27-32-4-39-8-44-3-6-40-42) + (libraries mrt-format)) diff --git a/bin/jbuild b/bin/jbuild deleted file mode 100644 index fbfa858..0000000 --- a/bin/jbuild +++ /dev/null @@ -1,10 +0,0 @@ -(jbuild_version 1) - -(executables - ((names (omrt updates)) - (public_names (omrt updates)) - (flags (:standard -w "A-27-32-4-39-8-44-3-6-40-42")) - (libraries ( - mrt-format - )) -)) diff --git a/doc/style.css b/doc/style.css deleted file mode 100644 index 4014667..0000000 --- a/doc/style.css +++ /dev/null @@ -1,109 +0,0 @@ -/* A style for ocamldoc. Daniel C. Buenzli */ - -/* Reset a few things. */ -html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre, -a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp, -small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset, -form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td -{ margin: 0; padding: 0; border: 0 none; outline: 0; font-size: 100%; - font-weight: inherit; font-style:inherit; font-family:inherit; - line-height: inherit; vertical-align: baseline; text-align:inherit; - color:inherit; background: transparent; } - -table { border-collapse: collapse; border-spacing: 0; } - -/* Basic page layout */ - -body { font: normal 10pt/1.375em helvetica, arial, sans-serif; text-align:left; - margin: 1.375em 10%; min-width: 40ex; max-width: 72ex; - color: black; background: transparent /* url(line-height-22.gif) */; } - -b { font-weight: bold } -em { font-style: italic } - -tt, code, pre { font-family: WorkAroundWebKitAndMozilla, monospace; - font-size: 1em; } -pre code { font-size : inherit; } -.codepre { margin-bottom:1.375em /* after code example we introduce space. */ } - -.superscript,.subscript -{ font-size : 0.813em; line-height:0; margin-left:0.4ex;} -.superscript { vertical-align: super; } -.subscript { vertical-align: sub; } - -/* ocamldoc markup workaround hacks */ - - - -hr, hr + br, div + br, center + br, span + br, ul + br, ol + br, pre + br -{ display: none } /* annoying */ - -div.info + br { display:block} - -.codepre br + br { display: none } -h1 + pre { margin-bottom:1.375em} /* Toplevel module description */ - -/* Sections and document divisions */ - -/* .navbar { margin-bottom: -1.375em } */ -h1 { font-weight: bold; font-size: 1.5em; /* margin-top:1.833em; */ - margin-top:0.917em; padding-top:0.875em; - border-top-style:solid; border-width:1px; border-color:#AAA; } -h2 { font-weight: bold; font-size: 1.313em; margin-top: 1.048em } -h3 { font-weight: bold; font-size: 1.125em; margin-top: 1.222em } -h3 { font-weight: bold; font-size: 1em; margin-top: 1.375em} -h4 { font-style: italic; } - -/* Used by OCaml's own library documentation. */ - h6 { font-weight: bold; font-size: 1.125em; margin-top: 1.222em } - .h7 { font-weight: bold; font-size: 1em; margin-top: 1.375em } - -p { margin-top: 1.375em } -pre { margin-top: 1.375em } -.info { margin: 0.458em 0em -0.458em 2em;}/* Description of types values etc. */ -td .info { margin:0; padding:0; margin-left: 2em;} /* Description in indexes */ - -ul, ol { margin-top:0.688em; padding-bottom:0.687em; - list-style-position:outside} -ul + p, ol + p { margin-top: 0em } -ul { list-style-type: square } - - -/* h2 + ul, h3 + ul, p + ul { } */ -ul > li { margin-left: 1.375em; } -ol > li { margin-left: 1.7em; } -/* Links */ - -a, a:link, a:visited, a:active, a:hover { color : #00B; text-decoration: none } -a:hover { text-decoration : underline } -*:target {background-color: #FFFF99;} /* anchor highlight */ - -/* Code */ - -.keyword { font-weight: bold; } -.comment { color : red } -.constructor { color : green } -.string { color : brown } -.warning { color : red ; font-weight : bold } - -/* Functors */ - -.paramstable { border-style : hidden ; padding-bottom:1.375em} -.paramstable code { margin-left: 1ex; margin-right: 1ex } -.sig_block {margin-left: 1em} - -/* Images */ - -img { margin-top: 1.375em } - - - - - - - - - - - - diff --git a/dune-project b/dune-project new file mode 100644 index 0000000..bf8b0cc --- /dev/null +++ b/dune-project @@ -0,0 +1,2 @@ +(lang dune 1.0) +(name mrt-format) diff --git a/lib/dune b/lib/dune new file mode 100644 index 0000000..3e95eef --- /dev/null +++ b/lib/dune @@ -0,0 +1,8 @@ +(library + (name mrt) + (public_name mrt-format) + (synopsis "MRT parser library.") + (preprocess + (pps ppx_cstruct)) + (flags :standard -w A-27-32-4-39-8-44-3-6) + (libraries cstruct ipaddr logs result)) diff --git a/lib/jbuild b/lib/jbuild deleted file mode 100644 index 5ac6eae..0000000 --- a/lib/jbuild +++ /dev/null @@ -1,15 +0,0 @@ -(jbuild_version 1) - -(library - ((name mrt) - (public_name mrt-format) - (synopsis "MRT parser library.") - (preprocess (pps (ppx_cstruct))) - (flags (:standard -w "A-27-32-4-39-8-44-3-6")) - (libraries ( - cstruct - ipaddr - logs - result - )) -)) diff --git a/mrt-format.opam b/mrt-format.opam index 7bb30b3..c38f284 100644 --- a/mrt-format.opam +++ b/mrt-format.opam @@ -1,20 +1,23 @@ -opam-version: "1.2" +opam-version: "2.0" maintainer: "Richard Mortier " authors: [ "Richard Mortier" ] license: "ISC" homepage: "https://github.com/mor1/mrt-format" -dev-repo: "https://github.com/mor1/mrt-format.git" +dev-repo: "git+https://github.com/mor1/mrt-format.git" bug-reports: "https://github.com/mor1/mrt-format/issues" doc: "https://mor1.github.io/mrt-format/" build: [ - [ "jbuilder" "subst" ] {pinned} - [ "jbuilder" "build" "-p" name "-j" jobs ] + [ "dune" "subst" ] {pinned} + [ "dune" "build" "-p" name "-j" jobs ] + [ "dune" "runtest" "-p" name "-j" jobs ] {with-test} ] depends: [ - "alcotest" {test} + "ocaml" + "dune" {>= "1.1.0" & build} + "alcotest" {with-test} "cstruct" {>= "1.0.1"} "ipaddr" {>= "2.0.0"} "logs" @@ -22,3 +25,6 @@ depends: [ "ppx_cstruct" {build} "result" ] + +synopsis: "MRT parsing library and CLI" +description: "A basic implementation of the [Multi-Threaded Routing Toolkit](https://tools.ietf.org/html/rfc6396) format, following my implementation in the [Python Routeing Toolkit](https://github.com/mor1/pyrt) and documentation in the [RFC](https://tools.ietf.org/html/rfc6396) and the [PyRT README](https://github.com/mor1/pyrt/blob/master/README.mrtd). Provides (incomplete) parsing libraries and a simple CLI tool." diff --git a/pkg/pkg.ml b/pkg/pkg.ml deleted file mode 100644 index 4d12667..0000000 --- a/pkg/pkg.ml +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ocaml -#use "topfind" -#require "topkg-jbuilder.auto"