2024-06-05 15:53:02 +00:00
|
|
|
{ asciidoctor
|
|
|
|
, darwin
|
2024-05-15 15:35:15 +00:00
|
|
|
, fetchgit
|
|
|
|
, git
|
|
|
|
, installShellFiles
|
2024-06-05 15:53:02 +00:00
|
|
|
, jq
|
|
|
|
, lib
|
|
|
|
, makeWrapper
|
|
|
|
, man-db
|
|
|
|
, openssh
|
|
|
|
, radicle-node
|
|
|
|
, runCommand
|
2024-05-15 15:35:15 +00:00
|
|
|
, rustPlatform
|
2024-06-05 15:53:02 +00:00
|
|
|
, stdenv
|
2024-05-15 15:35:15 +00:00
|
|
|
, testers
|
2024-06-05 15:53:02 +00:00
|
|
|
, xdg-utils
|
2024-05-15 15:35:15 +00:00
|
|
|
}: rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "radicle-node";
|
2024-06-24 18:47:55 +00:00
|
|
|
version = "1.0.0-rc.11";
|
2024-05-15 15:35:15 +00:00
|
|
|
env.RADICLE_VERSION = version;
|
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5.git";
|
|
|
|
rev = "refs/namespaces/z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT/refs/tags/v${version}";
|
2024-06-24 18:47:55 +00:00
|
|
|
hash = "sha256-P1Gg2uk87ppco7CAPjEqN0uqgb0K8apOSC7cfdgaT0Y=";
|
2024-05-15 15:35:15 +00:00
|
|
|
};
|
2024-06-24 18:47:55 +00:00
|
|
|
cargoHash = "sha256-M01NjqvMSaa3+YPb4vDtIucBeF5BYx3cpmMoLJOwRsI=";
|
2024-05-15 15:35:15 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ asciidoctor installShellFiles makeWrapper ];
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeCheckInputs = [ git ];
|
|
|
|
buildInputs = lib.optionals stdenv.buildPlatform.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
doCheck = stdenv.hostPlatform.isLinux;
|
2024-05-15 15:35:15 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export PATH=$PATH:$PWD/target/${stdenv.hostPlatform.rust.rustcTargetSpec}/release
|
2024-06-05 15:53:02 +00:00
|
|
|
# Tests want to open many files.
|
|
|
|
ulimit -n 4096
|
2024-05-15 15:35:15 +00:00
|
|
|
'';
|
|
|
|
checkFlags = [
|
|
|
|
"--skip=service::message::tests::test_node_announcement_validate"
|
|
|
|
"--skip=tests::test_announcement_relay"
|
2024-06-05 15:53:02 +00:00
|
|
|
# https://radicle.zulipchat.com/#narrow/stream/369277-heartwood/topic/Flaky.20tests/near/438352360
|
|
|
|
"--skip=tests::e2e::test_connection_crossing"
|
2024-05-15 15:35:15 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
for page in $(find -name '*.adoc'); do
|
|
|
|
asciidoctor -d manpage -b manpage $page
|
|
|
|
installManPage ''${page::-5}
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
postFixup = ''
|
|
|
|
for program in $out/bin/* ;
|
|
|
|
do
|
|
|
|
wrapProgram "$program" \
|
|
|
|
--prefix PATH : "${lib.makeBinPath [ git man-db openssh xdg-utils ]}"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests =
|
|
|
|
let
|
|
|
|
package = radicle-node;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
version = testers.testVersion { inherit package; };
|
|
|
|
basic = runCommand "${package.name}-basic-test"
|
|
|
|
{
|
|
|
|
nativeBuildInputs = [ jq openssh radicle-node ];
|
|
|
|
} ''
|
|
|
|
set -e
|
|
|
|
export RAD_HOME="$PWD/.radicle"
|
|
|
|
mkdir -p "$RAD_HOME/keys"
|
|
|
|
ssh-keygen -t ed25519 -N "" -f "$RAD_HOME/keys/radicle" > /dev/null
|
|
|
|
jq -n '.node.alias |= "nix"' > "$RAD_HOME/config.json"
|
|
|
|
|
|
|
|
rad config > /dev/null
|
|
|
|
rad debug | jq -e '
|
|
|
|
(.sshVersion | contains("${openssh.version}"))
|
|
|
|
and
|
|
|
|
(.gitVersion | contains("${git.version}"))
|
|
|
|
'
|
|
|
|
|
|
|
|
touch $out
|
|
|
|
'';
|
|
|
|
};
|
2024-05-15 15:35:15 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Radicle node and CLI for decentralized code collaboration";
|
|
|
|
longDescription = ''
|
|
|
|
Radicle is an open source, peer-to-peer code collaboration stack built on Git.
|
|
|
|
Unlike centralized code hosting platforms, there is no single entity controlling the network.
|
|
|
|
Repositories are replicated across peers in a decentralized manner, and users are in full control of their data and workflow.
|
|
|
|
'';
|
|
|
|
homepage = "https://radicle.xyz";
|
|
|
|
license = with lib.licenses; [ asl20 mit ];
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
maintainers = with lib.maintainers; [ amesgen lorenzleutgeb ];
|
|
|
|
mainProgram = "rad";
|
|
|
|
};
|
|
|
|
}
|