diff --git a/pkgs/development/libraries/dqlite/default.nix b/pkgs/development/libraries/dqlite/default.nix index 093abe085f0..84b4b1bab77 100644 --- a/pkgs/development/libraries/dqlite/default.nix +++ b/pkgs/development/libraries/dqlite/default.nix @@ -1,24 +1,36 @@ -{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libuv, sqlite-replication }: +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, file, libco-canonical +, libuv, raft-canonical, sqlite-replication }: with stdenv.lib; stdenv.mkDerivation rec { pname = "dqlite"; - version = "0.2.6"; + version = "1.0.0"; src = fetchFromGitHub { - owner = "CanonicalLtd"; + owner = "canonical"; repo = pname; rev = "v${version}"; - sha256 = "13l7na5858v2ah1vim6lafmzajgkymfi5rd6bk14cm4vcnxc40wb"; + sha256 = "0670c1c84lcf5vl3h6mlff00fz2fnm766bzlk526sjjzysx3zjya"; }; - nativeBuildInputs = [ autoreconfHook pkgconfig ]; + nativeBuildInputs = [ autoreconfHook file pkgconfig ]; + buildInputs = [ libco-canonical.dev libuv raft-canonical.dev + sqlite-replication ]; - buildInputs = [ libuv sqlite-replication ]; + preConfigure= '' + substituteInPlace configure --replace /usr/bin/ " " + ''; + + doCheck = true; + + outputs = [ "dev" "out" ]; meta = { - description = "Expose a SQLite database over the network and replicate it across a cluster of peers"; + description = '' + Expose a SQLite database over the network and replicate it across a + cluster of peers + ''; homepage = https://github.com/CanonicalLtd/dqlite/; license = licenses.asl20; maintainers = with maintainers; [ joko ]; diff --git a/pkgs/development/libraries/libco-canonical/default.nix b/pkgs/development/libraries/libco-canonical/default.nix new file mode 100644 index 00000000000..09c27ae7c9c --- /dev/null +++ b/pkgs/development/libraries/libco-canonical/default.nix @@ -0,0 +1,28 @@ +{ stdenv, fetchFromGitHub, pkgconfig }: + +with stdenv.lib; + +stdenv.mkDerivation rec { + pname = "libco-canonical"; + version = "19.1"; + + src = fetchFromGitHub { + owner = "canonical"; + repo = "libco"; + rev = "v${version}"; + sha256 = "03a0fq8f8gc4hjzcf0zsjib4mzag47rxrrg9b5r6bx53vj5rhj78"; + }; + + nativeBuildInputs = [ pkgconfig ]; + + makeFlags = [ "PREFIX=${placeholder "out"}" ]; + + outputs = [ "dev" "out" ]; + + meta = { + description = "A cooperative multithreading library written in C89"; + homepage = "https://github.com/canonical/libco"; + license = licenses.isc; + maintainers = with maintainers; [ wucke13 ]; + }; +} diff --git a/pkgs/development/libraries/raft-canonical/default.nix b/pkgs/development/libraries/raft-canonical/default.nix new file mode 100644 index 00000000000..515fbc602d9 --- /dev/null +++ b/pkgs/development/libraries/raft-canonical/default.nix @@ -0,0 +1,44 @@ +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, file, libuv }: + +stdenv.mkDerivation rec { + pname = "raft-canonical"; + version = "0.9.6"; + + src = fetchFromGitHub { + owner = "canonical"; + repo = "raft"; + rev = "v${version}"; + sha256 = "083il7b5kw3pc7m5p9xjpb9dlvfarc51sni92mkgm9ckc32x9vpp"; + }; + + nativeBuildInputs = [ autoreconfHook file pkgconfig ]; + buildInputs = [ libuv ]; + + preConfigure = '' + substituteInPlace configure --replace /usr/bin/ " " + ''; + + doCheck = false; + # Due to + #io_uv_recv/success/first [ ERROR ] + #Error: test/lib/dir.c:97: No such file or directory + #Error: child killed by signal 6 (Aborted) + + outputs = [ "dev" "out" ]; + + meta = with stdenv.lib; { + description = '' + Fully asynchronous C implementation of the Raft consensus protocol + ''; + longDescription = '' + The library has modular design: its core part implements only the core + Raft algorithm logic, in a fully platform independent way. On top of + that, a pluggable interface defines the I/O implementation for networking + (send/receive RPC messages) and disk persistence (store log entries and + snapshots). + ''; + homepage = "https://github.com/canonical/raft"; + license = licenses.asl20; + maintainers = [ maintainers.wucke13 ]; + }; +} diff --git a/pkgs/tools/admin/lxd/default.nix b/pkgs/tools/admin/lxd/default.nix index 3c50a7948d9..fd8ee9e04a3 100644 --- a/pkgs/tools/admin/lxd/default.nix +++ b/pkgs/tools/admin/lxd/default.nix @@ -1,7 +1,7 @@ { stdenv, pkgconfig, lxc, buildGoPackage, fetchurl , makeWrapper, acl, rsync, gnutar, xz, btrfs-progs, gzip, dnsmasq -, squashfsTools, iproute, iptables, ebtables, libcap, dqlite -, sqlite-replication +, squashfsTools, iproute, iptables, ebtables, libcap, libco-canonical, dqlite +, raft-canonical, sqlite-replication , writeShellScriptBin, apparmor-profiles, apparmor-parser , criu , bash @@ -9,21 +9,20 @@ buildGoPackage rec { pname = "lxd"; - version = "3.13"; + version = "3.18"; goPackagePath = "github.com/lxc/lxd"; src = fetchurl { url = "https://github.com/lxc/lxd/releases/download/${pname}-${version}/${pname}-${version}.tar.gz"; - sha256 = "1kasnzd8hw9biyx8avbjmpfax1pdbp9g543g8hs6xpksmk93hl82"; + sha256 = "1p8g2gbwgn3kln5rxddpc2fxk8bvf026wjiqip2b0vvpi7h3955h"; }; preBuild = '' # unpack vendor pushd go/src/github.com/lxc/lxd - rm dist/src/github.com/lxc/lxd - cp -r dist/src/* ../../.. - rm -r dist + rm _dist/src/github.com/lxc/lxd + cp -r _dist/src/* ../../.. popd ''; @@ -45,13 +44,14 @@ buildGoPackage rec { ''; nativeBuildInputs = [ pkgconfig makeWrapper ]; - buildInputs = [ lxc acl libcap dqlite sqlite-replication ]; + buildInputs = [ lxc acl libcap libco-canonical.dev dqlite.dev + raft-canonical.dev sqlite-replication ]; meta = with stdenv.lib; { description = "Daemon based on liblxc offering a REST API to manage containers"; homepage = https://linuxcontainers.org/lxd/; license = licenses.asl20; - maintainers = with maintainers; [ fpletz ]; + maintainers = with maintainers; [ fpletz wucke13 ]; platforms = platforms.linux; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e8b6c14f693..d9c1a167a74 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11806,6 +11806,8 @@ in libclxclient = callPackage ../development/libraries/libclxclient { }; + libco-canonical = callPackage ../development/libraries/libco-canonical { }; + libconfuse = callPackage ../development/libraries/libconfuse { }; libcangjie = callPackage ../development/libraries/libcangjie { }; @@ -13493,6 +13495,8 @@ in rabbitmq-c = callPackage ../development/libraries/rabbitmq-c {}; + raft-canonical = callPackage ../development/libraries/raft-canonical { }; + range-v3 = callPackage ../development/libraries/range-v3 {}; rabbitmq-java-client = callPackage ../development/libraries/rabbitmq-java-client {};