From a3b801c683cf75dca4662f3d4642aa18df72a552 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Mon, 14 Aug 2023 08:51:28 +0100 Subject: [PATCH 1/3] nncp: 8.8.3 -> 8.9.0 --- pkgs/tools/misc/nncp/default.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/tools/misc/nncp/default.nix b/pkgs/tools/misc/nncp/default.nix index f859345e0e47..629bc158ddc3 100644 --- a/pkgs/tools/misc/nncp/default.nix +++ b/pkgs/tools/misc/nncp/default.nix @@ -1,17 +1,17 @@ -{ lib, stdenv, go, fetchurl, redo-apenwarr, curl, perl, genericUpdater -, writeShellScript, cfgPath ? "/etc/nncp.hjson" }: +{ lib, stdenv, fetchurl, go, curl, perl, genericUpdater, writeShellScript +, cfgPath ? "/etc/nncp.hjson" }: stdenv.mkDerivation rec { pname = "nncp"; - version = "8.8.3"; + version = "8.9.0"; outputs = [ "out" "doc" "info" ]; src = fetchurl { url = "http://www.nncpgo.org/download/${pname}-${version}.tar.xz"; - hash = "sha256-IldQCEdH6XDYK+DW5lB/5HFFFGuq1nDkCwEaVo7vIvE="; + sha256 = "259facbc3354edcc16e7c64e278aaccdb47ffa3ec2afea0b36283f46aa824b5d"; }; - nativeBuildInputs = [ go redo-apenwarr ]; + nativeBuildInputs = [ go ]; # Build parameters CFGPATH = cfgPath; @@ -19,11 +19,15 @@ stdenv.mkDerivation rec { preConfigure = "export GOCACHE=$NIX_BUILD_TOP/gocache"; + buildPhase = '' + runHook preBuild + ./bin/build + runHook postBuild + ''; + installPhase = '' runHook preInstall - export PREFIX=$out - rm -f INSTALL # work around case insensitivity - redo install + PREFIX=$out ./install runHook postInstall ''; From a41083fc26ada933d34544b6483d376d23eb03c8 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 15 Aug 2023 19:27:14 +0200 Subject: [PATCH 2/3] nncp: use `finalAttrs` pattern --- pkgs/tools/misc/nncp/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/misc/nncp/default.nix b/pkgs/tools/misc/nncp/default.nix index 629bc158ddc3..2090cdac2c08 100644 --- a/pkgs/tools/misc/nncp/default.nix +++ b/pkgs/tools/misc/nncp/default.nix @@ -1,13 +1,13 @@ { lib, stdenv, fetchurl, go, curl, perl, genericUpdater, writeShellScript , cfgPath ? "/etc/nncp.hjson" }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "nncp"; version = "8.9.0"; outputs = [ "out" "doc" "info" ]; src = fetchurl { - url = "http://www.nncpgo.org/download/${pname}-${version}.tar.xz"; + url = "http://www.nncpgo.org/download/nncp-${finalAttrs.version}.tar.xz"; sha256 = "259facbc3354edcc16e7c64e278aaccdb47ffa3ec2afea0b36283f46aa824b5d"; }; @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { passthru.updateScript = genericUpdater { versionLister = writeShellScript "nncp-versionLister" '' - ${curl}/bin/curl -s ${meta.downloadPage} | ${perl}/bin/perl -lne 'print $1 if /Release.*>([0-9.]+)([0-9.]+) Date: Tue, 15 Aug 2023 19:29:27 +0200 Subject: [PATCH 3/3] nncp: minor refactor and reformat using `nixpkgs-fmt` --- pkgs/tools/misc/nncp/default.nix | 33 +++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/pkgs/tools/misc/nncp/default.nix b/pkgs/tools/misc/nncp/default.nix index 2090cdac2c08..eb929c9923b1 100644 --- a/pkgs/tools/misc/nncp/default.nix +++ b/pkgs/tools/misc/nncp/default.nix @@ -1,5 +1,13 @@ -{ lib, stdenv, fetchurl, go, curl, perl, genericUpdater, writeShellScript -, cfgPath ? "/etc/nncp.hjson" }: +{ cfgPath ? "/etc/nncp.hjson" +, curl +, fetchurl +, lib +, genericUpdater +, go +, perl +, stdenv +, writeShellScript +}: stdenv.mkDerivation (finalAttrs: { pname = "nncp"; @@ -8,10 +16,12 @@ stdenv.mkDerivation (finalAttrs: { src = fetchurl { url = "http://www.nncpgo.org/download/nncp-${finalAttrs.version}.tar.xz"; - sha256 = "259facbc3354edcc16e7c64e278aaccdb47ffa3ec2afea0b36283f46aa824b5d"; + hash = "sha256-JZ+svDNU7cwW58ZOJ4qszbR/+j7Cr+oLNig/RqqCS10="; }; - nativeBuildInputs = [ go ]; + nativeBuildInputs = [ + go + ]; # Build parameters CFGPATH = cfgPath; @@ -39,8 +49,13 @@ stdenv.mkDerivation (finalAttrs: { ''; }; - meta = with lib; { + meta = { + broken = stdenv.isDarwin; + changelog = "http://www.nncpgo.org/News.html"; description = "Secure UUCP-like store-and-forward exchanging"; + downloadPage = "http://www.nncpgo.org/Tarballs.html"; + homepage = "http://www.nncpgo.org/"; + license = lib.licenses.gpl3Only; longDescription = '' This utilities are intended to help build up small size (dozens of nodes) ad-hoc friend-to-friend (F2F) statically routed darknet @@ -56,11 +71,7 @@ stdenv.mkDerivation (finalAttrs: { support. But online TCP daemon with full-duplex resumable data transmission exists. ''; - homepage = "http://www.nncpgo.org/"; - downloadPage = "http://www.nncpgo.org/Tarballs.html"; - changelog = "http://www.nncpgo.org/News.html"; - license = licenses.gpl3Only; - platforms = platforms.all; - maintainers = with maintainers; [ ehmry woffs ]; + maintainers = with lib.maintainers; [ ehmry woffs ]; + platforms = lib.platforms.all; }; })