cjdns: 21.4 -> 22.1

This commit is contained in:
Amadej Kastelic 2025-07-17 20:12:38 +02:00
parent ee847178d2
commit 15e8c2a2f2
No known key found for this signature in database

View File

@ -2,11 +2,10 @@
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
rustPlatform,
nodejs,
which,
python3,
libuv,
util-linux,
nixosTests,
libsodium,
@ -16,26 +15,34 @@
rustPlatform.buildRustPackage rec {
pname = "cjdns";
version = "21.4";
version = "22.1";
src = fetchFromGitHub {
owner = "cjdelisle";
repo = "cjdns";
rev = "cjdns-v${version}";
sha256 = "sha256-vI3uHZwmbFqxGasKqgCl0PLEEO8RNEhwkn5ZA8K7bxU=";
tag = "cjdns-v${version}";
hash = "sha256-0imQrkcvIA+2Eq/zlC65USMR7T3OUKwQxrB1KtVexyU=";
};
patches = [
(replaceVars ./system-libsodium.patch {
libsodium_include_dir = "${libsodium.dev}/include";
})
# Remove mkpasswd since it is failing the build
(fetchpatch {
url = "https://github.com/cjdelisle/cjdns/commit/6391dba3f5fdab45df4b4b6b71dbe9620286ce32.patch";
hash = "sha256-XVA4tdTVMLrV6zuGoBCkOgQq6NXh0x7u8HgmaxFeoRI=";
})
(fetchpatch {
url = "https://github.com/cjdelisle/cjdns/commit/436d9a9784bae85734992c2561c778fbd2f5ac32.patch";
hash = "sha256-THcYNGVbMx/xf3/5UIxEhz3OlODE0qiYgDBOlHunhj8=";
})
];
cargoHash = "sha256-LJEKjhyAsK6b7mKObX8tNJdKt53iagMD/YLzoY5GVPw=";
cargoHash = "sha256-f96y6ZW0HxC+73ts5re8GIo2aigQgK3gXyF7fMrcJ0o=";
nativeBuildInputs = [
which
python3
nodejs
pkg-config
]
@ -43,10 +50,7 @@ rustPlatform.buildRustPackage rec {
# for flock
lib.optional stdenv.hostPlatform.isLinux util-linux;
buildInputs = [
libuv
libsodium
];
buildInputs = [ libsodium ];
env.SODIUM_USE_PKG_CONFIG = 1;
env.NIX_CFLAGS_COMPILE = toString (
@ -61,10 +65,22 @@ rustPlatform.buildRustPackage rec {
]
);
cargoTestFlags = [
# don't run doctests since they fail with "cannot find type `Ctx` in this scope"
"--lib"
"--bins"
"--tests"
];
checkFlags = [
# Tests don't seem to work - "called `Result::unwrap()` on an `Err` value: DecryptErr: NO_SESSION"
"--skip=crypto::crypto_auth::tests::test_wireguard_iface_encrypt_decrypt"
"--skip=crypto::crypto_auth::tests::test_wireguard_iface_encrypt_decrypt_with_auth"
];
passthru.tests.basic = nixosTests.cjdns;
meta = with lib; {
broken = true; # outdated, incompatible with supported python versions
homepage = "https://github.com/cjdelisle/cjdns";
description = "Encrypted networking for regular people";
license = licenses.gpl3Plus;