From d1833117a89aca751b0a12220c933c33e9e74a03 Mon Sep 17 00:00:00 2001 From: Ali Caglayan Date: Thu, 23 Mar 2023 18:37:20 +0100 Subject: [PATCH] ocamlPackages.spacetime_lib: patch for compat with owee 0.6 --- .../ocaml-modules/spacetime_lib/default.nix | 5 +++-- .../ocaml-modules/spacetime_lib/spacetime.diff | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/ocaml-modules/spacetime_lib/spacetime.diff diff --git a/pkgs/development/ocaml-modules/spacetime_lib/default.nix b/pkgs/development/ocaml-modules/spacetime_lib/default.nix index 442d06e4f69..7e2e4002c1e 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 00000000000..baad34ce08b --- /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