diff --git a/pkgs/development/ocaml-modules/janestreet/0.15.nix b/pkgs/development/ocaml-modules/janestreet/0.15.nix index 7433c116b68f..bf61ae1d939c 100644 --- a/pkgs/development/ocaml-modules/janestreet/0.15.nix +++ b/pkgs/development/ocaml-modules/janestreet/0.15.nix @@ -254,6 +254,15 @@ with self; propagatedBuildInputs = [ async_websocket cohttp-async ppx_jane uri-sexp ]; }; + cohttp_static_handler = janePackage { + duneVersion = "3"; + pname = "cohttp_static_handler"; + version = "0.15.0"; + hash = "sha256-ENaH8ChvjeMc9WeNIhkeNBB7YK9vB4lw95o6FFZI1ys="; + meta.description = "A library for easily creating a cohttp handler for static files"; + propagatedBuildInputs = [ cohttp-async ]; + }; + core = janePackage { pname = "core"; version = "0.15.1"; diff --git a/pkgs/development/ocaml-modules/magic-trace/default.nix b/pkgs/development/ocaml-modules/magic-trace/default.nix new file mode 100644 index 000000000000..1f1417f67275 --- /dev/null +++ b/pkgs/development/ocaml-modules/magic-trace/default.nix @@ -0,0 +1,27 @@ +{ lib, fetchFromGitHub, buildDunePackage, async, cohttp_static_handler +, core_unix, owee, ppx_jane, shell }: + +buildDunePackage rec { + pname = "magic-trace"; + version = "1.1.0"; + + minimalOCamlVersion = "4.12"; + duneVersion = "3"; + + src = fetchFromGitHub { + owner = "janestreet"; + repo = "magic-trace"; + rev = "v${version}"; + sha256 = "sha256-615AOkrbQI6vRosA5Kz3Epipe9f9+Gs9+g3bVl5gzBY="; + }; + + buildInputs = [ async cohttp_static_handler core_unix owee ppx_jane shell ]; + + meta = with lib; { + description = + "Collects and displays high-resolution traces of what a process is doing"; + license = licenses.mit; + maintainers = [ maintainers.alizter ]; + homepage = "https://github.com/janestreet/magic-trace"; + }; +} diff --git a/pkgs/development/ocaml-modules/owee/default.nix b/pkgs/development/ocaml-modules/owee/default.nix index 7b15437a7ed2..3b8e6f58cfb2 100644 --- a/pkgs/development/ocaml-modules/owee/default.nix +++ b/pkgs/development/ocaml-modules/owee/default.nix @@ -2,19 +2,20 @@ buildDunePackage rec { minimalOCamlVersion = "4.06"; - useDune2 = true; + duneVersion = "2"; pname = "owee"; - version = "0.4"; + version = "0.6"; src = fetchurl { - url = "https://github.com/let-def/owee/releases/download/v${version}/owee-${version}.tbz"; - sha256 = "sha256:055bi0yfdki1pqagbhrwmfvigyawjgsmqw04zhpp6hds8513qzvb"; + url = + "https://github.com/let-def/owee/releases/download/v${version}/owee-${version}.tbz"; + sha256 = "sha256-GwXV5t4GYbDiGwyvQyW8NZoYvn4qXlLnjX331Bj1wjM="; }; - meta = { + meta = with lib; { description = "An experimental OCaml library to work with DWARF format"; homepage = "https://github.com/let-def/owee/"; - license = lib.licenses.mit; - maintainers = [ lib.maintainers.vbgl ]; + license = licenses.mit; + maintainers = with maintainers; [ vbgl alizter ]; }; } diff --git a/pkgs/development/ocaml-modules/spacetime_lib/default.nix b/pkgs/development/ocaml-modules/spacetime_lib/default.nix index 442d06e4f698..7e2e4002c1ea 100644 --- a/pkgs/development/ocaml-modules/spacetime_lib/default.nix +++ b/pkgs/development/ocaml-modules/spacetime_lib/default.nix @@ -6,8 +6,7 @@ lib.throwIfNot (lib.versionAtLeast "4.12" ocaml.version) buildDunePackage rec { pname = "spacetime_lib"; version = "0.3.0"; - - useDune2 = true; + duneVersion = "2"; src = fetchFromGitHub { owner = "lpw25"; @@ -16,6 +15,8 @@ buildDunePackage rec { sha256 = "0biisgbycr5v3nm5jp8i0h6vq76vzasdjkcgh8yr7fhxc81jgv3p"; }; + patches = [ ./spacetime.diff ]; + propagatedBuildInputs = [ owee ]; preConfigure = '' diff --git a/pkgs/development/ocaml-modules/spacetime_lib/spacetime.diff b/pkgs/development/ocaml-modules/spacetime_lib/spacetime.diff new file mode 100644 index 000000000000..baad34ce08b5 --- /dev/null +++ b/pkgs/development/ocaml-modules/spacetime_lib/spacetime.diff @@ -0,0 +1,14 @@ +diff --git a/src/elf_locations.ml b/src/elf_locations.ml +index a08b359..0db9274 100644 +--- a/src/elf_locations.ml ++++ b/src/elf_locations.ml +@@ -37,7 +37,8 @@ let resolve_from_dwarf t ~program_counter = + | Some section -> + let body = Owee_buf.cursor (Owee_elf.section_body t.map section) in + let rec aux () = +- match Owee_debug_line.read_chunk body with ++ let pointers_to_other_sections = Owee_elf.debug_line_pointers t.map t.sections in ++ match Owee_debug_line.read_chunk body ~pointers_to_other_sections with + | None -> () + | Some (header, chunk) -> + (* CR-soon mshinwell: fix owee .mli to note that [state] is diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index d1e599d8970f..3f8667af9ae7 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -895,6 +895,8 @@ let magic-mime = callPackage ../development/ocaml-modules/magic-mime { }; + magic-trace = callPackage ../development/ocaml-modules/magic-trace { }; + mariadb = callPackage ../development/ocaml-modules/mariadb { inherit (pkgs) mariadb; };