7 , stripJavaArchivesHook
20 version = "${_version}-${_build}";
23 if stdenv.hostPlatform.system == "i686-linux" then "linux"
24 else if stdenv.hostPlatform.system == "x86_64-linux" then "linux64"
25 else if stdenv.hostPlatform.system == "aarch64-linux" then "linux-arm64"
26 else if stdenv.hostPlatform.system == "x86_64-darwin" then "macos64"
27 else throw "Unsupported system: ${stdenv.hostPlatform.system}";
29 desktopItem = makeDesktopItem {
32 comment = "Free Runtime Environment for Java Applications.";
33 desktopName = "Jameica";
34 genericName = "Jameica";
36 categories = [ "Office" ];
39 stdenv.mkDerivation rec {
43 src = fetchFromGitHub {
46 rev = "V_${builtins.replaceStrings ["."] ["_"] _version}_BUILD_${_build}";
47 hash = "sha256-MSVSd5DyVL+dcfTDv1M99hxickPwT2Pt6QGNsu6DGZI=";
50 nativeBuildInputs = [ ant jdk wrapGAppsHook makeWrapper stripJavaArchivesHook ];
51 buildInputs = lib.optionals stdenv.isLinux [ gtk2 glib libXtst ]
52 ++ lib.optional stdenv.isDarwin Cocoa;
56 # there is also a build.gradle, but it only seems to be used to vendor 3rd party libraries
57 # and is not able to build the application itself
60 ant -f build -Dsystem.version=${version} init compile jar
67 mkdir -p $out/libexec $out/lib $out/bin $out/share/{applications,jameica-${version},java}/
69 # copy libraries except SWT
70 cp $(find lib -type f -iname '*.jar' | grep -ve 'swt/.*/swt.jar') $out/share/jameica-${version}/
71 # copy platform-specific SWT
72 cp lib/swt/${swtSystem}/swt.jar $out/share/jameica-${version}/
74 install -Dm644 releases/${_version}-*/jameica/jameica.jar $out/share/java/
75 install -Dm644 plugin.xml $out/share/java/
76 install -Dm644 build/jameica-icon.png $out/share/pixmaps/jameica.png
77 cp ${desktopItem}/share/applications/* $out/share/applications/
83 makeWrapper ${jre}/bin/java $out/bin/jameica \
84 --add-flags "-cp $out/share/java/jameica.jar:$out/share/jameica-${version}/* ${
85 lib.optionalString stdenv.isDarwin ''-Xdock:name="Jameica" -XstartOnFirstThread''
86 } de.willuhn.jameica.Main" \
87 --prefix LD_LIBRARY_PATH : ${lib.escapeShellArg (lib.makeLibraryPath buildInputs)} \
88 --chdir "$out/share/java/" \
89 "''${gappsWrapperArgs[@]}"
93 homepage = "https://www.willuhn.de/products/jameica/";
94 description = "Free Runtime Environment for Java Applications";
96 Runtime Environment for plugins like Hibiscus (HBCI Online Banking),
97 SynTAX (accounting) and JVerein (club management).
99 sourceProvenance = with sourceTypes; [
101 binaryBytecode # source bundles dependencies as jars
103 license = licenses.gpl2Plus;
104 platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ];
105 maintainers = with maintainers; [ flokli r3dl3g ];
106 mainProgram = "jameica";