about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/translate-shell
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/translate-shell')
-rw-r--r--nixpkgs/pkgs/applications/misc/translate-shell/default.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/misc/translate-shell/default.nix b/nixpkgs/pkgs/applications/misc/translate-shell/default.nix
new file mode 100644
index 000000000000..9fb8469cf27a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/translate-shell/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, makeWrapper, curl, fribidi, rlwrap, gawk, groff, ncurses }:
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  pname = "translate-shell";
+  version = "0.9.6.10";
+
+  src = fetchFromGitHub {
+    owner = "soimort";
+    repo = "translate-shell";
+    rev = "v${version}";
+    sha256 = "1dmh3flldfhnqfay3a6c5hanqcjwrmbly1bq8mlk022qfi1fv33y";
+  };
+
+  buildInputs = [ makeWrapper ];
+
+  installFlags = [ "PREFIX=$(out)" ];
+
+  postInstall = ''
+    wrapProgram $out/bin/trans \
+      --prefix PATH : ${stdenv.lib.makeBinPath [
+        gawk
+        curl
+        ncurses
+        rlwrap
+        groff
+        fribidi
+      ]}
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://www.soimort.org/translate-shell;
+    description = "Command-line translator using Google Translate, Bing Translator, Yandex.Translate, and Apertium";
+    license = licenses.unlicense;
+    maintainers = with maintainers; [ ebzzry infinisil ];
+    platforms = platforms.unix;
+  };
+}