nixpkgs/pkgs/development/tools/delve/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitHub, makeWrapper, stdenv }:
2022-04-05 03:19:53 +00:00
buildGoModule rec {
pname = "delve";
version = "1.20.1";
src = fetchFromGitHub {
owner = "go-delve";
repo = "delve";
rev = "v${version}";
sha256 = "sha256-X1vds6+brQ5pl7MG2/n0CqCoS0nbjnQUcIgJqji/u60=";
};
2022-04-05 03:19:53 +00:00
vendorSha256 = null;
subPackages = [ "cmd/dlv" ];
nativeBuildInputs = [ makeWrapper ];
hardeningDisable = [ "fortify" ];
preCheck = ''
XDG_CONFIG_HOME=$(mktemp -d)
'';
# Disable tests on Darwin as they require various workarounds.
#
# - Tests requiring local networking fail with or without sandbox,
# even with __darwinAllowLocalNetworking allowed.
# - CGO_FLAGS warnings break tests' expected stdout/stderr outputs.
# - DAP test binaries exit prematurely.
doCheck = !stdenv.isDarwin;
2022-04-05 03:19:53 +00:00
postInstall = ''
# fortify source breaks build since delve compiles with -O0
wrapProgram $out/bin/dlv \
--prefix disableHardening " " fortify
# add symlink for vscode golang extension
# https://github.com/golang/vscode-go/blob/master/docs/debugging.md#manually-installing-dlv-dap
ln $out/bin/dlv $out/bin/dlv-dap
'';
meta = with lib; {
description = "debugger for the Go programming language";
2022-01-01 13:34:35 +00:00
homepage = "https://github.com/go-delve/delve";
maintainers = with maintainers; [ SuperSandro2000 vdemeester ];
2018-01-02 10:23:00 +00:00
license = licenses.mit;
2022-12-12 19:41:26 +00:00
mainProgram = "dlv";
};
}