diff --git a/pkgs/development/ocaml-modules/bitstring/default.nix b/pkgs/development/ocaml-modules/bitstring/default.nix index 4c612b177a7c..791620a77c08 100644 --- a/pkgs/development/ocaml-modules/bitstring/default.nix +++ b/pkgs/development/ocaml-modules/bitstring/default.nix @@ -1,21 +1,25 @@ { lib, fetchFromGitHub, + ocaml, buildDunePackage, stdlib-shims, }: buildDunePackage (finalAttrs: { pname = "bitstring"; - version = "4.1.1"; - - duneVersion = "3"; + version = if lib.versionAtLeast ocaml.version "5.3" then "5.0.2" else "4.1.1"; src = fetchFromGitHub { owner = "xguerin"; repo = "bitstring"; - rev = "v${finalAttrs.version}"; - sha256 = "sha256-eO7/S9PoMybZPnQQ+q9qbqKpYO4Foc9OjW4uiwwNds8="; + tag = "v${finalAttrs.version}"; + hash = + { + "5.0.2" = "sha256-MN16b37EM5NIZcvd59Y9Bd+YgcM62RdhrgCskd21tSg="; + "4.1.1" = "sha256-eO7/S9PoMybZPnQQ+q9qbqKpYO4Foc9OjW4uiwwNds8="; + } + ."${finalAttrs.version}"; }; propagatedBuildInputs = [ stdlib-shims ]; diff --git a/pkgs/development/ocaml-modules/bitstring/ppx.nix b/pkgs/development/ocaml-modules/bitstring/ppx.nix index 9215c8293d28..826e01501fb2 100644 --- a/pkgs/development/ocaml-modules/bitstring/ppx.nix +++ b/pkgs/development/ocaml-modules/bitstring/ppx.nix @@ -1,8 +1,6 @@ { lib, buildDunePackage, - fetchpatch, - ocaml, bitstring, ppxlib, ounit, @@ -12,21 +10,15 @@ buildDunePackage { pname = "ppx_bitstring"; inherit (bitstring) version src; - patches = lib.optional (lib.versionAtLeast ppxlib.version "0.36") (fetchpatch { - url = "https://github.com/xguerin/bitstring/commit/b42d4924cbb5ec5fd5309e6807852b63f456f35d.patch"; - hash = "sha256-wtpSnGOzIUTmB3LhyHGopecy7F/5SYFOwaR6eReV+6g="; - }); - buildInputs = [ bitstring ppxlib ]; - doCheck = lib.versionAtLeast ocaml.version "4.08"; + doCheck = true; checkInputs = [ ounit ]; meta = bitstring.meta // { description = "Bitstrings and bitstring matching for OCaml - PPX extension"; - broken = lib.versionOlder ppxlib.version "0.18.0"; }; }