2021-08-18 13:19:15 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, gawk
|
|
|
|
, git
|
|
|
|
, gnugrep
|
|
|
|
, installShellFiles
|
|
|
|
, jre
|
|
|
|
, makeWrapper
|
2021-12-06 16:07:01 +00:00
|
|
|
, crowdin-cli
|
2022-04-27 09:35:20 +00:00
|
|
|
, testers
|
2021-08-18 13:19:15 +00:00
|
|
|
, unzip
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "crowdin-cli";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "4.0.0";
|
2021-08-18 13:19:15 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/crowdin/${pname}/releases/download/${version}/${pname}.zip";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-7KyQUnl2O/raQLcP5VsMCX3084Mn6HFfxjJmksAkWBc=";
|
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
|
|
|
|
'';
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
passthru.tests.version = testers.testVersion { package = crowdin-cli; };
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2021-08-18 13:19:15 +00:00
|
|
|
meta = with lib; {
|
2021-12-06 16:07:01 +00:00
|
|
|
mainProgram = "crowdin";
|
2021-08-18 13:19:15 +00:00
|
|
|
homepage = "https://github.com/crowdin/crowdin-cli/";
|
|
|
|
description = "A command-line client for the Crowdin API";
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2021-08-18 13:19:15 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ DamienCassou ];
|
|
|
|
};
|
|
|
|
}
|