2022-11-04 12:27:35 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, nodejs
|
|
|
|
, which
|
|
|
|
, python39
|
|
|
|
, libuv
|
|
|
|
, util-linux
|
|
|
|
, nixosTests
|
2023-03-27 19:17:25 +00:00
|
|
|
, libsodium
|
|
|
|
, pkg-config
|
|
|
|
, substituteAll
|
2022-11-04 12:27:35 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2020-07-18 16:06:22 +00:00
|
|
|
pname = "cjdns";
|
2022-11-04 12:27:35 +00:00
|
|
|
version = "21.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cjdelisle";
|
|
|
|
repo = "cjdns";
|
|
|
|
rev = "cjdns-v${version}";
|
2022-11-04 12:27:35 +00:00
|
|
|
sha256 = "sha256-vI3uHZwmbFqxGasKqgCl0PLEEO8RNEhwkn5ZA8K7bxU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./system-libsodium.patch;
|
|
|
|
libsodium_include_dir = "${libsodium.dev}/include";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
|
|
|
"libsodium-sys-0.2.6" = "sha256-yr6wh0njbCFZViLROcqSSoRFj7ZAMYG5lo1g0j75SN0=";
|
|
|
|
};
|
|
|
|
};
|
2022-11-04 12:27:35 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
which
|
|
|
|
python39
|
|
|
|
nodejs
|
2023-03-27 19:17:25 +00:00
|
|
|
pkg-config
|
2022-11-04 12:27:35 +00:00
|
|
|
] ++
|
2020-04-24 23:36:52 +00:00
|
|
|
# for flock
|
2021-01-15 22:18:51 +00:00
|
|
|
lib.optional stdenv.isLinux util-linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
buildInputs = [
|
|
|
|
libuv
|
2023-03-27 19:17:25 +00:00
|
|
|
libsodium
|
2022-11-04 12:27:35 +00:00
|
|
|
];
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
env.SODIUM_USE_PKG_CONFIG = 1;
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString ([
|
2022-04-27 09:35:20 +00:00
|
|
|
"-O2"
|
|
|
|
"-Wno-error=array-bounds"
|
|
|
|
"-Wno-error=stringop-overflow"
|
|
|
|
"-Wno-error=stringop-truncation"
|
|
|
|
] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "11") [
|
|
|
|
"-Wno-error=stringop-overread"
|
2023-03-04 12:14:45 +00:00
|
|
|
]);
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
passthru.tests.basic = nixosTests.cjdns;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/cjdelisle/cjdns";
|
|
|
|
description = "Encrypted networking for regular people";
|
2020-12-29 15:07:52 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ ehmry ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|