From 4ad56cadeda1ae184bbaf0388410fd2ef5be43fa Mon Sep 17 00:00:00 2001 From: Devan Carpenter Date: Sat, 5 Nov 2022 16:15:21 +0100 Subject: [PATCH] cjdns: fix package and update this was not building, though it wasn't marked as such. upstream now requires Rust. python310 causes things to complain and fail, so we are specifiying python39. nodejs, python and now rust to compile a mostly C99 project. kids these days... --- pkgs/tools/networking/cjdns/default.nix | 39 ++++++++++++++++--------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/pkgs/tools/networking/cjdns/default.nix b/pkgs/tools/networking/cjdns/default.nix index e8dc5e370bea..d46d8bd2c576 100644 --- a/pkgs/tools/networking/cjdns/default.nix +++ b/pkgs/tools/networking/cjdns/default.nix @@ -1,20 +1,40 @@ -{ lib, stdenv, fetchFromGitHub, nodejs, which, python3, util-linux, nixosTests }: +{ lib +, stdenv +, fetchFromGitHub +, rustPlatform +, nodejs +, which +, python39 +, libuv +, util-linux +, nixosTests +}: -stdenv.mkDerivation rec { +rustPlatform.buildRustPackage rec { pname = "cjdns"; - version = "21.1"; + version = "21.4"; src = fetchFromGitHub { owner = "cjdelisle"; repo = "cjdns"; rev = "cjdns-v${version}"; - sha256 = "NOmk+vMZ8i0E2MjrUzksk+tkJ9XVVNEXlE5OOTNa+Y0="; + sha256 = "sha256-vI3uHZwmbFqxGasKqgCl0PLEEO8RNEhwkn5ZA8K7bxU="; }; - buildInputs = [ which python3 nodejs ] ++ + cargoSha256 = "sha256-x3LxGOhGXrheqdke0eYiQVo/IqgWgcDrDNupdLjRPjA="; + + nativeBuildInputs = [ + which + python39 + nodejs + ] ++ # for flock lib.optional stdenv.isLinux util-linux; + buildInputs = [ + libuv + ]; + NIX_CFLAGS_COMPILE = [ "-O2" "-Wno-error=array-bounds" @@ -24,15 +44,6 @@ stdenv.mkDerivation rec { "-Wno-error=stringop-overread" ]; - buildPhase = - lib.optionalString stdenv.isAarch32 "Seccomp_NO=1 " - + "bash do"; - installPhase = '' - install -Dt "$out/bin/" cjdroute makekeys privatetopublic publictoip6 - mkdir -p $out/share/cjdns - cp -R tools node_build node_modules $out/share/cjdns/ - ''; - passthru.tests.basic = nixosTests.cjdns; meta = with lib; {