2022-09-09 14:08:57 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, ant
|
2024-07-27 06:49:29 +00:00
|
|
|
# executable fails to start for jdk > 17
|
|
|
|
, jdk17
|
2022-09-09 14:08:57 +00:00
|
|
|
, makeWrapper
|
2024-04-21 15:54:59 +00:00
|
|
|
, strip-nondeterminism
|
2022-09-09 14:08:57 +00:00
|
|
|
}:
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-09-09 14:08:57 +00:00
|
|
|
pname = "dataexplorer";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "3.9.0";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-04-21 15:54:59 +00:00
|
|
|
url = "mirror://savannah/dataexplorer/dataexplorer-${finalAttrs.version}-src.tar.gz";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-MQAnLCkcs3r8/2j4zYaMC/JM8nBCEvqHKk8lv+7b9KE=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
ant
|
2024-07-27 06:49:29 +00:00
|
|
|
jdk17
|
2024-04-21 15:54:59 +00:00
|
|
|
makeWrapper
|
|
|
|
strip-nondeterminism
|
|
|
|
];
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
2024-04-21 15:54:59 +00:00
|
|
|
runHook preBuild
|
2022-09-09 14:08:57 +00:00
|
|
|
ant -f build/build.xml dist
|
2024-04-21 15:54:59 +00:00
|
|
|
runHook postBuild
|
2022-09-09 14:08:57 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
# Missing dependencies (e.g. junit). Does not work.
|
|
|
|
#checkPhase = ''
|
|
|
|
# ant -f build/build.xml check
|
|
|
|
#'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2024-04-21 15:54:59 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
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
|
2024-07-27 06:49:29 +00:00
|
|
|
makeWrapper ${jdk17}/bin/java $out/bin/DataExplorer \
|
2022-12-17 10:02:37 +00:00
|
|
|
--add-flags "-Xms64m -Xmx3092m -jar $out/share/DataExplorer/DataExplorer.jar" \
|
2022-09-09 14:08:57 +00:00
|
|
|
--set SWT_GTK3 0
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
makeWrapper ${jdk17}/bin/java $out/bin/DevicePropertiesEditor \
|
2022-12-17 10:02:37 +00:00
|
|
|
--add-flags "-Xms32m -Xmx512m -classpath $out/share/DataExplorer/DataExplorer.jar gde.ui.dialog.edit.DevicePropertiesEditor" \
|
2022-09-09 14:08:57 +00:00
|
|
|
--set SWT_GTK3 0 \
|
|
|
|
--set LIBOVERLAY_SCROLLBAR 0
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
install -Dvm644 build/misc/GNU_LINUX_JUNSI_ICHARER_USB_UDEV_RULE/50-Junsi-iCharger-USB.rules \
|
|
|
|
$out/etc/udev/rules.d/50-Junsi-iCharger-USB.rules
|
2022-09-09 14:08:57 +00:00
|
|
|
install -Dvm644 build/misc/GNU_LINUX_SKYRC_UDEV_RULE/50-SkyRC-Charger.rules \
|
|
|
|
$out/etc/udev/rules.d/50-SkyRC-Charger.rules
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
# manually call strip-nondeterminism because using stripJavaArchivesHook takes
|
|
|
|
# too long to strip bundled jars
|
|
|
|
postFixup = ''
|
|
|
|
strip-nondeterminism --type jar $out/share/DataExplorer/{DataExplorer.jar,devices/*.jar}
|
2022-09-09 14:08:57 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
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 ];
|
2022-12-17 10:02:37 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2022-09-09 14:08:57 +00:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
fromSource
|
|
|
|
binaryNativeCode # contains RXTXcomm (JNI library with *.so files)
|
|
|
|
binaryBytecode # contains thirdparty jar files, e.g. javax.json, org.glassfish.json
|
|
|
|
];
|
|
|
|
};
|
2024-04-21 15:54:59 +00:00
|
|
|
})
|