From 7ee4516a7e1f0eff14df9ea45a9f0f4966983803 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Fri, 6 Sep 2019 08:50:53 +0200 Subject: [PATCH] wtf: No longer use vendored dependencies The go modules utilized by the project and the vendored dependencies already diverged, so the nix build of `wtf` was slightly out-of-date regarding the official binary. The gocenter proxy provides "immutable re-usable Go modules" which should avoid the problem of any dependency suddenly vanishing. --- pkgs/applications/misc/wtf/default.nix | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/misc/wtf/default.nix b/pkgs/applications/misc/wtf/default.nix index ec871dc3e56..60ff84ffe59 100644 --- a/pkgs/applications/misc/wtf/default.nix +++ b/pkgs/applications/misc/wtf/default.nix @@ -9,6 +9,10 @@ buildGoModule rec { pname = "wtf"; version = "0.21.0"; + overrideModAttrs = _oldAttrs : _oldAttrs // { + preBuild = ''export GOPROXY="https://gocenter.io"''; + }; + src = fetchFromGitHub { owner = "wtfutil"; repo = pname; @@ -16,21 +20,12 @@ buildGoModule rec { sha256 = "0sd8vrx7nak0by4whdmd9jzr66zm48knv1w1aqi90709fv98brm9"; }; - modSha256 = "1nqnjpkrjbb75yfbzh3v3vc4xy5a2aqm9jr40hwq589a4l9p5pw2"; + modSha256 = "0jgq9ql27x0kdp59l5drisl5v7v7sx2wy3zqjbr3bqyh3vdx19ic"; buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version}" ]; nativeBuildInputs = [ makeWrapper ]; - # As per https://github.com/wtfutil/wtf/issues/501, one of the - # dependencies can't be fetched, so vendored dependencies should - # be used instead - modBuildPhase = '' - runHook preBuild - make build -mod=vendor - runHook postBuild - ''; - postInstall = '' wrapProgram "$out/bin/wtf" --prefix PATH : "${ncurses.dev}/bin" '';