From 744471cd3be4dbcc42dc805d12f87b63116bec50 Mon Sep 17 00:00:00 2001 From: Michael Raitza Date: Sun, 17 Jan 2021 19:33:00 +0100 Subject: [PATCH] goredo: Init at 0.12.3 Implementation of DJB redo in Go --- default.nix | 1 + goredo/default.nix | 46 +++++++++++++++++++++++++++++++++++++ goredo/deps.nix | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 goredo/default.nix create mode 100644 goredo/deps.nix diff --git a/default.nix b/default.nix index 9e9c9ef..575c45f 100644 --- a/default.nix +++ b/default.nix @@ -42,5 +42,6 @@ let myR = prev.rWrapper.override { packages = with prev.rPackages; [ ggplot2 lintr tikzDevice rlang ]; }; ledgerTools = callPackage ./ledger-tools { }; tea = callPackage ./tea.nix {}; + goredo = callPackage ./goredo {}; }; in _self diff --git a/goredo/default.nix b/goredo/default.nix new file mode 100644 index 0000000..3bcb215 --- /dev/null +++ b/goredo/default.nix @@ -0,0 +1,46 @@ +{ lib, fetchgit, buildGoPackage, texinfo }: +buildGoPackage rec { + pname = "goredo"; + version = "0.12.3"; + rev = version; + + goPackagePath = "goredo"; + + src = fetchgit { + url = "git://git.cypherpunks.ru/goredo.git"; + rev = "v${version}"; + sha256 = "sha256-NXrBdr7grHkpdS8SO4keaiJHDJ1GgN0dKtZWKgexbc0="; + }; + + goDeps = ./deps.nix; + + nativeBuildInputs = [ texinfo ]; + + postBuild = '' + ( + cd go/src/goredo/doc + echo '${version}' >../VERSION + sh ./goredo.info.do goredo.info goredo.info goredo.info + ) + ''; + + postInstall = '' + mkdir -p "$out/share/info" + cp go/src/goredo/doc/goredo.info "$out/share/info" + ( + cd $out/bin + for f in redo redo-{always,cleanup,dot,ifchange,ifcreate,log,stamp,whichdo}; do + ln -s goredo $f + done + ) + ''; + + outputs = [ "out" "info" ]; + + meta = with lib; { + description = "DJB redo written in Go"; + homepage = "https://www.goredo.cypherpunks.ru"; + license = licenses.gpl3; + platforms = platforms.linux ++ platforms.darwin; + }; +} diff --git a/goredo/deps.nix b/goredo/deps.nix new file mode 100644 index 0000000..7274b31 --- /dev/null +++ b/goredo/deps.nix @@ -0,0 +1,56 @@ +[ + { + goPackagePath = "go.cypherpunks.ru/recfile"; + fetch = { + type = "git"; + url = "git://git.cypherpunks.ru/gorecfile.git"; + rev = "v0.4.2"; + sha256 = "sha256-HZgxJFrZyyuksmyvYgoTtgJcwPwkQOy5jXfcG4DMouA="; + }; + } + { + goPackagePath = "go.cypherpunks.ru/tai64n"; + fetch = { + type = "git"; + url = "git://git.cypherpunks.ru/gotai64n.git"; + rev = "v0.2.1"; + sha256 = "sha256-WXrvtsmiykxd2NH9Fvtcf46Za6C9GVyxsAR8KwoPMjE="; + }; + } + { + goPackagePath = "lukechampine.com/blake3"; + fetch = { + type = "git"; + url = "https://github.com/lukechampine/blake3"; + rev = "v1.1.5"; + sha256 = "sha256-pXBbfoIyxS4/S8MHdAzTKUVwCl6Tds0XF9ja29Dlrfs="; + }; + } + { + goPackagePath = "github.com/klauspost/cpuid"; + fetch = { + type = "git"; + url = "https://github.com/klauspost/cpuid"; + rev = "v1.3.1"; + sha256 = "sha256-L6wBhoKcUXEFU+a/fe+UXcHl2dKuHVw4m0OKoDrxK/o="; + }; + } + { + goPackagePath = "golang.org/x/sys"; + fetch = { + type = "git"; + url = "https://github.com/golang/sys"; + rev = "0df2131ae363"; + sha256 = "sha256-qqVxeRnu0e4v3mywdoy14McpfT5M9kPbqNH4x84Rn8Y="; + }; + } + { + goPackagePath = "golang.org/x/term"; + fetch = { + type = "git"; + url = "https://github.com/golang/term"; + rev = "2321bbc49cbf8303ea9834c419750e793e31be73"; + sha256 = "sha256-6nCt95JDvry3sJLS2JhAKm0IVu7sGoCM9fbJS2+OlRI="; + }; + } +]