about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/odoc-parser
diff options
context:
space:
mode:
authorRudi Grinberg <me@rgrinberg.com>2022-01-03 02:02:28 -0700
committerGitHub <noreply@github.com>2022-01-03 10:02:28 +0100
commita7f4d6bae91973b3f8792bc791407dc9979fb960 (patch)
tree96700f3ba5c7a2b602de6603b7bc725915fbbb86 /pkgs/development/ocaml-modules/odoc-parser
parentf08f8d2ae6c7e77aff6ad2a045e64f46f57d2857 (diff)
ocamlformat: 0.20.0 and 0.20.1 (#152199)
* ocaml-version: 3.1.0 -> 3.4.0

* ocamlformat: 0.19.0 -> 0.20.0

* odoc-parser: refactor use version variable

use version to compute the uri for the archive

* odoc-parser: 0.9.0 -> 1.0.0

* odoc-parser: allow multiple versions

allow both 0.9.0 and 1.0.0 to accommodate different version of
ocamlformat

* ocamlformat: 0.20.0 -> 0.20.1
Diffstat (limited to 'pkgs/development/ocaml-modules/odoc-parser')
-rw-r--r--pkgs/development/ocaml-modules/odoc-parser/default.nix18
1 files changed, 14 insertions, 4 deletions
diff --git a/pkgs/development/ocaml-modules/odoc-parser/default.nix b/pkgs/development/ocaml-modules/odoc-parser/default.nix
index a8e6bd2599c33..7a2b5abd974b4 100644
--- a/pkgs/development/ocaml-modules/odoc-parser/default.nix
+++ b/pkgs/development/ocaml-modules/odoc-parser/default.nix
@@ -1,14 +1,24 @@
-{ lib, fetchurl, buildDunePackage, astring, result }:
+{ lib, fetchurl, buildDunePackage, astring, result , version ? "1.0.0" }:
 
+let param = {
+  "1.0.0" = {
+    sha256 = "sha256-tqoI6nGp662bK+vE2h7aDXE882dObVfRBFnZNChueqE=";
+  };
+  "0.9.0" = {
+    sha256 = "sha256-3w2tG605v03mvmZsS2O5c71y66O3W+n3JjFxIbXwvXk=";
+  };
+}."${version}"; in
+
+let v = version; in
 buildDunePackage rec {
   pname = "odoc-parser";
-  version = "0.9.0";
+  inherit version;
 
   minimumOCamlVersion = "4.02";
 
   src = fetchurl {
-    url = "https://github.com/ocaml-doc/odoc-parser/releases/download/0.9.0/odoc-parser-0.9.0.tbz";
-    sha256 = "0ydxy2sj2w9i4vvyjnxplgmp5gbkp5ilnv36pvk4vgrrmldss3fz";
+    url = "https://github.com/ocaml-doc/odoc-parser/releases/download/${version}/odoc-parser-${version}.tbz";
+    inherit (param) sha256;
   };
 
   useDune2 = true;