From c66d7c04779e2a74ad57594e7435839e7ab76a48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Tue, 15 Oct 2024 19:41:47 +0200 Subject: [PATCH] Update to Dune 3.16 and generate opam file --- dune-project | 41 +++++++++++++++++++++++++++++++++++++++- extlib.opam | 53 +++++++++++++++++++++++++++++++--------------------- src/dune | 2 +- test/dune | 14 +++++--------- 4 files changed, 78 insertions(+), 32 deletions(-) diff --git a/dune-project b/dune-project index a4628e7..8962d28 100644 --- a/dune-project +++ b/dune-project @@ -1,2 +1,41 @@ -(lang dune 1.0) +(lang dune 3.16) (name extlib) + +(generate_opam_files true) +(formatting (enabled_for dune)) + +(source (github ygrek/ocaml-extlib)) +(documentation "https://ygrek.org/p/extlib/doc/") +(maintainers "ygrek@autistici.org") +(license "LGPL-2.1-only WITH OCaml-LGPL-linking-exception") + +(package + (name extlib) + (synopsis "A complete yet small extension for OCaml standard library") + (description + "The purpose of this library is to add new functions to OCaml standard library +modules, to modify some functions in order to get better performances or +safety (tail-recursive) and also to provide new modules which should be useful +for day to day programming. + +Current goal is to maintain compatibility, new software is encouraged to not use extlib since stdlib +is now seeing many additions and improvements which make many parts of extlib obsolete. +For tail-recursion safety consider using other libraries e.g. containers. +") + (authors + "Nicolas Cannasse" + "Brian Hurt" + "Yamagata Yoriyuki" + "Markus Mottl" + "Jesse Guardiani" + "John Skaller" + "Bardur Arantsson" + "Janne Hellsten" + "Richard W.M. Jones" + "ygrek" + "Gabriel Scherer" + "Pietro Abate") + (depends + (ocaml (>= "4.02")) + (cppo (and :build (>= "1.0.1"))))) + diff --git a/extlib.opam b/extlib.opam index d5978f7..ad1adca 100644 --- a/extlib.opam +++ b/extlib.opam @@ -1,10 +1,17 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -maintainer: "ygrek@autistici.org" -homepage: "https://github.com/ygrek/ocaml-extlib" -dev-repo: "git+https://github.com/ygrek/ocaml-extlib.git" -bug-reports: "https://github.com/ygrek/ocaml-extlib/issues" -doc: ["https://ygrek.org/p/extlib/doc/"] -license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" +synopsis: "A complete yet small extension for OCaml standard library" +description: """ +The purpose of this library is to add new functions to OCaml standard library +modules, to modify some functions in order to get better performances or +safety (tail-recursive) and also to provide new modules which should be useful +for day to day programming. + +Current goal is to maintain compatibility, new software is encouraged to not use extlib since stdlib +is now seeing many additions and improvements which make many parts of extlib obsolete. +For tail-recursion safety consider using other libraries e.g. containers. +""" +maintainer: ["ygrek@autistici.org"] authors: [ "Nicolas Cannasse" "Brian Hurt" @@ -19,24 +26,28 @@ authors: [ "Gabriel Scherer" "Pietro Abate" ] +license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" +homepage: "https://github.com/ygrek/ocaml-extlib" +doc: "https://ygrek.org/p/extlib/doc/" +bug-reports: "https://github.com/ygrek/ocaml-extlib/issues" depends: [ - "dune" {>= "1.0"} + "dune" {>= "3.16"} "ocaml" {>= "4.02"} "cppo" {build & >= "1.0.1"} + "odoc" {with-doc} ] -synopsis: - "A complete yet small extension for OCaml standard library" -description: """ -The purpose of this library is to add new functions to OCaml standard library -modules, to modify some functions in order to get better performances or -safety (tail-recursive) and also to provide new modules which should be useful -for day to day programming. - -Current goal is to maintain compatibility, new software is encouraged to not use extlib since stdlib -is now seeing many additions and improvements which make many parts of extlib obsolete. -For tail-recursion safety consider using other libraries e.g. containers. -""" build: [ - ["dune" "build" "-p" name "-j" jobs] - ["dune" "runtest" "-p" name "-j" jobs] {with-test} + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] ] +dev-repo: "git+https://github.com/ygrek/ocaml-extlib.git" diff --git a/src/dune b/src/dune index bf962fa..99208b1 100644 --- a/src/dune +++ b/src/dune @@ -2,7 +2,7 @@ (name extlib) (public_name extlib) (modules :standard \ configure install base64 unzip uChar uTF8) - (flags :standard -w -3-6-9-27-32-33-35-39-50) + (flags :standard -w -3-6-9-27-32-33-35-39-50-69) (preprocess (action (run %{bin:cppo} %{read-lines:compat-level} %{input-file}))) diff --git a/test/dune b/test/dune index cc5acde..1ce013b 100644 --- a/test/dune +++ b/test/dune @@ -1,9 +1,5 @@ -(executable - (name runner) - (flags :standard -w -3-6-35-27) - (modules :standard \ test_Unzip test_UTF8 test_Base64) - (libraries extlib)) - -(alias - (name runtest) - (action (run ./runner.exe))) +(test + (name runner) + (flags :standard -w -3-6-35-27) + (modules :standard \ test_Unzip test_UTF8 test_Base64) + (libraries extlib))