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