depot/third_party/nixpkgs/pkgs/tools/text/d2/default.nix
Default email 4d5a95770c Project import generated by Copybara.
GitOrigin-RevId: 3c5319ad3aa51551182ac82ea17ab1c6b0f0df89
2023-03-04 15:14:45 +03:00

44 lines
918 B
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, testers
, d2
}:
buildGoModule rec {
pname = "d2";
version = "0.2.2";
src = fetchFromGitHub {
owner = "terrastruct";
repo = pname;
rev = "v${version}";
hash = "sha256-CBDZNqYtQElXWmf+oMS7NKpWZG3aD0UTLM1efNg9gFg=";
};
vendorHash = "sha256-WwLPC3hS5yyySwNg62deQrryUI0RunW5oShbrFnGAFQ=";
ldflags = [
"-s"
"-w"
"-X oss.terrastruct.com/d2/lib/version.Version=${version}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installManPage ci/release/template/man/d2.1
'';
subPackages = [ "." ];
passthru.tests.version = testers.testVersion { package = d2; };
meta = with lib; {
description = "A modern diagram scripting language that turns text to diagrams";
homepage = "https://d2lang.com";
license = licenses.mpl20;
maintainers = with maintainers; [ dit7ya ];
};
}