depot/pkgs/tools/networking/openapi-generator-cli/default.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

45 lines
1.4 KiB
Nix

{ callPackage, lib, stdenv, fetchurl, jre, makeWrapper }:
let this = stdenv.mkDerivation (finalAttrs: {
version = "7.9.0";
pname = "openapi-generator-cli";
jarfilename = "openapi-generator-cli-${finalAttrs.version}.jar";
nativeBuildInputs = [
makeWrapper
];
src = fetchurl {
url = "mirror://maven/org/openapitools/openapi-generator-cli/${finalAttrs.version}/${finalAttrs.jarfilename}";
sha256 = "sha256-8Mt4OaLq2QQLIEUZsD8Uc7OcdyX9H0MTS7VQUVyz2+4=";
};
dontUnpack = true;
installPhase = ''
runHook preInstall
install -D "$src" "$out/share/java/${finalAttrs.jarfilename}"
makeWrapper ${jre}/bin/java $out/bin/${finalAttrs.pname} \
--add-flags "-jar $out/share/java/${finalAttrs.jarfilename}"
runHook postInstall
'';
meta = with lib; {
description = "Allows generation of API client libraries (SDK generation), server stubs and documentation automatically given an OpenAPI Spec";
homepage = "https://github.com/OpenAPITools/openapi-generator";
changelog = "https://github.com/OpenAPITools/openapi-generator/releases/tag/v${finalAttrs.version}";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
license = licenses.asl20;
maintainers = with maintainers; [ shou ];
mainProgram = "openapi-generator-cli";
};
passthru.tests.example = callPackage ./example.nix {
openapi-generator-cli = this;
};
});
in this