2022-05-01 23:15:08 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, makeWrapper, stdenv }:
|
2016-11-23 22:53:07 +00:00
|
|
|
|
2022-04-05 03:19:53 +00:00
|
|
|
buildGoModule rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "delve";
|
2023-12-30 05:53:07 +00:00
|
|
|
version = "1.22.0";
|
2016-11-23 22:53:07 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2019-03-05 17:50:17 +00:00
|
|
|
owner = "go-delve";
|
2016-11-23 22:53:07 +00:00
|
|
|
repo = "delve";
|
|
|
|
rev = "v${version}";
|
2023-12-30 05:53:07 +00:00
|
|
|
hash = "sha256-uYUl8PMBRf73wwo+oOYda0sTfD1gnDThtNc3sg8Q328=";
|
2016-11-23 22:53:07 +00:00
|
|
|
};
|
|
|
|
|
2023-04-18 07:51:41 +00:00
|
|
|
vendorHash = null;
|
2022-04-05 03:19:53 +00:00
|
|
|
|
2021-05-31 14:40:17 +00:00
|
|
|
subPackages = [ "cmd/dlv" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2022-05-01 23:15:08 +00:00
|
|
|
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
|
|
|
|
2021-05-31 14:40:17 +00:00
|
|
|
postInstall = ''
|
|
|
|
# fortify source breaks build since delve compiles with -O0
|
|
|
|
wrapProgram $out/bin/dlv \
|
2021-06-01 05:23:50 +00:00
|
|
|
--prefix disableHardening " " fortify
|
2021-10-22 15:43:14 +00:00
|
|
|
|
|
|
|
# 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
|
2021-05-31 14:40:17 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2016-11-23 22:53:07 +00:00
|
|
|
description = "debugger for the Go programming language";
|
2022-01-01 13:34:35 +00:00
|
|
|
homepage = "https://github.com/go-delve/delve";
|
2023-07-23 17:30:22 +00:00
|
|
|
maintainers = with maintainers; [ vdemeester ];
|
2018-01-02 10:23:00 +00:00
|
|
|
license = licenses.mit;
|
2022-12-12 19:41:26 +00:00
|
|
|
mainProgram = "dlv";
|
2016-11-23 22:53:07 +00:00
|
|
|
};
|
|
|
|
}
|