nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildGo124Module,
5 fetchFromGitHub,
6 libredirect,
7 iana-etc,
8 versionCheckHook,
9}:
10
11buildGo124Module (finalAttrs: {
12 pname = "scip";
13 version = "0.6.1";
14
15 src = fetchFromGitHub {
16 owner = "sourcegraph";
17 repo = "scip";
18 tag = "v${finalAttrs.version}";
19 hash = "sha256-l68xhOMgwt+ySChk7BCyklcuC6r51GgobAg3lRLvOCU=";
20 };
21
22 vendorHash = "sha256-8HgeG/SXkM7ptOwKSi/PUH3VySxFqqoIpXI7bZtbO4A=";
23
24 ldflags = [
25 "-s"
26 "-X=main.Reproducible=true"
27 ];
28
29 nativeCheckInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libredirect.hook ];
30
31 checkFlags =
32 let
33 skippedTests = [
34 "TestParseCompat" # could not locate sample indexes directory starting from parents of working directory
35 "TestParseSymbol_ZeroAllocationsIfMemoryAvailable"
36 ];
37 in
38 [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ];
39
40 __darwinAllowLocalNetworking = true;
41
42 preCheck = lib.optionalString stdenv.hostPlatform.isDarwin ''
43 export NIX_REDIRECTS=/etc/protocols=${iana-etc}/etc/protocols:/etc/services=${iana-etc}/etc/services
44 '';
45
46 doInstallCheck = stdenv.hostPlatform.isLinux;
47
48 nativeInstallCheckInputs = [ versionCheckHook ];
49
50 meta = {
51 description = "SCIP Code Intelligence Protocol CLI";
52 mainProgram = "scip";
53 homepage = "https://github.com/sourcegraph/scip";
54 changelog = "https://github.com/sourcegraph/scip/blob/${finalAttrs.src.rev}/CHANGELOG.md";
55 license = lib.licenses.asl20;
56 maintainers = [ ];
57 };
58})