2021-08-18 13:19:15 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, gawk
|
|
|
|
, git
|
|
|
|
, gnugrep
|
|
|
|
, installShellFiles
|
|
|
|
, jre
|
|
|
|
, makeWrapper
|
2022-04-27 09:35:20 +00:00
|
|
|
, testers
|
2021-08-18 13:19:15 +00:00
|
|
|
, unzip
|
|
|
|
}:
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-08-18 13:19:15 +00:00
|
|
|
pname = "crowdin-cli";
|
2024-09-26 11:04:55 +00:00
|
|
|
version = "4.2.0";
|
2021-08-18 13:19:15 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-09-26 11:04:55 +00:00
|
|
|
url = "https://github.com/crowdin/crowdin-cli/releases/download/${finalAttrs.version}/crowdin-cli.zip";
|
|
|
|
hash = "sha256-158zbgYw4FP/vQVsSs9tt9VcisBWpRn/D4ORiM24PYY=";
|
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
|
|
|
|
'';
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
passthru.tests.version = testers.testVersion { package = finalAttrs.finalPackage; };
|
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/";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "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 ];
|
|
|
|
};
|
2024-09-26 11:04:55 +00:00
|
|
|
})
|