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 if stdenv.hostPlatform.system == "aarch64-darwin" then "macos-aarch64"
28 else throw "Unsupported system: ${stdenv.hostPlatform.system}";
30 desktopItem = makeDesktopItem {
33 comment = "Free Runtime Environment for Java Applications.";
34 desktopName = "Jameica";
35 genericName = "Jameica";
37 categories = [ "Office" ];
40 stdenv.mkDerivation rec {
44 src = fetchFromGitHub {
47 rev = "V_${builtins.replaceStrings ["."] ["_"] _version}_BUILD_${_build}";
48 hash = "sha256-MSVSd5DyVL+dcfTDv1M99hxickPwT2Pt6QGNsu6DGZI=";
51 nativeBuildInputs = [ ant jdk wrapGAppsHook3 makeWrapper stripJavaArchivesHook ];
52 buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ gtk2 glib libXtst ]
53 ++ lib.optional stdenv.hostPlatform.isDarwin Cocoa;
57 # there is also a build.gradle, but it only seems to be used to vendor 3rd party libraries
58 # and is not able to build the application itself
61 ant -f build -Dsystem.version=${version} init compile jar ${lib.optionalString stdenv.hostPlatform.isDarwin "zip lib"}
68 mkdir -p $out/libexec $out/lib $out/bin $out/share/{applications,jameica-${version},java}/
70 # copy libraries except SWT
71 cp $(find lib -type f -iname '*.jar' | grep -ve 'swt/.*/swt.jar') $out/share/jameica-${version}/
72 # copy platform-specific SWT
73 cp lib/swt/${swtSystem}/swt.jar $out/share/jameica-${version}/
75 install -Dm644 releases/${_version}-*/jameica/jameica.jar $out/share/java/
76 install -Dm644 plugin.xml $out/share/java/
77 install -Dm644 build/jameica-icon.png $out/share/pixmaps/jameica.png
78 cp ${desktopItem}/share/applications/* $out/share/applications/
79 '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
81 # Create .app bundle for macOS
82 mkdir -p $out/Applications
83 chmod +x releases/${_version}-${_build}-${_build}/tmp/jameica.app/jameica*.sh
84 cp -r releases/${_version}-${_build}-${_build}/tmp/jameica.app $out/Applications/Jameica.app
91 makeWrapper ${jre}/bin/java $out/bin/jameica \
92 --add-flags "-cp $out/share/java/jameica.jar:$out/share/jameica-${version}/* ${
93 lib.optionalString stdenv.hostPlatform.isDarwin ''-Xdock:name="Jameica" -XstartOnFirstThread''
94 } de.willuhn.jameica.Main" \
95 --prefix LD_LIBRARY_PATH : ${lib.escapeShellArg (lib.makeLibraryPath buildInputs)} \
96 --chdir "$out/share/java/" \
97 "''${gappsWrapperArgs[@]}"
101 homepage = "https://www.willuhn.de/products/jameica/";
102 description = "Free Runtime Environment for Java Applications";
104 Runtime Environment for plugins like Hibiscus (HBCI Online Banking),
105 SynTAX (accounting) and JVerein (club management).
107 sourceProvenance = with sourceTypes; [
109 binaryBytecode # source bundles dependencies as jars
111 license = licenses.gpl2Plus;
112 platforms = platforms.unix;
113 maintainers = with maintainers; [ flokli r3dl3g ];
114 mainProgram = "jameica";