From 16013ac6c48392135ce59e629e78b56a8f4e09b0 Mon Sep 17 00:00:00 2001 From: Nicolas Benes Date: Tue, 16 Aug 2022 12:10:16 +0200 Subject: [PATCH] dataexplorer: init at 3.6.2 --- .../electronics/dataexplorer/default.nix | 67 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 69 insertions(+) create mode 100644 pkgs/applications/science/electronics/dataexplorer/default.nix diff --git a/pkgs/applications/science/electronics/dataexplorer/default.nix b/pkgs/applications/science/electronics/dataexplorer/default.nix new file mode 100644 index 000000000000..5745a43df26c --- /dev/null +++ b/pkgs/applications/science/electronics/dataexplorer/default.nix @@ -0,0 +1,67 @@ +{ lib +, stdenv +, fetchurl +, jdk +, jre +, ant +, makeWrapper +}: + +stdenv.mkDerivation rec { + pname = "dataexplorer"; + version = "3.6.2"; + + src = fetchurl { + url = "mirror://savannah/dataexplorer/dataexplorer-${version}-src.tar.gz"; + sha256 = "sha256-2e8qeoJh7z/RIowMtAd8PGcMPck5H8iHqel6bW7EQ0E="; + }; + + nativeBuildInputs = [ ant makeWrapper ]; + + buildInputs = [ jdk ]; + + buildPhase = '' + ant -f build/build.xml dist + ''; + + doCheck = false; + # Missing dependencies (e.g. junit). Does not work. + #checkPhase = '' + # ant -f build/build.xml check + #''; + + installPhase = '' + ant -Dprefix=$out/share/ -f build/build.xml install + + # The sources contain a wrapper script in $out/share/DataExplorer/DataExplorer + # but it hardcodes bash shebang and does not pin the java path. + # So we create our own wrapper, using similar cmdline args as upstream. + mkdir -p $out/bin + makeWrapper ${jre}/bin/java $out/bin/DataExplorer \ + --add-flags "-Dfile.encoding=UTF-8 -Xms64m -Xmx3092m -jar $out/share/DataExplorer/DataExplorer.jar" \ + --set SWT_GTK3 0 + + makeWrapper ${jre}/bin/java $out/bin/DevicePropertiesEditor \ + --add-flags "-Dfile.encoding=UTF-8 -Xms32m -Xmx512m -classpath $out/share/DataExplorer/DataExplorer.jar gde.ui.dialog.edit.DevicePropertiesEditor" \ + --set SWT_GTK3 0 \ + --set LIBOVERLAY_SCROLLBAR 0 + + install -Dvm644 build/misc/GNU_LINUX_JUNSI_ICHARER_DUO_UDEV_RULE/50-Junsi-iCharger-DUO.rules \ + $out/etc/udev/rules.d/50-Junsi-iCharger-DUO.rules + install -Dvm644 build/misc/GNU_LINUX_SKYRC_UDEV_RULE/50-SkyRC-Charger.rules \ + $out/etc/udev/rules.d/50-SkyRC-Charger.rules + ''; + + meta = with lib; { + description = "Graphical tool to analyze data, gathered from various hardware devices"; + homepage = "https://www.nongnu.org/dataexplorer/index.html"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ panicgh ]; + platforms = jdk.meta.platforms; + sourceProvenance = with sourceTypes; [ + fromSource + binaryNativeCode # contains RXTXcomm (JNI library with *.so files) + binaryBytecode # contains thirdparty jar files, e.g. javax.json, org.glassfish.json + ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cea0fd514050..b9151ac4cfb4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -34541,6 +34541,8 @@ with pkgs; csxcad = callPackage ../applications/science/electronics/csxcad { }; + dataexplorer = callPackage ../applications/science/electronics/dataexplorer { }; + diylc = callPackage ../applications/science/electronics/diylc { }; flatcam = callPackage ../applications/science/electronics/flatcam { };