From 92cebed2f9f5342604f4e594f3d1e8acd305dd29 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 9 Mar 2023 18:18:59 +0100 Subject: [PATCH 1/4] ocamlPackages.http-mirage-client: init at 0.0.2 --- .../http-mirage-client/default.nix | 63 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 + 2 files changed, 65 insertions(+) create mode 100644 pkgs/development/ocaml-modules/http-mirage-client/default.nix diff --git a/pkgs/development/ocaml-modules/http-mirage-client/default.nix b/pkgs/development/ocaml-modules/http-mirage-client/default.nix new file mode 100644 index 000000000000..08b3758d53ed --- /dev/null +++ b/pkgs/development/ocaml-modules/http-mirage-client/default.nix @@ -0,0 +1,63 @@ +{ lib +, fetchurl +, fetchpatch +, buildDunePackage +, h2 +, httpaf +, mimic-happy-eyeballs +, mirage-clock +, paf +, tcpip +, x509 +, alcotest-lwt +, mirage-clock-unix +, mirage-crypto-rng +, mirage-time-unix +}: + +buildDunePackage rec { + pname = "http-mirage-client"; + version = "0.0.2"; + + duneVersion = "3"; + minimalOCamlVersion = "4.08"; + + src = fetchurl { + url = "https://github.com/roburio/http-mirage-client/releases/download/v${version}/http-mirage-client-${version}.tbz"; + hash = "sha256-stom13t3Kn1ehkeURem39mxhd3Lmlz8z9m3tHGcp5vY="; + }; + + # Make tests use mirage-crypto + patches = lib.lists.map fetchpatch [ + { url = "https://github.com/roburio/http-mirage-client/commit/c6cd38db9c23ac23e7c3e4cf2d41420f58034e8d.patch"; + hash = "sha256-b3rurqF0DxLpVQEhVfROwc7qyul0Fjfl3zhD8AkzemU="; } + { url = "https://github.com/roburio/http-mirage-client/commit/0a5367e7c6d9b7f45c88493f7a596f7a83e8c7d5.patch"; + hash = "sha256-Q6YlfuiAfsyhty9EvoBetvekuU25KjrH5wwGwYTAAiA="; } + ]; + + propagatedBuildInputs = [ + h2 + httpaf + mimic-happy-eyeballs + mirage-clock + paf + tcpip + x509 + ]; + + doCheck = true; + checkInputs = [ + alcotest-lwt + mirage-clock-unix + mirage-crypto-rng + mirage-time-unix + ]; + + meta = { + description = "HTTP client for MirageOS"; + homepage = "https://github.com/roburio/http-mirage-client"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + }; + +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 43e8cba683cf..116717a9d747 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -569,6 +569,8 @@ let hpack = callPackage ../development/ocaml-modules/hpack { }; + http-mirage-client = callPackage ../development/ocaml-modules/http-mirage-client { }; + hxd = callPackage ../development/ocaml-modules/hxd { }; imagelib = callPackage ../development/ocaml-modules/imagelib { }; From 28716c579465ab66c1408ad8dd303aa232ab01f1 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 9 Mar 2023 18:19:08 +0100 Subject: [PATCH 2/4] ocamlPackages.chacha: use Dune 3 --- pkgs/development/ocaml-modules/chacha/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/ocaml-modules/chacha/default.nix b/pkgs/development/ocaml-modules/chacha/default.nix index ebd73b519f95..28aaad1c46d8 100644 --- a/pkgs/development/ocaml-modules/chacha/default.nix +++ b/pkgs/development/ocaml-modules/chacha/default.nix @@ -17,7 +17,7 @@ buildDunePackage rec { owner = "abeaumont"; repo = "ocaml-chacha"; rev = version; - sha256 = "sha256-PmeiFloU0k3SqOK1VjaliiCEzDzrzyMSasgnO5fJS1k="; + hash = "sha256-PmeiFloU0k3SqOK1VjaliiCEzDzrzyMSasgnO5fJS1k="; }; # Ensure compatibility with cstruct ≥ 6.1.0 @@ -27,6 +27,7 @@ buildDunePackage rec { })]; minimalOCamlVersion = "4.02"; + duneVersion = "3"; propagatedBuildInputs = [ cstruct mirage-crypto ]; From b9e07a88a2932fd6314c285e9314612f77376b13 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 9 Mar 2023 18:19:14 +0100 Subject: [PATCH 3/4] ocamlPackages.mirage-crypto: use Dune 3 --- pkgs/development/ocaml-modules/mirage-crypto/default.nix | 1 + pkgs/development/ocaml-modules/mirage-crypto/ec.nix | 2 ++ pkgs/development/ocaml-modules/mirage-crypto/pk.nix | 2 ++ pkgs/development/ocaml-modules/mirage-crypto/rng-async.nix | 2 ++ pkgs/development/ocaml-modules/mirage-crypto/rng-lwt.nix | 6 ++++-- pkgs/development/ocaml-modules/mirage-crypto/rng-mirage.nix | 1 + pkgs/development/ocaml-modules/mirage-crypto/rng.nix | 1 + 7 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ocaml-modules/mirage-crypto/default.nix b/pkgs/development/ocaml-modules/mirage-crypto/default.nix index 816709b4cc78..73d0c4fee7cd 100644 --- a/pkgs/development/ocaml-modules/mirage-crypto/default.nix +++ b/pkgs/development/ocaml-modules/mirage-crypto/default.nix @@ -5,6 +5,7 @@ buildDunePackage rec { minimalOCamlVersion = "4.08"; + duneVersion = "3"; pname = "mirage-crypto"; version = "0.11.0"; diff --git a/pkgs/development/ocaml-modules/mirage-crypto/ec.nix b/pkgs/development/ocaml-modules/mirage-crypto/ec.nix index 3afe582413f5..b17182a5efda 100644 --- a/pkgs/development/ocaml-modules/mirage-crypto/ec.nix +++ b/pkgs/development/ocaml-modules/mirage-crypto/ec.nix @@ -24,6 +24,8 @@ buildDunePackage rec { src version; + duneVersion = "3"; + nativeBuildInputs = [ pkg-config ]; buildInputs = [ dune-configurator diff --git a/pkgs/development/ocaml-modules/mirage-crypto/pk.nix b/pkgs/development/ocaml-modules/mirage-crypto/pk.nix index b79f49c64bd4..e50838e50bbb 100644 --- a/pkgs/development/ocaml-modules/mirage-crypto/pk.nix +++ b/pkgs/development/ocaml-modules/mirage-crypto/pk.nix @@ -6,6 +6,8 @@ buildDunePackage rec { inherit (mirage-crypto) version src; + duneVersion = "3"; + buildInputs = [ gmp ]; propagatedBuildInputs = [ cstruct mirage-crypto mirage-crypto-rng zarith eqaf sexplib0 ]; diff --git a/pkgs/development/ocaml-modules/mirage-crypto/rng-async.nix b/pkgs/development/ocaml-modules/mirage-crypto/rng-async.nix index 5752507f9ef9..b9979b446d20 100644 --- a/pkgs/development/ocaml-modules/mirage-crypto/rng-async.nix +++ b/pkgs/development/ocaml-modules/mirage-crypto/rng-async.nix @@ -8,6 +8,8 @@ buildDunePackage { inherit (mirage-crypto) version src; + duneVersion = "3"; + buildInputs = [ dune-configurator ]; diff --git a/pkgs/development/ocaml-modules/mirage-crypto/rng-lwt.nix b/pkgs/development/ocaml-modules/mirage-crypto/rng-lwt.nix index f6ec2a9e3dae..bcaac601c95c 100644 --- a/pkgs/development/ocaml-modules/mirage-crypto/rng-lwt.nix +++ b/pkgs/development/ocaml-modules/mirage-crypto/rng-lwt.nix @@ -1,15 +1,17 @@ { buildDunePackage, mirage-crypto, mirage-crypto-rng, dune-configurator -, duration, logs, mtime, ocaml_lwt }: +, duration, logs, mtime, lwt }: buildDunePackage rec { pname = "mirage-crypto-rng-lwt"; inherit (mirage-crypto) version src; + duneVersion = "3"; + doCheck = true; buildInputs = [ dune-configurator ]; - propagatedBuildInputs = [ mirage-crypto mirage-crypto-rng duration logs mtime ocaml_lwt ]; + propagatedBuildInputs = [ mirage-crypto mirage-crypto-rng duration logs mtime lwt ]; meta = mirage-crypto-rng.meta; } diff --git a/pkgs/development/ocaml-modules/mirage-crypto/rng-mirage.nix b/pkgs/development/ocaml-modules/mirage-crypto/rng-mirage.nix index c3703a5a60ab..3e0cde29c52d 100644 --- a/pkgs/development/ocaml-modules/mirage-crypto/rng-mirage.nix +++ b/pkgs/development/ocaml-modules/mirage-crypto/rng-mirage.nix @@ -7,6 +7,7 @@ buildDunePackage rec { pname = "mirage-crypto-rng-mirage"; inherit (mirage-crypto-rng) version src; + duneVersion = "3"; doCheck = true; checkInputs = [ mirage-unix mirage-clock-unix mirage-time-unix ]; diff --git a/pkgs/development/ocaml-modules/mirage-crypto/rng.nix b/pkgs/development/ocaml-modules/mirage-crypto/rng.nix index 97de946bc2cc..bbc7823e1f09 100644 --- a/pkgs/development/ocaml-modules/mirage-crypto/rng.nix +++ b/pkgs/development/ocaml-modules/mirage-crypto/rng.nix @@ -5,6 +5,7 @@ buildDunePackage rec { pname = "mirage-crypto-rng"; inherit (mirage-crypto) version src; + duneVersion = "3"; doCheck = true; checkInputs = [ ounit2 randomconv ]; From da8360869d6d10895e8b7a6f1578149aac6e0a29 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 9 Mar 2023 18:19:20 +0100 Subject: [PATCH 4/4] ocamlPackages.letsencrypt-mirage: init at 0.5.0 --- .../ocaml-modules/letsencrypt/mirage.nix | 20 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 pkgs/development/ocaml-modules/letsencrypt/mirage.nix diff --git a/pkgs/development/ocaml-modules/letsencrypt/mirage.nix b/pkgs/development/ocaml-modules/letsencrypt/mirage.nix new file mode 100644 index 000000000000..f43ab9812c7e --- /dev/null +++ b/pkgs/development/ocaml-modules/letsencrypt/mirage.nix @@ -0,0 +1,20 @@ +{ buildDunePackage +, letsencrypt +, emile +, http-mirage-client +, paf +}: + +buildDunePackage { + pname = "letsencrypt-mirage"; + + inherit (letsencrypt) version src; + + duneVersion = "3"; + + propagatedBuildInputs = [ emile http-mirage-client letsencrypt paf ]; + + meta = letsencrypt.meta // { + description = "ACME implementation in OCaml for MirageOS"; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 116717a9d747..e22f41a63cd2 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -757,6 +757,8 @@ let letsencrypt-dns = callPackage ../development/ocaml-modules/letsencrypt/dns.nix { }; + letsencrypt-mirage = callPackage ../development/ocaml-modules/letsencrypt/mirage.nix { }; + lilv = callPackage ../development/ocaml-modules/lilv { inherit (pkgs) lilv; };