2021-08-18 13:19:15 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, gawk
|
|
|
|
, git
|
|
|
|
, gnugrep
|
|
|
|
, installShellFiles
|
|
|
|
, jre
|
|
|
|
, makeWrapper
|
|
|
|
, unzip
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "crowdin-cli";
|
2021-08-25 08:27:29 +00:00
|
|
|
version = "3.6.5";
|
2021-08-18 13:19:15 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/crowdin/${pname}/releases/download/${version}/${pname}.zip";
|
2021-08-25 08:27:29 +00:00
|
|
|
sha256 = "sha256-9bw85dFazlcbZhx/bUoxW4iIsw+RdE3d+O5Cj3Obb7A=";
|
2021-08-18 13:19:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|