diff options
Diffstat (limited to 'nixpkgs/pkgs/tools/text/crowdin-cli/default.nix')
-rw-r--r-- | nixpkgs/pkgs/tools/text/crowdin-cli/default.nix | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/text/crowdin-cli/default.nix b/nixpkgs/pkgs/tools/text/crowdin-cli/default.nix new file mode 100644 index 000000000000..f5c489681e93 --- /dev/null +++ b/nixpkgs/pkgs/tools/text/crowdin-cli/default.nix @@ -0,0 +1,45 @@ +{ lib +, stdenv +, fetchurl +, gawk +, git +, gnugrep +, installShellFiles +, jre +, makeWrapper +, unzip +}: + +stdenv.mkDerivation rec { + pname = "crowdin-cli"; + version = "3.7.0"; + + src = fetchurl { + url = "https://github.com/crowdin/${pname}/releases/download/${version}/${pname}.zip"; + sha256 = "sha256-2TQL5k2ndckFjOOXNz7clVpwPUMStR4xgd1P+qUhNC8="; + }; + + nativeBuildInputs = [ installShellFiles makeWrapper unzip ]; + + installPhase = '' + runHook preInstall + + install -D crowdin-cli.jar $out/lib/crowdin-cli.jar + + installShellCompletion --cmd crowdin --bash ./crowdin_completion + + makeWrapper ${jre}/bin/java $out/bin/crowdin \ + --argv0 crowdin \ + --add-flags "-jar $out/lib/crowdin-cli.jar" \ + --prefix PATH : ${lib.makeBinPath [ gawk gnugrep git ]} + + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://github.com/crowdin/crowdin-cli/"; + description = "A command-line client for the Crowdin API"; + license = licenses.mit; + maintainers = with maintainers; [ DamienCassou ]; + }; +} |