From d1adcbf662b2d3bcf702a8fad346fa5ae7d0ec8b Mon Sep 17 00:00:00 2001 From: Bojun Ren Date: Wed, 9 Oct 2024 11:47:51 +0800 Subject: [PATCH] double-entry-generator: init at 2.7.1 --- .../do/double-entry-generator/package.nix | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 pkgs/by-name/do/double-entry-generator/package.nix diff --git a/pkgs/by-name/do/double-entry-generator/package.nix b/pkgs/by-name/do/double-entry-generator/package.nix new file mode 100644 index 000000000000..f57f8b185b9d --- /dev/null +++ b/pkgs/by-name/do/double-entry-generator/package.nix @@ -0,0 +1,49 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + nix-update-script, +}: +buildGoModule rec { + pname = "double-entry-generator"; + version = "2.7.1"; + src = fetchFromGitHub { + owner = "deb-sig"; + repo = "double-entry-generator"; + hash = "sha256-2Y8Spj1LAVZsUgChDYDCZ63pTH+nqs2ff9xcmC+gr0c="; + rev = "v${version}"; + }; + + vendorHash = "sha256-Xedva9oGteOnv3rP4Wo3sOHIPyuy2TYwkZV2BAuxY4M="; + + excludedPackages = [ "hack" ]; + + ldflags = [ + "-s" + "-w" + "-X=github.com/deb-sig/double-entry-generator/pkg/version.VERSION=${version}" + "-X=github.com/deb-sig/double-entry-generator/pkg/version.REPOROOT=github.com/deb-sig/double-entry-generator" + "-X=github.com/deb-sig/double-entry-generator/pkg/version.COMMIT=${src.rev}" + ]; + + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + + touch build-local + ln -s $out/bin ./ + make SHELL=bash GIT_COMMIT= VERSION= DOCKER_LABELS= -o test-go test + + runHook postInstallCheck + ''; + + passthru.updateScript = nix-update-script { }; + + meta = with lib; { + description = "Rule-based double-entry bookkeeping importer (from Alipay/WeChat/Huobi etc. to Beancount/Ledger)"; + homepage = "https://github.com/deb-sig/double-entry-generator"; + license = licenses.asl20; + maintainers = with maintainers; [ rennsax ]; + mainProgram = "double-entry-generator"; + }; +}