1 { lib, stdenv, fetchFromGitHub, makeDesktopItem, makeWrapper, wrapGAppsHook, ant, jdk, jre, gtk2, glib, xorg, Cocoa }:
6 version = "${_version}-${_build}";
9 if stdenv.hostPlatform.system == "i686-linux" then "linux"
10 else if stdenv.hostPlatform.system == "x86_64-linux" then "linux64"
11 else if stdenv.hostPlatform.system == "aarch64-linux" then "linux-arm64"
12 else if stdenv.hostPlatform.system == "x86_64-darwin" then "macos64"
13 else throw "Unsupported system: ${stdenv.hostPlatform.system}";
15 desktopItem = makeDesktopItem {
18 comment = "Free Runtime Environment for Java Applications.";
19 desktopName = "Jameica";
20 genericName = "Jameica";
22 categories = [ "Office" ];
25 stdenv.mkDerivation rec {
29 nativeBuildInputs = [ ant jdk wrapGAppsHook makeWrapper ];
30 buildInputs = lib.optionals stdenv.isLinux [ gtk2 glib xorg.libXtst ]
31 ++ lib.optional stdenv.isDarwin Cocoa;
33 src = fetchFromGitHub {
36 rev = "V_${builtins.replaceStrings ["."] ["_"] _version}_BUILD_${_build}";
37 sha256 = "1x9sybknzsfxp9z0pvw9dx80732ynyap57y03p7xwwjbcrnjla57";
42 # there is also a build.gradle, but it only seems to be used to vendor 3rd party libraries
43 # and is not able to build the application itself
45 (cd build; ant -Dsystem.version=${version} init compile jar)
49 mkdir -p $out/libexec $out/lib $out/bin $out/share/{applications,jameica-${version},java}/
51 # copy libraries except SWT
52 cp $(find lib -type f -iname '*.jar' | grep -ve 'swt/.*/swt.jar') $out/share/jameica-${version}/
53 # copy platform-specific SWT
54 cp lib/swt/${swtSystem}/swt.jar $out/share/jameica-${version}/
56 install -Dm644 releases/${_version}-*/jameica/jameica.jar $out/share/java/
57 install -Dm644 plugin.xml $out/share/java/
58 install -Dm644 build/jameica-icon.png $out/share/pixmaps/jameica.png
59 cp ${desktopItem}/share/applications/* $out/share/applications/
63 makeWrapper ${jre}/bin/java $out/bin/jameica \
64 --add-flags "-cp $out/share/java/jameica.jar:$out/share/jameica-${version}/* ${
65 lib.optionalString stdenv.isDarwin ''-Xdock:name="Jameica" -XstartOnFirstThread''
66 } de.willuhn.jameica.Main" \
67 --prefix LD_LIBRARY_PATH : ${lib.escapeShellArg (lib.makeLibraryPath buildInputs)} \
68 --chdir "$out/share/java/" \
69 "''${gappsWrapperArgs[@]}"
73 homepage = "https://www.willuhn.de/products/jameica/";
74 description = "Free Runtime Environment for Java Applications";
76 Runtime Environment for plugins like Hibiscus (HBCI Online Banking),
77 SynTAX (accounting) and JVerein (club management).
79 sourceProvenance = with sourceTypes; [
81 binaryBytecode # source bundles dependencies as jars
83 license = licenses.gpl2Plus;
84 platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ];
85 maintainers = with maintainers; [ flokli r3dl3g ];