1 { lib, buildGoModule, fetchFromGitHub, makeWrapper, stdenv }:
7 src = fetchFromGitHub {
11 hash = "sha256-rR84muba8nMrPZAhH+8xXOOxBvKIsU8Xju8tG7BjqBo=";
16 subPackages = [ "cmd/dlv" ];
18 nativeBuildInputs = [ makeWrapper ];
20 hardeningDisable = [ "fortify" ];
23 XDG_CONFIG_HOME=$(mktemp -d)
26 # Disable tests on Darwin as they require various workarounds.
28 # - Tests requiring local networking fail with or without sandbox,
29 # even with __darwinAllowLocalNetworking allowed.
30 # - CGO_FLAGS warnings break tests' expected stdout/stderr outputs.
31 # - DAP test binaries exit prematurely.
32 doCheck = !stdenv.isDarwin;
35 # fortify source breaks build since delve compiles with -O0
36 wrapProgram $out/bin/dlv \
37 --prefix disableHardening " " fortify
39 # add symlink for vscode golang extension
40 # https://github.com/golang/vscode-go/blob/master/docs/debugging.md#manually-installing-dlv-dap
41 ln $out/bin/dlv $out/bin/dlv-dap
45 description = "debugger for the Go programming language";
46 homepage = "https://github.com/go-delve/delve";
47 maintainers = with maintainers; [ vdemeester ];
48 license = licenses.mit;