mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-21 04:13:12 +00:00
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.
56 lines
1.2 KiB
Nix
56 lines
1.2 KiB
Nix
{ lib
|
|
, buildGoModule
|
|
, fetchFromGitHub
|
|
, installShellFiles
|
|
, testers
|
|
, gambit-chess
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "gambit";
|
|
version = "0.1.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "maaslalani";
|
|
repo = "gambit";
|
|
rev = "v${version}";
|
|
hash = "sha256-RLbD9JK1yJn30WWg7KWDjJoj4WXIoy3Kb8t2F8rFPuk=";
|
|
};
|
|
|
|
vendorHash = "sha256-d9fPlv+ZAzQA42I61B5JEzfYpfJc9vWBcLYTX/s5dhs=";
|
|
|
|
nativeBuildInputs = [
|
|
installShellFiles
|
|
];
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X=main.Version=v${version}"
|
|
"-X=main.CommitSHA=${src.rev}"
|
|
];
|
|
|
|
postInstall = ''
|
|
installShellCompletion --cmd gambit \
|
|
--bash <($out/bin/gambit completion bash) \
|
|
--fish <($out/bin/gambit completion fish) \
|
|
--zsh <($out/bin/gambit completion zsh)
|
|
'';
|
|
|
|
passthru.tests = {
|
|
version = testers.testVersion {
|
|
package = gambit-chess;
|
|
version = "v${version}";
|
|
};
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Play chess in your terminal";
|
|
mainProgram = "gambit";
|
|
homepage = "https://github.com/maaslalani/gambit";
|
|
changelog = "https://github.com/maaslalani/gambit/releases/tag/${src.rev}";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ figsoda ];
|
|
};
|
|
}
|