about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/mirage-block-ramdisk/default.nix
blob: a6978d3d5811ea0c765a18706b14c069f4f62b10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ lib, fetchurl, buildDunePackage, io-page, mirage-block }:

buildDunePackage rec {
  pname = "mirage-block-ramdisk";
  version = "0.5";

  src = fetchurl {
    url =
      "https://github.com/mirage/mirage-block-ramdisk/releases/download/${version}/mirage-block-ramdisk-${version}.tbz";
    sha256 = "cc0e814fd54efe7a5b7a8c5eb1c04e2dece751b7d8dee2d95908a0768896e8af";
  };

  # Make compatible with cstruct 6.1.0
  postPatch = ''
    substituteInPlace src/ramdisk.ml --replace 'Cstruct.len' 'Cstruct.length'
  '';

  minimalOCamlVersion = "4.06";
  duneVersion = "3";

  propagatedBuildInputs = [ io-page mirage-block ];

  doCheck = false;

  meta = with lib; {
    description = "In-memory BLOCK device for MirageOS";
    homepage = "https://github.com/mirage/mirage-block-ramdisk";
    license = licenses.isc;
    maintainers = with maintainers; [ ehmry ];
  };
}