From 16dbb35b1ec6513bc6ea5e5424538d42d73588e8 Mon Sep 17 00:00:00 2001 From: Sora Morimoto Date: Thu, 19 Dec 2024 03:13:39 +0900 Subject: [PATCH] Generate opam file with Dune Signed-off-by: Sora Morimoto --- .github/workflows/deploy-doc.yml | 56 ++++++++++++++------ dune-project | 87 +++++++++++++++++++++++++++++++- ocsipersist-dbm-config.opam | 41 +++++++++------ ocsipersist-dbm.opam | 40 ++++++++++----- ocsipersist-dbm.opam.template | 1 + ocsipersist-lib.opam | 36 ++++++++----- ocsipersist-pgsql-config.opam | 41 +++++++++------ ocsipersist-pgsql.opam | 38 +++++++++----- ocsipersist-sqlite-config.opam | 41 ++++++++++----- ocsipersist-sqlite.opam | 38 +++++++++----- ocsipersist.opam | 44 ++++++++++------ 11 files changed, 334 insertions(+), 129 deletions(-) create mode 100644 ocsipersist-dbm.opam.template diff --git a/.github/workflows/deploy-doc.yml b/.github/workflows/deploy-doc.yml index 1a035ca..ee34ee3 100644 --- a/.github/workflows/deploy-doc.yml +++ b/.github/workflows/deploy-doc.yml @@ -1,30 +1,54 @@ -name: Deploy odoc +name: Deploy odoc to GitHub Pages on: push: branches: - master +permissions: read-all + +concurrency: + group: deploy-odoc + cancel-in-progress: true + jobs: - deploy-doc: + deploy-odoc: + name: Deploy odoc to GitHub Pages + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + permissions: + contents: read + id-token: write + pages: write + runs-on: ubuntu-latest - steps: - - name: Install system packages - run: sudo apt-get install -y libgdbm-compat-dev - - name: Checkout code - uses: actions/checkout@v3 + steps: + - name: Checkout tree + uses: actions/checkout@v4 - - name: Use OCaml 4.12.x - uses: ocaml/setup-ocaml@v2 + - name: Set-up OCaml + uses: ocaml/setup-ocaml@v3 with: - ocaml-compiler: 4.12.x - opam-pin: false - opam-depext: false - dune-cache: true + ocaml-compiler: 5 + + - name: Install dependencies + run: opam install . --deps-only --with-doc + + - name: Build documentation + run: opam exec -- dune build @doc - - name: Install libgdbm-dev - run: sudo apt-get install libgdbm-dev + - name: Set-up Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v4 + with: + path: _build/default/_doc/_html - name: Deploy odoc to GitHub Pages - uses: ocaml/setup-ocaml/deploy-doc@v2 + id: deployment + uses: actions/deploy-pages@v4 diff --git a/dune-project b/dune-project index 2fbd98f..3709571 100644 --- a/dune-project +++ b/dune-project @@ -1,2 +1,87 @@ -(lang dune 2.9) +(lang dune 2.8) (name ocsipersist) + +(generate_opam_files true) + +(maintainers "Jan Rochel ") +(authors "Ocsigen team ") +(license "LGPL-2.1-only WITH OCaml-LGPL-linking-exception") +(source (github ocsigen/ocsipersist)) + +(package + (name ocsipersist) + (synopsis "Persistent key-value storage for OCaml using multiple backends") + (description "This is an virtual library defining a unified frontend for a number of key-value storage implementations. Implementations of the following backends currently exist: DBM, PostgreSQL, SQLite.") + (depends + (ocsipersist-lib (= :version)) + (lwt (>= 4.2.0))) + (conflicts + (ocsipersist-dbm (<> :version)) + (ocsipersist-pgsql (<> :version)) + (ocsipersist-sqlite (<> :version)))) + +(package + (name ocsipersist-dbm) + (synopsis "Persistent key/value storage for OCaml using DBM") + (description "This library provides a DBM backend for the unified key/value storage frontend as defined in the ocsipersist package.") + (depends + (ocsipersist (= :version)) + (lwt (>= 4.2.0)) + lwt_log + dbm)) + +(package + (name ocsipersist-dbm-config) + (synopsis "Ocsigen Server configuration file extension for ocsipersist-dbm") + (description "Load this package from Ocsigen Server's configuration file if you want to use the DBM storage backend.") + (depends + (ocsipersist-dbm (= :version)) + (ocsigenserver (>= 3.0.0)) + xml-light)) + +(package + (name ocsipersist-lib) + (synopsis "Persistent key/value storage for OCaml - support library") + (description "This library defines signatures and auxiliary tools for defining backends for the Ocsipersist frontent. Ocsipersist is used pervasively in Eliom/Ocsigen to handle sessions and references. It can be used as an extension for ocsigenserver or as a library. Implementations of the following backends currently exist: DBM, PostgreSQL, SQLite.") + (depends + (lwt (>= 4.2.0)) + (lwt_ppx (>= 2.0.0)))) + +(package + (name ocsipersist-pgsql) + (synopsis "Persistent key/value storage for OCaml using PostgreSQL") + (description "This library provides a PostgreSQL backend for the unified key/value storage frontend as defined in the ocsipersist package.") + (depends + (ocaml (>= 4.08)) + (ocsipersist (= :version)) + (lwt (>= 4.2.0)) + lwt_log + pgocaml)) + +(package + (name ocsipersist-pgsql-config) + (synopsis "Ocsigen Server configuration file extension for ocsipersist-pgsql") + (description "Load this package from Ocsigen Server's configuration file if you want to use the PostgreSQL storage backend.") + (depends + (ocsipersist-pgsql (= :version)) + (ocsigenserver (>= 3.0.0)) + xml-light)) + +(package + (name ocsipersist-sqlite) + (synopsis "Persistent key/value storage for OCaml using SQLite") + (description "This library provides a SQLite backend for the unified key/value storage frontend as defined in the ocsipersist package.") + (depends + (lwt (>= 4.2.0)) + lwt_log + ocsipersist + sqlite3)) + +(package + (name ocsipersist-sqlite-config) + (synopsis "Ocsigen Server configuration file extension for ocsipersist-sqlite") + (description "Load this package from Ocsigen Server's configuration file if you want to use the SQLite storage backend.") + (depends + (ocsipersist-sqlite (= :version)) + (ocsigenserver (>= 3.0.0)) + xml-light)) diff --git a/ocsipersist-dbm-config.opam b/ocsipersist-dbm-config.opam index e39a01b..6b5726b 100644 --- a/ocsipersist-dbm-config.opam +++ b/ocsipersist-dbm-config.opam @@ -1,21 +1,32 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -name: "ocsipersist-dbm-config" -version: "2.0.0" -authors: "The Ocsigen team " -maintainer: "Jan Rochel " -license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" -synopsis: "Ocsigen Server configuration file extension for ocsipersist-dbm" -description: "Load this package from Ocsigen Server's configuration file if you want to use the DBM storage backend." - +synopsis: "Ocsigen Server configuration file extension for ocsipersist-dbm" +description: + "Load this package from Ocsigen Server's configuration file if you want to use the DBM storage backend." +maintainer: ["Jan Rochel "] +authors: ["Ocsigen team "] +license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" homepage: "https://github.com/ocsigen/ocsipersist" bug-reports: "https://github.com/ocsigen/ocsipersist/issues" -dev-repo: "git+https://github.com/ocsigen/ocsipersist.git" -build: [ "dune" "build" "-p" name "-j" jobs ] - -available: [ os != "macos" ] depends: [ - "dune" {>= "2.9"} - "xml-light" + "dune" {>= "2.8"} + "ocsipersist-dbm" {= version} "ocsigenserver" {>= "3.0.0"} - "ocsipersist-dbm" {>= "2.0.0" & < "2.1.0"} + "xml-light" + "odoc" {with-doc} ] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/ocsigen/ocsipersist.git" diff --git a/ocsipersist-dbm.opam b/ocsipersist-dbm.opam index c3b36e3..4830e34 100644 --- a/ocsipersist-dbm.opam +++ b/ocsipersist-dbm.opam @@ -1,22 +1,34 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -name: "ocsipersist-dbm" -version: "2.0.0" -authors: "The Ocsigen team " -maintainer: "Jan Rochel " -license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" -synopsis: "Persistent key/value storage for OCaml using DBM" -description: "This library provides a DBM backend for the unified key/value storage frontend as defined in the ocsipersist package." - +synopsis: "Persistent key/value storage for OCaml using DBM" +description: + "This library provides a DBM backend for the unified key/value storage frontend as defined in the ocsipersist package." +maintainer: ["Jan Rochel "] +authors: ["Ocsigen team "] +license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" homepage: "https://github.com/ocsigen/ocsipersist" bug-reports: "https://github.com/ocsigen/ocsipersist/issues" -dev-repo: "git+https://github.com/ocsigen/ocsipersist.git" -build: [ "dune" "build" "-p" name "-j" jobs ] - -available: [ os != "macos" ] depends: [ - "dune" {>= "2.9"} + "dune" {>= "2.8"} + "ocsipersist" {= version} "lwt" {>= "4.2.0"} "lwt_log" - "ocsipersist" {>= "2.0.0" & < "2.1.0"} "dbm" + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] ] +dev-repo: "git+https://github.com/ocsigen/ocsipersist.git" +available: [os != "macos"] diff --git a/ocsipersist-dbm.opam.template b/ocsipersist-dbm.opam.template new file mode 100644 index 0000000..014e44e --- /dev/null +++ b/ocsipersist-dbm.opam.template @@ -0,0 +1 @@ +available: [os != "macos"] diff --git a/ocsipersist-lib.opam b/ocsipersist-lib.opam index bc06ee5..f9abe78 100644 --- a/ocsipersist-lib.opam +++ b/ocsipersist-lib.opam @@ -1,19 +1,31 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -name: "ocsipersist-lib" -version: "2.0.0" -authors: "The Ocsigen team " -maintainer: "Jan Rochel " -license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" -synopsis: "Persistent key/value storage for OCaml - support library" -description: "This library defines signatures and auxiliary tools for defining backends for the Ocsipersist frontent. Ocsipersist is used pervasively in Eliom/Ocsigen to handle sessions and references. It can be used as an extension for ocsigenserver or as a library. Implementations of the following backends currently exist: DBM, PostgreSQL, SQLite." - +synopsis: "Persistent key/value storage for OCaml - support library" +description: + "This library defines signatures and auxiliary tools for defining backends for the Ocsipersist frontent. Ocsipersist is used pervasively in Eliom/Ocsigen to handle sessions and references. It can be used as an extension for ocsigenserver or as a library. Implementations of the following backends currently exist: DBM, PostgreSQL, SQLite." +maintainer: ["Jan Rochel "] +authors: ["Ocsigen team "] +license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" homepage: "https://github.com/ocsigen/ocsipersist" bug-reports: "https://github.com/ocsigen/ocsipersist/issues" -dev-repo: "git+https://github.com/ocsigen/ocsipersist.git" -build: [ "dune" "build" "-p" name "-j" jobs ] - depends: [ - "dune" {>= "2.9"} + "dune" {>= "2.8"} "lwt" {>= "4.2.0"} "lwt_ppx" {>= "2.0.0"} + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] ] +dev-repo: "git+https://github.com/ocsigen/ocsipersist.git" diff --git a/ocsipersist-pgsql-config.opam b/ocsipersist-pgsql-config.opam index 7366cf6..a38df82 100644 --- a/ocsipersist-pgsql-config.opam +++ b/ocsipersist-pgsql-config.opam @@ -1,21 +1,32 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -name: "ocsipersist-pgsql-config" -version: "2.0.0" -authors: "The Ocsigen team " -maintainer: "Jan Rochel " -license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" -synopsis: "Ocsigen Server configuration file extension for ocsipersist-pgsql" -description: "Load this package from Ocsigen Server's configuration file if you want to use the PostgreSQL storage backend." - +synopsis: "Ocsigen Server configuration file extension for ocsipersist-pgsql" +description: + "Load this package from Ocsigen Server's configuration file if you want to use the PostgreSQL storage backend." +maintainer: ["Jan Rochel "] +authors: ["Ocsigen team "] +license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" homepage: "https://github.com/ocsigen/ocsipersist" bug-reports: "https://github.com/ocsigen/ocsipersist/issues" -dev-repo: "git+https://github.com/ocsigen/ocsipersist.git" -build: [ "dune" "build" "-p" name "-j" jobs ] - depends: [ - "ocaml" {>= "4.08"} - "dune" {>= "2.9"} - "xml-light" + "dune" {>= "2.8"} + "ocsipersist-pgsql" {= version} "ocsigenserver" {>= "3.0.0"} - "ocsipersist-pgsql" {>= "2.0.0" & < "2.1.0"} + "xml-light" + "odoc" {with-doc} ] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/ocsigen/ocsipersist.git" diff --git a/ocsipersist-pgsql.opam b/ocsipersist-pgsql.opam index 695624a..b5131d6 100644 --- a/ocsipersist-pgsql.opam +++ b/ocsipersist-pgsql.opam @@ -1,22 +1,34 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -name: "ocsipersist-pgsql" -version: "2.0.0" -authors: "The Ocsigen team " -maintainer: "Jan Rochel " -license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" -synopsis: "Persistent key/value storage for OCaml using PostgreSQL" -description: "This library provides a PostgreSQL backend for the unified key/value storage frontend as defined in the ocsipersist package." - +synopsis: "Persistent key/value storage for OCaml using PostgreSQL" +description: + "This library provides a PostgreSQL backend for the unified key/value storage frontend as defined in the ocsipersist package." +maintainer: ["Jan Rochel "] +authors: ["Ocsigen team "] +license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" homepage: "https://github.com/ocsigen/ocsipersist" bug-reports: "https://github.com/ocsigen/ocsipersist/issues" -dev-repo: "git+https://github.com/ocsigen/ocsipersist.git" -build: [ "dune" "build" "-p" name "-j" jobs ] - depends: [ + "dune" {>= "2.8"} "ocaml" {>= "4.08"} - "dune" {>= "2.9"} + "ocsipersist" {= version} "lwt" {>= "4.2.0"} "lwt_log" - "ocsipersist" {>= "2.0.0" & < "2.1.0"} "pgocaml" + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] ] +dev-repo: "git+https://github.com/ocsigen/ocsipersist.git" diff --git a/ocsipersist-sqlite-config.opam b/ocsipersist-sqlite-config.opam index c376633..c986950 100644 --- a/ocsipersist-sqlite-config.opam +++ b/ocsipersist-sqlite-config.opam @@ -1,20 +1,33 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -name: "ocsipersist-sqlite-config" -version: "2.0.0" -authors: "The Ocsigen team " -maintainer: "Jan Rochel " -license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" -synopsis: "Ocsigen Server configuration file extension for ocsipersist-sqlite" -description: "Load this package from Ocsigen Server's configuration file if you want to use the SQLite storage backend." - +synopsis: + "Ocsigen Server configuration file extension for ocsipersist-sqlite" +description: + "Load this package from Ocsigen Server's configuration file if you want to use the SQLite storage backend." +maintainer: ["Jan Rochel "] +authors: ["Ocsigen team "] +license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" homepage: "https://github.com/ocsigen/ocsipersist" bug-reports: "https://github.com/ocsigen/ocsipersist/issues" -dev-repo: "git+https://github.com/ocsigen/ocsipersist.git" -build: [ "dune" "build" "-p" name "-j" jobs ] - depends: [ - "dune" {>= "2.9"} - "xml-light" + "dune" {>= "2.8"} + "ocsipersist-sqlite" {= version} "ocsigenserver" {>= "3.0.0"} - "ocsipersist-sqlite" {>= "2.0.0" & < "2.1.0"} + "xml-light" + "odoc" {with-doc} ] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/ocsigen/ocsipersist.git" diff --git a/ocsipersist-sqlite.opam b/ocsipersist-sqlite.opam index dfc4c06..6beaceb 100644 --- a/ocsipersist-sqlite.opam +++ b/ocsipersist-sqlite.opam @@ -1,21 +1,33 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -name: "ocsipersist-sqlite" -version: "2.0.0" -authors: "The Ocsigen team " -maintainer: "Jan Rochel " -license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" -synopsis: "Persistent key/value storage for OCaml using SQLite" -description: "This library provides a SQLite backend for the unified key/value storage frontend as defined in the ocsipersist package." - +synopsis: "Persistent key/value storage for OCaml using SQLite" +description: + "This library provides a SQLite backend for the unified key/value storage frontend as defined in the ocsipersist package." +maintainer: ["Jan Rochel "] +authors: ["Ocsigen team "] +license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" homepage: "https://github.com/ocsigen/ocsipersist" bug-reports: "https://github.com/ocsigen/ocsipersist/issues" -dev-repo: "git+https://github.com/ocsigen/ocsipersist.git" -build: [ "dune" "build" "-p" name "-j" jobs ] - depends: [ - "dune" {>= "2.9"} + "dune" {>= "2.8"} "lwt" {>= "4.2.0"} "lwt_log" - "ocsipersist" {>= "2.0.0" & < "2.1.0"} + "ocsipersist" "sqlite3" + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] ] +dev-repo: "git+https://github.com/ocsigen/ocsipersist.git" diff --git a/ocsipersist.opam b/ocsipersist.opam index 3ceab19..1a8538b 100644 --- a/ocsipersist.opam +++ b/ocsipersist.opam @@ -1,24 +1,36 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -name: "ocsipersist" -version: "2.0.0" -authors: "The Ocsigen team " -maintainer: "Jan Rochel " -license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" -synopsis: "Persistent key-value storage for OCaml using multiple backends" -description: "This is an virtual library defining a unified frontend for a number of key-value storage implementations. Implementations of the following backends currently exist: DBM, PostgreSQL, SQLite." - +synopsis: "Persistent key-value storage for OCaml using multiple backends" +description: + "This is an virtual library defining a unified frontend for a number of key-value storage implementations. Implementations of the following backends currently exist: DBM, PostgreSQL, SQLite." +maintainer: ["Jan Rochel "] +authors: ["Ocsigen team "] +license: "LGPL-2.1-only WITH OCaml-LGPL-linking-exception" homepage: "https://github.com/ocsigen/ocsipersist" bug-reports: "https://github.com/ocsigen/ocsipersist/issues" -dev-repo: "git+https://github.com/ocsigen/ocsipersist.git" -build: [ "dune" "build" "-p" name "-j" jobs ] - depends: [ - "dune" {>= "2.9"} + "dune" {>= "2.8"} + "ocsipersist-lib" {= version} "lwt" {>= "4.2.0"} - "ocsipersist-lib" {>= "2.0.0" & < "3.0.0"} + "odoc" {with-doc} ] conflicts: [ - "ocsipersist-dbm" {< "2.0.0" | >= "2.1.0"} - "ocsipersist-pgsql" {< "2.0.0" | >= "2.1.0"} - "ocsipersist-sqlite" {< "2.0.0" | >= "2.1.0"} + "ocsipersist-dbm" {!= version} + "ocsipersist-pgsql" {!= version} + "ocsipersist-sqlite" {!= version} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] ] +dev-repo: "git+https://github.com/ocsigen/ocsipersist.git"