about summary refs log tree commit diff
path: root/pkgs/tools/misc/ets
diff options
context:
space:
mode:
authorcameronfyfe <cameron.j.fyfe@gmail.com>2022-01-16 16:28:01 -0700
committercameronfyfe <cameron.j.fyfe@gmail.com>2022-02-01 18:27:07 -0700
commit645c499720e22ba83b68f14db731f4d7f40c7409 (patch)
tree6d84546441bddf166ffaf8a0ef6e41b2599f36c1 /pkgs/tools/misc/ets
parentd8604f64d925c4f2b2224c06626b87b105235f84 (diff)
ets: init at 0.2.1
Diffstat (limited to 'pkgs/tools/misc/ets')
-rw-r--r--pkgs/tools/misc/ets/default.nix37
-rw-r--r--pkgs/tools/misc/ets/go-mod.patch21
2 files changed, 58 insertions, 0 deletions
diff --git a/pkgs/tools/misc/ets/default.nix b/pkgs/tools/misc/ets/default.nix
new file mode 100644
index 0000000000000..2822d00febdf0
--- /dev/null
+++ b/pkgs/tools/misc/ets/default.nix
@@ -0,0 +1,37 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "ets";
+  version = "0.2.1";
+
+  src = fetchFromGitHub {
+    owner = "zmwangx";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-XWIDo5msTMTLr60x1R9cwsiZIDG6G+uHWx8idt4F2iA=";
+  };
+
+  patches = [ ./go-mod.patch ];
+
+  vendorSha256 = "sha256-+8dXfqOu8XTw2uEx3GAynQSHtzifejZtddr1CdxrupA=";
+
+  ldflags = [ "-s" "-w" "-X main.version=v${version}-nixpkgs" ];
+
+  preBuild = ''
+    rm -rf fixtures
+  '';
+
+  postInstall = ''
+    mkdir -p $out/share/man/man1
+    cp ets.1 $out/share/man/man1
+  '';
+
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Command output timestamper";
+    homepage = "https://github.com/zmwangx/ets/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ cameronfyfe ];
+  };
+}
diff --git a/pkgs/tools/misc/ets/go-mod.patch b/pkgs/tools/misc/ets/go-mod.patch
new file mode 100644
index 0000000000000..50998e35927f4
--- /dev/null
+++ b/pkgs/tools/misc/ets/go-mod.patch
@@ -0,0 +1,21 @@
+diff --git a/go.mod b/go.mod
+index 3b5d491..b658c8e 100644
+--- a/go.mod
++++ b/go.mod
+@@ -8,4 +8,5 @@ require (
+ 	github.com/mattn/go-runewidth v0.0.9
+ 	github.com/riywo/loginshell v0.0.0-20190610082906-2ed199a032f6
+ 	github.com/spf13/pflag v1.0.5
++	golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
+ )
+diff --git a/go.sum b/go.sum
+index c795477..05ea136 100644
+--- a/go.sum
++++ b/go.sum
+@@ -24,4 +24,6 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
+ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+ golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI=
+ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
++golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0=
++golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=