summaryrefslogtreecommitdiffstats
path: root/pkgs/development/ocaml-modules/luv/default.nix
blob: 34928ba39182297147afd80d5952bf360b45d717 (plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
  lib,
  buildDunePackage,
  fetchurl,
  ctypes,
  result,
  alcotest,
  file,
}:

buildDunePackage (finalAttrs: {
  pname = "luv";
  version = "0.5.14";

  src = fetchurl {
    url = "https://github.com/aantron/luv/releases/download/${finalAttrs.version}/luv-${finalAttrs.version}.tar.gz";
    hash =
      {
        "0.5.14" = "sha256-jgG0pQyIds3ZjY4kXAaHxNxNiDrtFhrZxazh+x/arpk=";
        "0.5.12" = "sha256-dp9qCIYqSdROIAQ+Jw73F3vMe7hnkDe8BgZWImNMVsA=";
      }
      ."${finalAttrs.version}";
  };

  patches = lib.optional (lib.versionOlder finalAttrs.version "0.5.14") ./incompatible-pointer-type-fix.diff;

  postConfigure = ''
    substituteInPlace "src/c/vendor/configure/ltmain.sh" --replace-fail /usr/bin/file file
  '';

  nativeBuildInputs = [ file ];
  propagatedBuildInputs = [
    ctypes
    result
  ];
  checkInputs = [ alcotest ];
  doCheck = true;

  meta = {
    homepage = "https://github.com/aantron/luv";
    description = "Binding to libuv: cross-platform asynchronous I/O";
    # MIT-licensed, extra licenses apply partially to libuv vendor
    license = with lib.licenses; [
      mit
      bsd2
      bsd3
      cc-by-sa-40
    ];
    maintainers = with lib.maintainers; [
      locallycompact
      sternenseemann
    ];
  };
})