lol
1{
2 stdenv,
3 fetchurl,
4 makeWrapper,
5 jre,
6 lib,
7}:
8let
9 pname = "avro-tools";
10 version = "1.12.0";
11in
12stdenv.mkDerivation {
13 inherit pname version;
14
15 src = fetchurl {
16 url = "mirror://maven/org/apache/avro/avro-tools/${version}/${pname}-${version}.jar";
17 sha256 = "sha256-+OTQ2UWFLcL5HDv4j33LjKvADg/ClbuS6JPlSUXggIU=";
18 };
19
20 dontUnpack = true;
21
22 buildInputs = [ jre ];
23 nativeBuildInputs = [ makeWrapper ];
24 sourceRoot = ".";
25
26 installPhase = ''
27 mkdir -p $out/bin
28 mkdir -p $out/libexec/avro-tools
29 cp $src $out/libexec/avro-tools/${pname}.jar
30
31 makeWrapper ${jre}/bin/java $out/bin/avro-tools \
32 --add-flags "-jar $out/libexec/avro-tools/${pname}.jar"
33 '';
34
35 meta = {
36 homepage = "https://avro.apache.org/";
37 description = "Avro command-line tools and utilities";
38 mainProgram = "avro-tools";
39 sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
40 license = lib.licenses.asl20;
41 maintainers = with lib.maintainers; [ momeemt ];
42 };
43}