blob: f89c284a2c76333ca9d76223b5bca3e2c115e011 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
{ callPackage, lib, stdenv, fetchurl, jre, makeWrapper }:
let this = stdenv.mkDerivation (finalAttrs: {
version = "7.7.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-OnVydsMdJJpPBqFGUbH/Hxpc9G4RCnCtzEpqKDT4VWE=";
};
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
|