biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / misc / opentsdb / default.nix
blobc2156a88b3d0a781639bcbbe95fa307bf9421ba7
1 { lib
2 , stdenv
3 , autoconf
4 , automake
5 , curl
6 , fetchFromGitHub
7 , fetchMavenArtifact
8 , fetchpatch
9 , git
10 , jdk8
11 , makeWrapper
12 , nettools
13 , python3
16 let
17   jdk = jdk8;
18   jre = jdk8.jre;
19   artifacts = {
20     apache = [
21       (fetchMavenArtifact {
22         groupId = "org.apache.commons";
23         artifactId = "commons-math3";
24         version = "3.6.1";
25         hash = "sha256-HlbXsFjSi2Wr0la4RY44hbZ0wdWI+kPNfRy7nH7yswg=";
26       })
27     ];
28     guava = [
29       (fetchMavenArtifact {
30         groupId = "com.google.guava";
31         artifactId = "guava";
32         version = "18.0";
33         hash = "sha256-1mT7/APS5c6cqypE+wHx0L+d/r7MwaRzsfnqMfefb5k=";
34       })
35     ];
36     gwt = [
37       (fetchMavenArtifact {
38         groupId = "com.google.gwt";
39         artifactId = "gwt-dev";
40         version = "2.6.1";
41         hash = "sha256-iS8VpnMPuxE9L9hkTJVtW5Tqgw2TIYei47zRvkdoK0o=";
42       })
43       (fetchMavenArtifact {
44         groupId = "com.google.gwt";
45         artifactId = "gwt-user";
46         version = "2.6.1";
47         hash = "sha256-3IlJ+b6C0Gmuh7aAFg9+ldgvZCdfJmTB8qcdC4HZC9g=";
48       })
49       (fetchMavenArtifact {
50         groupId = "net.opentsdb";
51         artifactId = "opentsdb-gwt-theme";
52         version = "1.0.0";
53         hash = "sha256-JJsjcRlQmIrwpOtMweH12e/Ut5NG8R50VPiOAMMGEdc=";
54       })
55     ];
56     hamcrest = [
57       (fetchMavenArtifact {
58         url = "mirror://maven/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar";
59         groupId = "org.hamcrest";
60         artifactId = "hamcrest-core";
61         version = "1.3";
62         hash = "sha256-Zv3vkelzk0jfeglqo4SlaF9Oh1WEzOiThqekclHE2Ok=";
63       })
64     ];
65     hbase = [
66       (fetchMavenArtifact {
67         groupId = "org.hbase";
68         artifactId = "asynchbase";
69         version = "1.8.2";
70         hash = "sha256-D7mKprHMW23dE0SzdNsagv3Hp2G5HUN7sKfs1nVzQF4=";
71       })
72     ];
73     jackson = [
74       (fetchMavenArtifact {
75         groupId = "com.fasterxml.jackson.core";
76         artifactId = "jackson-annotations";
77         version = "2.14.1";
78         hash = "sha256-0lW0uGP/jscUqPlvpVw0Yh1D27grgtP1dHZJakwJ4ec=";
79       })
80       (fetchMavenArtifact {
81         groupId = "com.fasterxml.jackson.core";
82         artifactId = "jackson-core";
83         version = "2.14.1";
84         hash = "sha256-ARQYfilrNMkxwb+eWoQVK2K/q30YL1Yj85gtwto15SY=";
85       })
86       (fetchMavenArtifact {
87         groupId = "com.fasterxml.jackson.core";
88         artifactId = "jackson-databind";
89         version = "2.14.1";
90         hash = "sha256-QjoMgG3ks/petKKGmDBeOjd3xzHhvPobLzo3YMe253M=";
91       })
92     ];
93     javacc = [
94       (fetchMavenArtifact {
95         groupId = "net.java.dev.javacc";
96         artifactId = "javacc";
97         version = "6.1.2";
98         hash = "sha256-7Qxclglhz+tDE4LPAVKCewEVZ0fbN5LRv5PoHjLCBKs=";
99       })
100     ];
101     javassist = [
102       (fetchMavenArtifact {
103         groupId = "org.javassist";
104         artifactId = "javassist";
105         version = "3.21.0-GA";
106         hash = "sha256-eqWeAx+UGYSvB9rMbKhebcm9OkhemqJJTLwDTvoSJdA=";
107       })
108     ];
109     jexl = [
110       (fetchMavenArtifact {
111         groupId = "commons-logging";
112         artifactId = "commons-logging";
113         version = "1.2";
114         hash = "sha256-2t3qHqC+D1aXirMAa4rJKDSv7vvZt+TmMW/KV98PpjY=";
115       })
116       (fetchMavenArtifact {
117         groupId = "org.apache.commons";
118         artifactId = "commons-jexl";
119         version = "2.1.1";
120         hash = "sha256-A8mp+uXaeM5SwL8kRnzDc1W34jGW3/SDniwP8BigEwY=";
121       })
122     ];
123     jgrapht = [
124       (fetchMavenArtifact {
125         groupId = "org.jgrapht";
126         artifactId = "jgrapht-core";
127         version = "0.9.1";
128         hash = "sha256-5u8cEVaJ7aCBQrhtUkYg2mQ7bp8BNAUletB/QtxcaXg=";
129       })
130     ];
131     junit = [
132       (fetchMavenArtifact {
133         groupId = "junit";
134         artifactId = "junit";
135         version = "4.11";
136         hash = "sha256-kKjhYD7spI5+h586+8lWBxUyKYXzmidPb2BwtD+dBv4=";
137       })
138     ];
139     kryo = [
140       (fetchMavenArtifact {
141         groupId = "org.ow2.asm";
142         artifactId = "asm";
143         version = "4.0";
144         hash = "sha256-+y3ekCCke7AkxD2d4KlOc6vveTvwjwE1TMl8stLiqVc=";
145       })
146       (fetchMavenArtifact {
147         groupId = "com.esotericsoftware.kryo";
148         artifactId = "kryo";
149         version = "2.21.1";
150         hash = "sha256-adEG73euU3sZBp9WUQNLZBN6Y3UAZXTAxjsuvDuy7q4=";
151       })
152       (fetchMavenArtifact {
153         groupId = "com.esotericsoftware.minlog";
154         artifactId = "minlog";
155         version = "1.2";
156         hash = "sha256-pnjLGqj10D2QHJksdXQYQdmKm8PVXa0C6E1lMVxOYPI=";
157       })
158       (fetchMavenArtifact {
159         groupId = "com.esotericsoftware.reflectasm";
160         artifactId = "reflectasm";
161         version = "1.07";
162         classifier = "shaded";
163         hash = "sha256-CKcOrbSydO2u/BGUwfdXBiGlGwqaoDaqFdzbe5J+fHY=";
164       })
165     ];
166     logback = [
167       (fetchMavenArtifact {
168         groupId = "ch.qos.logback";
169         artifactId = "logback-classic";
170         version = "1.3.4";
171         hash = "sha256-uGal2myLeOFVxn/M11YoYNC1/Hdric2WjC8/Ljf8OgI=";
172       })
173       (fetchMavenArtifact {
174         groupId = "ch.qos.logback";
175         artifactId = "logback-core";
176         version = "1.3.4";
177         hash = "sha256-R0CgmLtEOnRFVN093wYsaCKHspQGZ1TikuE0bIv1zt0=";
178       })
179     ];
180     mockito = [
181       (fetchMavenArtifact {
182         groupId = "org.mockito";
183         artifactId = "mockito-core";
184         version = "1.9.5";
185         hash = "sha256-+XSDuglEufoTOqKWOHZN2+rbUew9vAIHTFj6LK7NB/o=";
186       })
187     ];
188     netty = [
189       (fetchMavenArtifact {
190         groupId = "io.netty";
191         artifactId = "netty";
192         version = "3.10.6.Final";
193         hash = "sha256-h2ilD749k6iNjmAA6l1o4w9Q3JFbN2TDxYcPcMT7O0k=";
194       })
195     ];
196     objenesis = [
197       (fetchMavenArtifact {
198         groupId = "org.objenesis";
199         artifactId = "objenesis";
200         version = "1.3";
201         hash = "sha256-3U7z0wkQY6T+xXjLsrvmwfkhwACRuimT3Nmv0l/5REo=";
202       })
203     ];
204     powermock = [
205       (fetchMavenArtifact {
206         groupId = "org.powermock";
207         artifactId = "powermock-mockito-release-full";
208         version = "1.5.4";
209         classifier = "full";
210         hash = "sha256-GWXaFG/ZtPlc7uKrghQHNAPzEu2k5VGYCYTXIlbylb4=";
211       })
212     ];
213     protobuf = [
214       (fetchMavenArtifact {
215         groupId = "com.google.protobuf";
216         artifactId = "protobuf-java";
217         version = "2.5.0";
218         hash = "sha256-4MHGRXXABWAXJefGoCzr+eEoXoiPdWsqHXP/qNclzHQ=";
219       })
220     ];
221     slf4j = [
222       (fetchMavenArtifact {
223         groupId = "org.slf4j";
224         artifactId = "log4j-over-slf4j";
225         version = "2.0.6";
226         hash = "sha256-QHMpiJioL0KeHr2iNaMUc7G0jDR94ShnNbtnkiUm6uQ=";
227       })
228       (fetchMavenArtifact {
229         groupId = "org.slf4j";
230         artifactId = "slf4j-api";
231         version = "2.0.6";
232         hash = "sha256-LyqS1BCyaBOdfWO3XtJeIZlc/kEAwZvyNXfP28gHe9o=";
233       })
234     ];
235     suasync = [
236       (fetchMavenArtifact {
237         groupId = "com.stumbleupon";
238         artifactId = "async";
239         version = "1.4.0";
240         hash = "sha256-FJ1HH68JOkjNtkShjLTJ8K4NO/A/qu88ap7J7SEndrM=";
241       })
242     ];
243     validation-api = [
244       (fetchMavenArtifact {
245         groupId = "javax.validation";
246         artifactId = "validation-api";
247         version = "1.0.0.GA";
248         hash = "sha256-5FnzE+vG2ySD+M6q05rwcIY2G0dPqS5A9ELo3l2Yldw=";
249       })
250       (fetchMavenArtifact {
251         groupId = "javax.validation";
252         artifactId = "validation-api";
253         version = "1.0.0.GA";
254         classifier = "sources";
255         hash = "sha256-o5TVKpt/4rsU8HGNKzyDCP/o836RGVYBI5jVXJ+fm1Q=";
256       })
257     ];
258     zookeeper = [
259       (fetchMavenArtifact {
260         groupId = "org.apache.zookeeper";
261         artifactId = "zookeeper";
262         version = "3.4.6";
263         hash = "sha256-ijdaHvmMvA4fbp39DZbZFLdNN60AtL+Bvrd/qPNNM64=";
264       })
265     ];
266   };
267 in stdenv.mkDerivation rec {
268   pname = "opentsdb";
269   version = "2.4.1";
271   src = fetchFromGitHub {
272     owner = "OpenTSDB";
273     repo = "opentsdb";
274     rev = "refs/tags/v${version}";
275     hash = "sha256-899m1H0UCLsI/bnSrNFnnny4MxSw3XBzf7rgDuEajDs=";
276   };
278   patches = [
279     (fetchpatch {
280       name = "bump-deps.0.patch";
281       url = "https://github.com/OpenTSDB/opentsdb/commit/2f4bbfba2f9a32f9295123e8b90adba022c11ece.patch";
282       hash = "sha256-4LpR4O8mNiJZQ7PUmAzFdkZAaF8i9/ZM5NhQ+8AJgSw=";
283     })
284     (fetchpatch {
285       name = "bump-deps.1.patch";
286       url = "https://github.com/OpenTSDB/opentsdb/commit/8c6a86ddbc367c7e4e2877973b70f77c105c6158.patch";
287       hash = "sha256-LZHqDOhwO/Gfgu870hJ6/uxnmigv7RP8OFe2a7Ug5SM=";
288     })
289     (fetchpatch {
290       name = "bump-deps.2.patch";
291       url = "https://github.com/OpenTSDB/opentsdb/commit/9b62442ba5c006376f57ef250fb7debe1047c3bf.patch";
292       hash = "sha256-2VjI9EkirKj4h7xhUtWdnKxJG0Noz3Hk5njm3pYEU1g=";
293     })
294     (fetchpatch {
295       name = "CVE-2023-25826.prerequisite.0.patch";
296       url = "https://github.com/OpenTSDB/opentsdb/commit/a82a4f85f0fc1af554a104f28cc495451b26b1f6.patch";
297       hash = "sha256-GgoRZUGdKthK+ZwMpgSQQ4V2oHyqi8SwWGZT571gltQ=";
298     })
299     (fetchpatch {
300       name = "CVE-2023-25826.prerequisite.1.patch";
301       url = "https://github.com/OpenTSDB/opentsdb/commit/22b27ea30a859a6dbdcd65fcdf61190d46e1b677.patch";
302       hash = "sha256-pXo6U7d4iy2squAiFvV2iDAQcNDdrl0pIOQEXfkJ3a8=";
303     })
304     (fetchpatch {
305       name = "CVE-2023-25826.patch";
306       url = "https://github.com/OpenTSDB/opentsdb/commit/07c4641471c6f5c2ab5aab615969e97211eb50d9.patch";
307       hash = "sha256-88gIOhAhLCQC/UesIdYtjf0UgKNfnO0W2icyoMmiC3U=";
308     })
309     (fetchpatch {
310       name = "CVE-2023-25827.patch";
311       url = "https://github.com/OpenTSDB/opentsdb/commit/fa88d3e4b5369f9fb73da384fab0b23e246309ba.patch";
312       hash = "sha256-FJHUiEmGhBIHoyOwNZtUWA36ENbrqDkUT8HfccmMSe8=";
313     })
314   ];
316   nativeBuildInputs = [
317     autoconf
318     automake
319     makeWrapper
320   ];
322   buildInputs = [ curl jdk nettools python3 git ];
324   preConfigure = ''
325     chmod +x build-aux/fetchdep.sh.in
326     patchShebangs ./build-aux/
327     ./bootstrap
328   '';
330   preBuild = lib.concatStrings (lib.mapAttrsToList (dir: lib.concatMapStrings (artifact: ''
331     cp ${artifact}/share/java/* third_party/${dir}
332   '')) artifacts);
334   postInstall = ''
335     wrapProgram $out/bin/tsdb \
336       --set JAVA_HOME "${jre}" \
337       --set JAVA "${jre}/bin/java"
338   '';
340   meta = with lib; {
341     description = "Time series database with millisecond precision";
342     homepage = "http://opentsdb.net";
343     license = licenses.lgpl21Plus;
344     platforms = lib.platforms.linux;
345     sourceProvenance = with sourceTypes; [
346       fromSource
347       binaryBytecode  # maven dependencies
348     ];
349     maintainers = [ ];
350     mainProgram = "tsdb";
351   };