1{ lib
2, stdenv
3, fetchurl
4, ant
5, jdk
6, makeWrapper
7, strip-nondeterminism
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "dataexplorer";
12 version = "3.8.5";
13
14 src = fetchurl {
15 url = "mirror://savannah/dataexplorer/dataexplorer-${finalAttrs.version}-src.tar.gz";
16 hash = "sha256-b68xIZNbzHdPyZwLngcnjcoBtI6AeTdrblz/qx/HbGQ=";
17 };
18
19 nativeBuildInputs = [
20 ant
21 jdk
22 makeWrapper
23 strip-nondeterminism
24 ];
25
26 buildPhase = ''
27 runHook preBuild
28 ant -f build/build.xml dist
29 runHook postBuild
30 '';
31
32 doCheck = false;
33 # Missing dependencies (e.g. junit). Does not work.
34 #checkPhase = ''
35 # ant -f build/build.xml check
36 #'';
37
38 installPhase = ''
39 runHook preInstall
40
41 ant -Dprefix=$out/share/ -f build/build.xml install
42
43 # The sources contain a wrapper script in $out/share/DataExplorer/DataExplorer
44 # but it hardcodes bash shebang and does not pin the java path.
45 # So we create our own wrapper, using similar cmdline args as upstream.
46 mkdir -p $out/bin
47 makeWrapper ${jdk}/bin/java $out/bin/DataExplorer \
48 --add-flags "-Xms64m -Xmx3092m -jar $out/share/DataExplorer/DataExplorer.jar" \
49 --set SWT_GTK3 0
50
51 makeWrapper ${jdk}/bin/java $out/bin/DevicePropertiesEditor \
52 --add-flags "-Xms32m -Xmx512m -classpath $out/share/DataExplorer/DataExplorer.jar gde.ui.dialog.edit.DevicePropertiesEditor" \
53 --set SWT_GTK3 0 \
54 --set LIBOVERLAY_SCROLLBAR 0
55
56 install -Dvm644 build/misc/GNU_LINUX_JUNSI_ICHARER_USB_UDEV_RULE/50-Junsi-iCharger-USB.rules \
57 $out/etc/udev/rules.d/50-Junsi-iCharger-USB.rules
58 install -Dvm644 build/misc/GNU_LINUX_SKYRC_UDEV_RULE/50-SkyRC-Charger.rules \
59 $out/etc/udev/rules.d/50-SkyRC-Charger.rules
60
61 runHook postInstall
62 '';
63
64 # manually call strip-nondeterminism because using stripJavaArchivesHook takes
65 # too long to strip bundled jars
66 postFixup = ''
67 strip-nondeterminism --type jar $out/share/DataExplorer/{DataExplorer.jar,devices/*.jar}
68 '';
69
70 meta = with lib; {
71 description = "Graphical tool to analyze data, gathered from various hardware devices";
72 homepage = "https://www.nongnu.org/dataexplorer/index.html";
73 license = licenses.gpl3Plus;
74 maintainers = with maintainers; [ panicgh ];
75 platforms = [ "x86_64-linux" ];
76 sourceProvenance = with sourceTypes; [
77 fromSource
78 binaryNativeCode # contains RXTXcomm (JNI library with *.so files)
79 binaryBytecode # contains thirdparty jar files, e.g. javax.json, org.glassfish.json
80 ];
81 };
82})