571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
58 lines
1.2 KiB
Nix
58 lines
1.2 KiB
Nix
{ lib
|
|
, buildGoModule
|
|
, fetchFromGitHub
|
|
, stdenv
|
|
, xorg
|
|
, darwin
|
|
, testers
|
|
, src-cli
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "src-cli";
|
|
version = "5.5.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "sourcegraph";
|
|
repo = "src-cli";
|
|
rev = version;
|
|
hash = "sha256-3hj/nY66z3AjdvmdvkKTAXD8E6A4qPtLOuY7U6sKw9U=";
|
|
};
|
|
|
|
vendorHash = "sha256-F6TEw9hk8Fu7uY8/KW4etyZMqOb/GL/g4NV87JjfAsY=";
|
|
|
|
subPackages = [
|
|
"cmd/src"
|
|
];
|
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
|
|
xorg.libX11
|
|
] ++ lib.optionals stdenv.hostPlatform.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";
|
|
};
|
|
}
|