{ lib, stdenv, buildGoModule, fetchurl, # buildInputs libogg, opusfile, sox, # nativeBuildInputs makeWrapper, perl, pkg-config, zstd, # updateScript curl, genericUpdater, writeShellScript, }: buildGoModule (finalAttrs: { pname = "vors"; version = "5.0.0"; src = fetchurl { url = "http://www.vors.stargrave.org/download/vors-${finalAttrs.version}.tar.zst"; hash = "sha256-DpwnhfexF/yw2emn1xrhKbGNbk9Z6wm5A2azQSAdmpA="; }; vendorHash = null; buildInputs = [ libogg opusfile sox ]; nativeBuildInputs = [ makeWrapper perl pkg-config zstd ]; subPackages = [ "cmd/vad" "cmd/keygen" "cmd/server" "cmd/client" ]; preConfigure = "export GOCACHE=$NIX_BUILD_TOP/gocache"; preBuild = '' ./mk-non-static mkdir -p ./local/lib # Required to prevent building libopusfile ''; installPhase = '' runHook preInstall install -Dm755 "$GOPATH"/bin/client "$out"/bin/vors-client install -Dm755 "$GOPATH"/bin/keygen "$out"/bin/vors-keygen install -Dm755 "$GOPATH"/bin/server "$out"/bin/vors-server install -Dm755 "$GOPATH"/bin/vad "$out"/bin/vors-vad runHook postInstall ''; postInstall = '' wrapProgram "$out"/bin/vors-client \ --prefix PATH : ${lib.makeBinPath [ sox ]} ''; enableParallelBuilding = true; passthru.updateScript = genericUpdater { versionLister = writeShellScript "vors-versionLister" '' ${curl}/bin/curl -s ${finalAttrs.meta.downloadPage} | ${perl}/bin/perl -lne 'print $1 if /td.*>([0-9.]+)