2022-11-28 11:59:33 +01:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
2023-04-09 16:03:42 +02:00
|
|
|
, git
|
2022-12-07 14:59:02 +01:00
|
|
|
, testers
|
|
|
|
, d2
|
2022-11-28 11:59:33 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "d2";
|
2023-12-17 01:32:15 +01:00
|
|
|
version = "0.6.3";
|
2022-11-28 11:59:33 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "terrastruct";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-12-17 01:32:15 +01:00
|
|
|
hash = "sha256-GImv4OJHanj6dKtAJpTaGLrR4AaVTboiYHwRdh/gXaU=";
|
2022-11-28 11:59:33 +01:00
|
|
|
};
|
|
|
|
|
2023-12-17 01:32:15 +01:00
|
|
|
vendorHash = "sha256-T7eki06fQuGvYIJKvBJsIkFS1fQ9Jbv+ieUSr2vupqg=";
|
2022-11-28 11:59:33 +01:00
|
|
|
|
2023-04-09 16:03:42 +02:00
|
|
|
excludedPackages = [ "./e2etests" ];
|
|
|
|
|
2022-11-28 11:59:33 +01:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
2023-08-02 00:47:16 +02:00
|
|
|
"-X oss.terrastruct.com/d2/lib/version.Version=v${version}"
|
2022-11-28 11:59:33 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installManPage ci/release/template/man/d2.1
|
|
|
|
'';
|
|
|
|
|
2023-04-09 16:03:42 +02:00
|
|
|
nativeCheckInputs = [ git ];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# See https://github.com/terrastruct/d2/blob/master/docs/CONTRIBUTING.md#running-tests.
|
|
|
|
export TESTDATA_ACCEPT=1
|
|
|
|
'';
|
2022-12-07 14:59:02 +01:00
|
|
|
|
2023-08-02 00:47:16 +02:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = d2;
|
|
|
|
version = "v${version}";
|
|
|
|
};
|
2022-11-28 11:59:33 +01:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A modern diagram scripting language that turns text to diagrams";
|
|
|
|
homepage = "https://d2lang.com";
|
|
|
|
license = licenses.mpl20;
|
2023-09-27 03:06:29 +02:00
|
|
|
maintainers = with maintainers; [ dit7ya kashw2 ];
|
2022-11-28 11:59:33 +01:00
|
|
|
};
|
|
|
|
}
|