2023-08-16 18:54:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
2023-09-26 20:08:20 +00:00
|
|
|
, installShellFiles
|
|
|
|
, stdenv
|
2023-09-12 23:45:34 +00:00
|
|
|
, fetchpatch
|
2023-08-16 18:54:51 +00:00
|
|
|
}:
|
2023-09-12 23:45:34 +00:00
|
|
|
|
2019-12-26 09:19:08 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "glow";
|
2023-09-12 23:45:34 +00:00
|
|
|
version = "1.5.1";
|
2019-12-26 09:19:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "charmbracelet";
|
|
|
|
repo = "glow";
|
|
|
|
rev = "v${version}";
|
2023-09-12 23:45:34 +00:00
|
|
|
hash = "sha256-12UziCf3BO1z+W02slNCCvXhIkvZuVgXk++BdHG3gDI=";
|
2019-12-26 09:19:08 +00:00
|
|
|
};
|
|
|
|
|
2023-09-12 23:45:34 +00:00
|
|
|
vendorHash = "sha256-xxFC87t12bZKea9Snscul+xx8IGFAcoIr9Z8wxHL7nM=";
|
|
|
|
|
|
|
|
# Remove whenever a release with it is available
|
|
|
|
patches = [(fetchpatch {
|
|
|
|
url = "https://github.com/charmbracelet/glow/commit/f0734709f0be19a34e648caaf63340938a50caa2.patch";
|
|
|
|
name = "go-1-17-patch";
|
|
|
|
hash = "sha256-vpMiVb/7SFT9xcSpVGQriEjkexh1F/ljpfpIswdBx2Y=";
|
|
|
|
})];
|
2019-12-26 09:19:08 +00:00
|
|
|
|
2020-08-04 00:26:27 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2021-08-26 06:45:51 +00:00
|
|
|
ldflags = [ "-s" "-w" "-X=main.Version=${version}" ];
|
2020-01-06 13:58:52 +00:00
|
|
|
|
2023-09-26 20:08:20 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
|
|
installShellCompletion --cmd glow \
|
|
|
|
--bash <($out/bin/glow completion bash) \
|
|
|
|
--fish <($out/bin/glow completion fish) \
|
|
|
|
--zsh <($out/bin/glow completion zsh)
|
|
|
|
'';
|
|
|
|
|
2020-03-27 07:33:21 +00:00
|
|
|
meta = with lib; {
|
2020-10-06 18:09:40 +00:00
|
|
|
description = "Render markdown on the CLI, with pizzazz!";
|
2020-01-06 13:58:52 +00:00
|
|
|
homepage = "https://github.com/charmbracelet/glow";
|
2020-12-25 14:07:12 +00:00
|
|
|
changelog = "https://github.com/charmbracelet/glow/releases/tag/v${version}";
|
2020-01-06 13:58:52 +00:00
|
|
|
license = licenses.mit;
|
2020-12-06 11:37:47 +00:00
|
|
|
maintainers = with maintainers; [ Br1ght0ne penguwin ];
|
2023-08-16 18:54:51 +00:00
|
|
|
mainProgram = "glow";
|
2019-12-26 09:19:08 +00:00
|
|
|
};
|
2020-07-31 03:58:04 +00:00
|
|
|
}
|