2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, makeDesktopItem, makeWrapper, ant, jdk, jre, gtk2, glib, xorg, Cocoa }:
|
2018-08-12 19:36:53 +01:00
|
|
|
|
|
|
|
let
|
2021-10-22 00:00:02 +01:00
|
|
|
_version = "2.10.0";
|
|
|
|
_build = "480";
|
2018-08-12 19:36:53 +01:00
|
|
|
version = "${_version}-${_build}";
|
|
|
|
name = "jameica-${version}";
|
|
|
|
|
2018-08-20 20:11:29 +01:00
|
|
|
swtSystem = if stdenv.hostPlatform.system == "i686-linux" then "linux"
|
|
|
|
else if stdenv.hostPlatform.system == "x86_64-linux" then "linux64"
|
|
|
|
else if stdenv.hostPlatform.system == "x86_64-darwin" then "macos64"
|
|
|
|
else throw "Unsupported system: ${stdenv.hostPlatform.system}";
|
2018-08-12 19:36:53 +01:00
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "jameica";
|
|
|
|
exec = "jameica";
|
|
|
|
comment = "Free Runtime Environment for Java Applications.";
|
|
|
|
desktopName = "Jameica";
|
|
|
|
genericName = "Jameica";
|
2020-05-01 01:11:24 +01:00
|
|
|
categories = "Office;";
|
2018-08-12 19:36:53 +01:00
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
inherit name version;
|
|
|
|
|
2018-10-09 22:26:00 +01:00
|
|
|
nativeBuildInputs = [ ant jdk makeWrapper ];
|
2021-01-15 05:42:41 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isLinux [ gtk2 glib xorg.libXtst ]
|
|
|
|
++ lib.optional stdenv.isDarwin Cocoa;
|
2018-08-12 19:36:53 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "willuhn";
|
|
|
|
repo = "jameica";
|
|
|
|
rev = "V_${builtins.replaceStrings ["."] ["_"] _version}_BUILD_${_build}";
|
2021-10-22 00:00:02 +01:00
|
|
|
sha256 = "0rzhbskzzvr9aan6fwxd2kmzg79ranx7aym5yn1i37z3ra67d1nz";
|
2018-08-12 19:36:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
# there is also a build.gradle, but it only seems to be used to vendor 3rd party libraries
|
|
|
|
# and is not able to build the application itself
|
|
|
|
buildPhase = ''
|
2018-10-09 22:26:00 +01:00
|
|
|
(cd build; ant -Dsystem.version=${version} init compile jar)
|
2018-08-12 19:36:53 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2018-08-17 15:22:00 +01:00
|
|
|
mkdir -p $out/libexec $out/lib $out/bin $out/share/{applications,${name},java}/
|
2018-08-12 19:36:53 +01:00
|
|
|
|
|
|
|
# copy libraries except SWT
|
2018-08-17 15:22:00 +01:00
|
|
|
cp $(find lib -type f -iname '*.jar' | grep -ve 'swt/.*/swt.jar') $out/share/${name}/
|
2018-08-12 19:36:53 +01:00
|
|
|
# copy platform-specific SWT
|
2018-08-17 15:22:00 +01:00
|
|
|
cp lib/swt/${swtSystem}/swt.jar $out/share/${name}/
|
2018-08-12 19:36:53 +01:00
|
|
|
|
2018-08-17 15:22:00 +01:00
|
|
|
install -Dm644 releases/${_version}-*/jameica/jameica.jar $out/share/java/
|
|
|
|
install -Dm644 plugin.xml $out/share/java/
|
2018-08-12 19:36:53 +01:00
|
|
|
install -Dm644 build/jameica-icon.png $out/share/pixmaps/jameica.png
|
|
|
|
cp ${desktopItem}/share/applications/* $out/share/applications/
|
|
|
|
|
2018-08-17 15:22:00 +01:00
|
|
|
makeWrapper ${jre}/bin/java $out/bin/jameica \
|
|
|
|
--add-flags "-cp $out/share/java/jameica.jar:$out/share/${name}/* ${
|
2021-01-15 05:42:41 +00:00
|
|
|
lib.optionalString stdenv.isDarwin ''-Xdock:name="Jameica" -XstartOnFirstThread''
|
2018-08-17 15:22:00 +01:00
|
|
|
} de.willuhn.jameica.Main" \
|
2021-01-15 05:42:41 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath buildInputs} \
|
2018-08-17 15:22:00 +01:00
|
|
|
--run "cd $out/share/java/"
|
2018-08-12 19:36:53 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.willuhn.de/products/jameica/";
|
2018-10-09 22:26:00 +01:00
|
|
|
description = "Free Runtime Environment for Java Applications";
|
2018-08-12 19:36:53 +01:00
|
|
|
longDescription = ''
|
|
|
|
Runtime Environment for plugins like Hibiscus (HBCI Online Banking),
|
|
|
|
SynTAX (accounting) and JVerein (club management).
|
|
|
|
'';
|
|
|
|
license = licenses.gpl2Plus;
|
2018-08-13 13:12:29 +01:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
|
2018-08-12 19:36:53 +01:00
|
|
|
maintainers = with maintainers; [ flokli ];
|
|
|
|
};
|
|
|
|
}
|