a425ba4985
GitOrigin-RevId: 5b091d4fbe3b7b7493c3b46fe0842e4b30ea24b3
50 lines
1.1 KiB
Nix
50 lines
1.1 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchurl
|
|
, gawk
|
|
, git
|
|
, gnugrep
|
|
, installShellFiles
|
|
, jre
|
|
, makeWrapper
|
|
, crowdin-cli
|
|
, testVersion
|
|
, unzip
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "crowdin-cli";
|
|
version = "3.7.4";
|
|
|
|
src = fetchurl {
|
|
url = "https://github.com/crowdin/${pname}/releases/download/${version}/${pname}.zip";
|
|
sha256 = "sha256-zsd95dkKzuhqtWFwc84tjZ05MnzE25UvfF459gfp+lA=";
|
|
};
|
|
|
|
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
|
|
'';
|
|
|
|
passthru.tests.version = testVersion { package = crowdin-cli; };
|
|
|
|
meta = with lib; {
|
|
mainProgram = "crowdin";
|
|
homepage = "https://github.com/crowdin/crowdin-cli/";
|
|
description = "A command-line client for the Crowdin API";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ DamienCassou ];
|
|
};
|
|
}
|