From 9550348c1aea20ecf2a10a4d725bc5c30c8452e3 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Tue, 28 Feb 2023 05:48:57 +0000 Subject: [PATCH] ocamlPackages.{arp,ethernet,tcpip}: some cleaning --- .../development/ocaml-modules/arp/default.nix | 27 ++++++++++++++----- .../ocaml-modules/ethernet/default.nix | 23 +++++++++------- .../ocaml-modules/tcpip/default.nix | 17 +++++------- 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/pkgs/development/ocaml-modules/arp/default.nix b/pkgs/development/ocaml-modules/arp/default.nix index 4c98f5b377b..63c1e090662 100644 --- a/pkgs/development/ocaml-modules/arp/default.nix +++ b/pkgs/development/ocaml-modules/arp/default.nix @@ -1,8 +1,22 @@ -{ lib, buildDunePackage, fetchurl -, cstruct, ipaddr, macaddr, logs, lwt, duration -, mirage-time, mirage-protocols, mirage-profile -, alcotest, ethernet, fmt, mirage-vnetif, mirage-random -, mirage-random-test, mirage-clock-unix, mirage-time-unix +{ lib +, buildDunePackage +, fetchurl +, cstruct +, duration +, ethernet +, ipaddr +, logs +, lwt +, macaddr +, mirage-profile +, mirage-time +, alcotest +, mirage-clock-unix +, mirage-flow +, mirage-random +, mirage-random-test +, mirage-time-unix +, mirage-vnetif , bisect_ppx }: @@ -31,7 +45,6 @@ buildDunePackage rec { lwt macaddr mirage-profile - mirage-protocols mirage-time ]; @@ -39,7 +52,7 @@ buildDunePackage rec { checkInputs = [ alcotest mirage-clock-unix - mirage-profile + mirage-flow mirage-random mirage-random-test mirage-time-unix diff --git a/pkgs/development/ocaml-modules/ethernet/default.nix b/pkgs/development/ocaml-modules/ethernet/default.nix index 6d76590c6ca..a27a91d9d8e 100644 --- a/pkgs/development/ocaml-modules/ethernet/default.nix +++ b/pkgs/development/ocaml-modules/ethernet/default.nix @@ -1,20 +1,26 @@ -{ lib, buildDunePackage, fetchurl -, rresult, cstruct, ppx_cstruct, mirage-net, mirage-protocols -, mirage-profile, macaddr, fmt, lwt, logs +{ lib +, buildDunePackage +, fetchurl +, cstruct +, logs +, lwt +, macaddr +, mirage-net +, mirage-profile +, ppx_cstruct }: buildDunePackage rec { pname = "ethernet"; version = "3.0.0"; - minimumOCamlVersion = "4.08"; + minimalOCamlVersion = "4.08"; - # necessary due to cstruct - useDune2 = true; + duneVersion = "3"; src = fetchurl { url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz"; - sha256 = "0a898vp9dw42majsvzzvs8pc6x4ns01wlwhwbacixliv6vv78ng9"; + hash = "sha256:0a898vp9dw42majsvzzvs8pc6x4ns01wlwhwbacixliv6vv78ng9"; }; buildInputs = [ @@ -22,13 +28,10 @@ buildDunePackage rec { ]; propagatedBuildInputs = [ - rresult cstruct mirage-net - mirage-protocols macaddr mirage-profile - fmt lwt logs ]; diff --git a/pkgs/development/ocaml-modules/tcpip/default.nix b/pkgs/development/ocaml-modules/tcpip/default.nix index 0cd57ba9c8f..90100c2d5b5 100644 --- a/pkgs/development/ocaml-modules/tcpip/default.nix +++ b/pkgs/development/ocaml-modules/tcpip/default.nix @@ -1,7 +1,7 @@ { lib, buildDunePackage, fetchurl -, bisect_ppx, ppx_cstruct, pkg-config -, rresult, cstruct, cstruct-lwt, mirage-net, mirage-clock -, mirage-random, mirage-stack, mirage-protocols, mirage-time +, ppx_cstruct, pkg-config +, cstruct, cstruct-lwt, mirage-net, mirage-clock +, mirage-random, mirage-time , ipaddr, macaddr, macaddr-cstruct, mirage-profile, fmt , lwt, lwt-dllist, logs, duration, randomconv, ethernet , alcotest, mirage-flow, mirage-vnetif, pcap-format @@ -19,7 +19,7 @@ buildDunePackage rec { src = fetchurl { url = "https://github.com/mirage/mirage-${pname}/releases/download/v${version}/${pname}-${version}.tbz"; - sha256 = "sha256-lraur6NfFD9yddG+y21jlHKt82gLgYBBbedltlgcRm0="; + hash = "sha256-lraur6NfFD9yddG+y21jlHKt82gLgYBBbedltlgcRm0="; }; nativeBuildInputs = [ @@ -27,17 +27,12 @@ buildDunePackage rec { ]; propagatedBuildInputs = [ - bisect_ppx ppx_cstruct - rresult cstruct cstruct-lwt mirage-net mirage-clock mirage-random - mirage-random-test - mirage-stack - mirage-protocols mirage-time ipaddr macaddr @@ -53,13 +48,15 @@ buildDunePackage rec { lru metrics arp + mirage-flow ] ++ lib.optionals withFreestanding [ ocaml-freestanding ]; - doCheck = false; + doCheck = true; checkInputs = [ alcotest + mirage-random-test mirage-flow mirage-vnetif pcap-format