depot/third_party/nixpkgs/pkgs/development/tools/misc/src-cli/default.nix
Default email 5e7c2d6cef Project import generated by Copybara.
GitOrigin-RevId: f99e5f03cc0aa231ab5950a15ed02afec45ed51a
2023-10-09 21:29:22 +02:00

57 lines
1.1 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, stdenv
, xorg
, darwin
, testers
, src-cli
}:
buildGoModule rec {
pname = "src-cli";
version = "5.2.0";
src = fetchFromGitHub {
owner = "sourcegraph";
repo = "src-cli";
rev = version;
hash = "sha256-QUcN71Zvg9BSQHXu8ANye9BOX5cDgMgl2jfhUgz/GVE=";
};
vendorHash = "sha256-YhaxgEGYKrRZagnpoMi/mGWXVkbp5fUjQ73xDFdTElw=";
subPackages = [
"cmd/src"
];
buildInputs = lib.optionals stdenv.isLinux [
xorg.libX11
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Cocoa
];
ldflags = [
"-s"
"-w"
"-X=github.com/sourcegraph/src-cli/internal/version.BuildTag=${version}"
];
__darwinAllowLocalNetworking = true;
passthru.tests = {
version = testers.testVersion {
package = src-cli;
command = "src version || true";
};
};
meta = with lib; {
description = "Sourcegraph CLI";
homepage = "https://github.com/sourcegraph/src-cli";
changelog = "https://github.com/sourcegraph/src-cli/blob/${src.rev}/CHANGELOG.md";
license = licenses.asl20;
maintainers = with maintainers; [ figsoda ];
mainProgram = "src";
};
}