about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/ocaml-modules/ethernet/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/ocaml-modules/ethernet/default.nix')
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ethernet/default.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ethernet/default.nix b/nixpkgs/pkgs/development/ocaml-modules/ethernet/default.nix
new file mode 100644
index 000000000000..bc4f4a475447
--- /dev/null
+++ b/nixpkgs/pkgs/development/ocaml-modules/ethernet/default.nix
@@ -0,0 +1,42 @@
+{ lib, buildDunePackage, fetchurl
+, rresult, cstruct, ppx_cstruct, mirage-net, mirage-protocols
+, mirage-profile, macaddr, fmt, lwt, logs
+}:
+
+buildDunePackage rec {
+  pname = "ethernet";
+  version = "2.2.0";
+
+  minimumOCamlVersion = "4.06";
+
+  # necessary due to cstruct
+  useDune2 = true;
+
+  src = fetchurl {
+    url = "https://github.com/mirage/${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
+    sha256 = "0qzisqibx2gd8rh330n642mk5wz229199rnlrs7x8cr5pnymif7z";
+  };
+
+  nativeBuildInputs = [
+    ppx_cstruct
+  ];
+
+  propagatedBuildInputs = [
+    rresult
+    cstruct
+    mirage-net
+    mirage-protocols
+    macaddr
+    mirage-profile
+    fmt
+    lwt
+    logs
+  ];
+
+  meta = with lib; {
+    description = "OCaml Ethernet (IEEE 802.3) layer, used in MirageOS";
+    homepage = "https://github.com/mirage/ethernet";
+    license = licenses.isc;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}