2022-12-02 08:20:57 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
2022-12-17 10:02:37 +00:00
|
|
|
, testers
|
|
|
|
, d2
|
2022-12-02 08:20:57 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "d2";
|
2023-03-24 00:07:29 +00:00
|
|
|
version = "0.2.6";
|
2022-12-02 08:20:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "terrastruct";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-03-24 00:07:29 +00:00
|
|
|
hash = "sha256-bZJu4l5xAVqm/1HIhHfnZF9JRswAE/c6OzuZ8mmHA9U=";
|
2022-12-02 08:20:57 +00:00
|
|
|
};
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
vendorHash = "sha256-wXE2+a30KohIOuxFeBQPcV7X2Ka+4t7zqHdr48kifY0=";
|
2022-12-02 08:20:57 +00:00
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X oss.terrastruct.com/d2/lib/version.Version=${version}"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installManPage ci/release/template/man/d2.1
|
|
|
|
'';
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
subPackages = [ "." ];
|
|
|
|
|
|
|
|
passthru.tests.version = testers.testVersion { package = d2; };
|
2022-12-02 08:20:57 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|