{ lib, stdenv , go , fetchurl , redo-apenwarr , curl , perl , genericUpdater , writeShellScript }: stdenv.mkDerivation rec { pname = "nncp"; version = "6.3.0"; src = fetchurl { url = "http://www.nncpgo.org/download/${pname}-${version}.tar.xz"; sha256 = "0ss6p91r9sr3q8p8f6mjjc2cspx3fq0q4w44gfxl0da2wc8nmhkn"; }; nativeBuildInputs = [ go redo-apenwarr ]; buildPhase = '' runHook preBuild export GOCACHE=$PWD/.cache export CFGPATH=/etc/nncp.hjson export SENDMAIL=sendmail # default value for generated config file redo ''${enableParallelBuilding:+-j''${NIX_BUILD_CORES}} runHook postBuild ''; installPhase = '' runHook preInstall export PREFIX=$out rm -f INSTALL # work around case insensitivity redo install runHook postInstall ''; enableParallelBuilding = true; passthru.updateScript = genericUpdater { inherit pname version; versionLister = writeShellScript "nncp-versionLister" '' echo "# Versions for $1:" >> "$2" ${curl}/bin/curl -s http://www.nncpgo.org/Tarballs.html | ${perl}/bin/perl -lne 'print $1 if /Release.*>([0-9.]+)