nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 autoreconfHook,
6 libuv,
7 lz4,
8 pkg-config,
9 incus,
10 gitUpdater,
11}:
12
13stdenv.mkDerivation (finalAttrs: {
14 pname = "raft-cowsql";
15 version = "0.22.1";
16
17 src = fetchFromGitHub {
18 owner = "cowsql";
19 repo = "raft";
20 tag = "v${finalAttrs.version}";
21 hash = "sha256-aGw/ATu8Xdjfqa0qWg8Sld9PKCmQsMtZhuNBwagER7M=";
22 };
23
24 nativeBuildInputs = [
25 autoreconfHook
26 pkg-config
27 ];
28 buildInputs = [
29 libuv
30 lz4
31 ];
32
33 enableParallelBuilding = true;
34
35 patches = [
36 # network tests either hang indefinitely, or fail outright
37 ./disable-net-tests.patch
38
39 # missing dir check is flaky
40 ./disable-missing-dir-test.patch
41 ];
42
43 preConfigure = ''
44 substituteInPlace configure --replace /usr/bin/ " "
45 '';
46
47 doCheck = true;
48
49 outputs = [
50 "dev"
51 "out"
52 ];
53
54 passthru = {
55 inherit (incus) tests;
56
57 updateScript = gitUpdater {
58 rev-prefix = "v";
59 };
60 };
61
62 meta = {
63 description = "Asynchronous C implementation of the Raft consensus protocol";
64 homepage = "https://github.com/cowsql/raft";
65 license = lib.licenses.lgpl3Only;
66 platforms = lib.platforms.linux;
67 teams = [ lib.teams.lxc ];
68 };
69})