1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 stdenv,
6}:
7
8buildGoModule rec {
9 pname = "delve";
10 version = "1.25.1";
11
12 src = fetchFromGitHub {
13 owner = "go-delve";
14 repo = "delve";
15 rev = "v${version}";
16 hash = "sha256-I7GGpLGhOp29+2V3CSSGnItSwhyrM+2yZxQsGRN812U=";
17 };
18
19 patches = [
20 ./disable-fortify.diff
21 ];
22
23 vendorHash = null;
24
25 subPackages = [ "cmd/dlv" ];
26
27 hardeningDisable = [ "fortify" ];
28
29 preCheck = ''
30 XDG_CONFIG_HOME=$(mktemp -d)
31 '';
32
33 # Disable tests on Darwin as they require various workarounds.
34 #
35 # - Tests requiring local networking fail with or without sandbox,
36 # even with __darwinAllowLocalNetworking allowed.
37 # - CGO_FLAGS warnings break tests' expected stdout/stderr outputs.
38 # - DAP test binaries exit prematurely.
39 doCheck = !stdenv.hostPlatform.isDarwin;
40
41 postInstall = ''
42 # add symlink for vscode golang extension
43 # https://github.com/golang/vscode-go/blob/master/docs/debugging.md#manually-installing-dlv-dap
44 ln $out/bin/dlv $out/bin/dlv-dap
45 '';
46
47 meta = with lib; {
48 description = "Debugger for the Go programming language";
49 homepage = "https://github.com/go-delve/delve";
50 maintainers = with maintainers; [ vdemeester ];
51 license = licenses.mit;
52 mainProgram = "dlv";
53 };
54}