diff --git a/gen_opams.ml b/gen_opams.ml index 7f1503e..625b921 100644 --- a/gen_opams.ml +++ b/gen_opams.ml @@ -8,7 +8,13 @@ let version_ocaml_unikraft = "0.0.1" let version_unikraft = "0.17.0" let archs = [ "arm64"; "x86_64" ] let backends = [ ("fc", "FireCracker"); ("qemu", "QEMU") ] -let options = [ ("debug", "debugging"); ("lwip", "the lwIP library") ] + +let options = + [ + ("debug", "debugging", []); + ("lwip", "the lwIP library", [ "network-stack" ]); + ("ocaml-net-stack", "OCaml network stack", [ "network-stack" ]); + ] let with_package package_name gen = let filename = Printf.sprintf "%s.opam" package_name in @@ -40,7 +46,7 @@ depends: [ depopts: [|} version_unikraft long_name arch; List.iter - (fun (opt, _) -> + (fun (opt, _, _) -> Printf.fprintf out "\n \"ocaml-unikraft-option-%s\"" opt) options; Printf.fprintf out @@ -90,7 +96,7 @@ extra-source "musl-1.2.3.tar.gz" { short_name arch) let option_package option = - let short_name, long_name = option in + let short_name, long_name, conflicts = option in let package_name = Printf.sprintf "ocaml-unikraft-option-%s" short_name in with_package package_name (fun out -> Printf.fprintf out @@ -101,7 +107,15 @@ synopsis: authors: "Samuel Hym" license: "MIT" |} - version_unikraft long_name) + version_unikraft long_name; + match conflicts with + | [] -> () + | _ -> + Printf.fprintf out "conflict-class: [\n"; + List.iter + (Printf.fprintf out " \"ocaml-unikraft-%s\"\n") + conflicts; + Printf.fprintf out "]\n") let toolchain_package arch = let package_name = Printf.sprintf "ocaml-unikraft-toolchain-%s" arch in diff --git a/ocaml-unikraft-backend-fc-arm64.opam b/ocaml-unikraft-backend-fc-arm64.opam index b61c1c9..9cc7396 100644 --- a/ocaml-unikraft-backend-fc-arm64.opam +++ b/ocaml-unikraft-backend-fc-arm64.opam @@ -13,6 +13,7 @@ depends: [ depopts: [ "ocaml-unikraft-option-debug" "ocaml-unikraft-option-lwip" + "ocaml-unikraft-option-ocaml-net-stack" ] build: [ [ diff --git a/ocaml-unikraft-backend-fc-x86_64.opam b/ocaml-unikraft-backend-fc-x86_64.opam index 197e9e2..98ff2c3 100644 --- a/ocaml-unikraft-backend-fc-x86_64.opam +++ b/ocaml-unikraft-backend-fc-x86_64.opam @@ -13,6 +13,7 @@ depends: [ depopts: [ "ocaml-unikraft-option-debug" "ocaml-unikraft-option-lwip" + "ocaml-unikraft-option-ocaml-net-stack" ] build: [ [ diff --git a/ocaml-unikraft-backend-qemu-arm64.opam b/ocaml-unikraft-backend-qemu-arm64.opam index d0b9732..cf350da 100644 --- a/ocaml-unikraft-backend-qemu-arm64.opam +++ b/ocaml-unikraft-backend-qemu-arm64.opam @@ -13,6 +13,7 @@ depends: [ depopts: [ "ocaml-unikraft-option-debug" "ocaml-unikraft-option-lwip" + "ocaml-unikraft-option-ocaml-net-stack" ] build: [ [ diff --git a/ocaml-unikraft-backend-qemu-x86_64.opam b/ocaml-unikraft-backend-qemu-x86_64.opam index e7dfea2..12fc8c2 100644 --- a/ocaml-unikraft-backend-qemu-x86_64.opam +++ b/ocaml-unikraft-backend-qemu-x86_64.opam @@ -13,6 +13,7 @@ depends: [ depopts: [ "ocaml-unikraft-option-debug" "ocaml-unikraft-option-lwip" + "ocaml-unikraft-option-ocaml-net-stack" ] build: [ [ diff --git a/ocaml-unikraft-option-lwip.opam b/ocaml-unikraft-option-lwip.opam index 05eef05..36e8644 100644 --- a/ocaml-unikraft-option-lwip.opam +++ b/ocaml-unikraft-option-lwip.opam @@ -8,3 +8,6 @@ synopsis: "Virtual package to enable the lwIP library in the Unikraft backends" authors: "Samuel Hym" license: "MIT" +conflict-class: [ + "ocaml-unikraft-network-stack" +] diff --git a/ocaml-unikraft-option-ocaml-net-stack.opam b/ocaml-unikraft-option-ocaml-net-stack.opam new file mode 100644 index 0000000..85a6c57 --- /dev/null +++ b/ocaml-unikraft-option-ocaml-net-stack.opam @@ -0,0 +1,13 @@ +opam-version: "2.0" +name: "ocaml-unikraft-option-ocaml-net-stack" +maintainer: "samuel@tarides.com" +homepage: "https://github.com/shym/ocaml-unikraft/" +bug-reports: "https://github.com/shym/ocaml-unikraft/issues" +version: "0.17.0" +synopsis: + "Virtual package to enable OCaml network stack in the Unikraft backends" +authors: "Samuel Hym" +license: "MIT" +conflict-class: [ + "ocaml-unikraft-network-stack" +]