about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIlan Joselevich2023-05-22 22:01:03 +0300
committerGitHub2023-05-22 22:01:03 +0300
commit29cdfd50f06e966f7498a21d344a6385299f1177 (patch)
tree273b88360739c90686100263f664328af7549c01
parent1bcd6604379c22f28e2c6a21515a8ac8db503839 (diff)
parent5b3843c25d732e5ba0ff1f78ad499611f9e9f8ee (diff)
Merge pull request #233234 from figsoda/abbr
abbreviate: init at 1.6.0
-rw-r--r--pkgs/tools/text/abbreviate/default.nix40
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/tools/text/abbreviate/default.nix b/pkgs/tools/text/abbreviate/default.nix
new file mode 100644
index 000000000000..aedf4d173006
--- /dev/null
+++ b/pkgs/tools/text/abbreviate/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, installShellFiles
+}:
+
+buildGoModule rec {
+  pname = "abbreviate";
+  version = "1.6.0";
+
+  src = fetchFromGitHub {
+    owner = "dnnrly";
+    repo = "abbreviate";
+    rev = "v${version}";
+    hash = "sha256-foGg+o+BbPsfpph+XHIfyPaknQD1N1rcZW58kgZ5HYM=";
+  };
+
+  vendorHash = "sha256-9z3M3FEjllNpae+5EcLVkF1rAtOQzUQGebJeU7QsmTA=";
+
+  nativeBuildInputs = [
+    installShellFiles
+  ];
+
+  ldflags = [ "-s" "-w" ];
+
+  postInstall = ''
+    installShellCompletion --cmd abbreviate \
+      --bash <($out/bin/abbreviate completion bash) \
+      --fish <($out/bin/abbreviate completion fish) \
+      --zsh <($out/bin/abbreviate completion zsh)
+  '';
+
+  meta = with lib; {
+    description = "Shorten your strings using common abbreviations";
+    homepage = "https://github.com/dnnrly/abbreviate";
+    changelog = "https://github.com/dnnrly/abbreviate/releases/tag/${src.rev}";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 1c05843ea7ef..548f3338be05 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1285,6 +1285,8 @@ with pkgs;
 
   a2ps = callPackage ../tools/text/a2ps { };
 
+  abbreviate = callPackage ../tools/text/abbreviate { };
+
   abcm2ps = callPackage ../tools/audio/abcm2ps { };
 
   abcmidi = callPackage ../tools/audio/abcmidi { };