diff --git a/pkgs/development/ocaml-modules/awa/default.nix b/pkgs/development/ocaml-modules/awa/default.nix index 559b4fe62c4c..6a4ed92cc079 100644 --- a/pkgs/development/ocaml-modules/awa/default.nix +++ b/pkgs/development/ocaml-modules/awa/default.nix @@ -1,7 +1,7 @@ { lib, buildDunePackage, fetchurl , ppx_sexp_conv , mirage-crypto, mirage-crypto-ec, mirage-crypto-rng, mirage-crypto-pk -, x509, cstruct, cstruct-unix, cstruct-sexp, sexplib, eqaf +, x509, cstruct, cstruct-unix, cstruct-sexp, sexplib, eqaf-cstruct , rresult, mtime, logs, fmt, cmdliner, base64 , zarith }: @@ -17,11 +17,15 @@ buildDunePackage rec { hash = "sha256-VejHFn07B/zoEG4LjLaen24ig9kAXtERl/pRo6UZCQk="; }; + postPatch = '' + substituteInPlace lib/dune --replace-warn eqaf.cstruct eqaf-cstruct + ''; + propagatedBuildInputs = [ mirage-crypto mirage-crypto-ec mirage-crypto-rng mirage-crypto-pk x509 cstruct cstruct-sexp sexplib mtime logs base64 zarith - ppx_sexp_conv eqaf + ppx_sexp_conv eqaf-cstruct ]; doCheck = true; diff --git a/pkgs/development/ocaml-modules/eqaf/cstruct.nix b/pkgs/development/ocaml-modules/eqaf/cstruct.nix new file mode 100644 index 000000000000..b5f2f6e66683 --- /dev/null +++ b/pkgs/development/ocaml-modules/eqaf/cstruct.nix @@ -0,0 +1,9 @@ +{ buildDunePackage, eqaf, cstruct }: + +buildDunePackage { + pname = "eqaf-cstruct"; + + inherit (eqaf) src version meta; + + propagatedBuildInputs = [ cstruct eqaf ]; +} diff --git a/pkgs/development/ocaml-modules/eqaf/default.nix b/pkgs/development/ocaml-modules/eqaf/default.nix index d777755253c2..9b5dadb7b710 100644 --- a/pkgs/development/ocaml-modules/eqaf/default.nix +++ b/pkgs/development/ocaml-modules/eqaf/default.nix @@ -1,18 +1,15 @@ -{ lib, fetchurl, buildDunePackage, cstruct }: +{ lib, fetchurl, buildDunePackage }: buildDunePackage rec { minimalOCamlVersion = "4.07"; - duneVersion = "3"; pname = "eqaf"; - version = "0.9"; + version = "0.10"; src = fetchurl { url = "https://github.com/mirage/eqaf/releases/download/v${version}/eqaf-${version}.tbz"; - hash = "sha256-7A4oqUasaBf5XVhU8FqZYa46hAi7YQ55z60BubJV3+A="; + hash = "sha256-Z9E2nFfE0tFKENAmMtReNVIkq+uYrsCJecC65YQwku4="; }; - propagatedBuildInputs = [ cstruct ]; - meta = { description = "Constant time equal function to avoid timing attacks in OCaml"; homepage = "https://github.com/mirage/eqaf"; diff --git a/pkgs/development/ocaml-modules/mirage-crypto/default.nix b/pkgs/development/ocaml-modules/mirage-crypto/default.nix index 74e9a455bebe..7057d8980652 100644 --- a/pkgs/development/ocaml-modules/mirage-crypto/default.nix +++ b/pkgs/development/ocaml-modules/mirage-crypto/default.nix @@ -1,11 +1,10 @@ -{ lib, fetchurl, buildDunePackage, ounit2, cstruct, dune-configurator, eqaf, pkg-config +{ lib, fetchurl, buildDunePackage, ounit2, dune-configurator, eqaf-cstruct, pkg-config , withFreestanding ? false , ocaml-freestanding }: buildDunePackage rec { minimalOCamlVersion = "4.08"; - duneVersion = "3"; pname = "mirage-crypto"; version = "0.11.3"; @@ -21,11 +20,16 @@ buildDunePackage rec { nativeBuildInputs = [ pkg-config ]; buildInputs = [ dune-configurator ]; propagatedBuildInputs = [ - cstruct eqaf + eqaf-cstruct ] ++ lib.optionals withFreestanding [ ocaml-freestanding ]; + # Compatibility with eqaf 0.10 + postPatch = '' + substituteInPlace src/dune --replace-warn eqaf.cstruct eqaf-cstruct + ''; + meta = with lib; { homepage = "https://github.com/mirage/mirage-crypto"; description = "Simple symmetric cryptography for the modern age"; diff --git a/pkgs/development/ocaml-modules/mirage-crypto/pk.nix b/pkgs/development/ocaml-modules/mirage-crypto/pk.nix index e50838e50bbb..11f09dfd5161 100644 --- a/pkgs/development/ocaml-modules/mirage-crypto/pk.nix +++ b/pkgs/development/ocaml-modules/mirage-crypto/pk.nix @@ -1,16 +1,18 @@ { buildDunePackage, ounit2, randomconv, mirage-crypto, mirage-crypto-rng -, cstruct, sexplib0, zarith, eqaf, gmp }: +, cstruct, sexplib0, zarith, eqaf-cstruct, gmp }: buildDunePackage rec { pname = "mirage-crypto-pk"; inherit (mirage-crypto) version src; - duneVersion = "3"; + postPatch = '' + substituteInPlace pk/dune --replace-warn eqaf.cstruct eqaf-cstruct + ''; buildInputs = [ gmp ]; propagatedBuildInputs = [ cstruct mirage-crypto mirage-crypto-rng - zarith eqaf sexplib0 ]; + zarith eqaf-cstruct sexplib0 ]; doCheck = true; checkInputs = [ ounit2 randomconv ]; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 46866fd88361..259864f22a78 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -466,6 +466,8 @@ let eqaf = callPackage ../development/ocaml-modules/eqaf { }; + eqaf-cstruct = callPackage ../development/ocaml-modules/eqaf/cstruct.nix { }; + erm_xml = callPackage ../development/ocaml-modules/erm_xml { }; erm_xmpp = callPackage ../development/ocaml-modules/erm_xmpp { };