From 30f0011bb2bb5eb8edbfa3235bd947aca21ba8bd Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 17 Aug 2018 16:22:00 +0200 Subject: [PATCH] jameica: get rid of launcher script, only use makeWrapper This also switches using java paths suggested by docs instead of $out/share/libexec --- pkgs/applications/office/jameica/default.nix | 27 ++++++++------------ 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/pkgs/applications/office/jameica/default.nix b/pkgs/applications/office/jameica/default.nix index 7b804151d4a7..fdc6c58213a1 100644 --- a/pkgs/applications/office/jameica/default.nix +++ b/pkgs/applications/office/jameica/default.nix @@ -11,11 +11,6 @@ let else if stdenv.system == "x86_64-darwin" then "macos64" else throw "Unsupported system: ${stdenv.system}"; - launcher = '' - #!${stdenv.shell} - exec ${jre}/bin/java -Xmx512m ${ stdenv.lib.optionalString stdenv.isDarwin ''-Xdock:name="Jameica" -XstartOnFirstThread''} de.willuhn.jameica.Main "$@" - ''; - desktopItem = makeDesktopItem { name = "jameica"; exec = "jameica"; @@ -56,24 +51,24 @@ stdenv.mkDerivation rec { ''; installPhase = '' - mkdir -p $out/libexec $out/lib $out/bin $out/share/applications + mkdir -p $out/libexec $out/lib $out/bin $out/share/{applications,${name},java}/ # copy libraries except SWT - cp $(find lib -type f -iname '*.jar' | grep -ve 'swt/.*/swt.jar') $out/lib/ + cp $(find lib -type f -iname '*.jar' | grep -ve 'swt/.*/swt.jar') $out/share/${name}/ # copy platform-specific SWT - cp lib/swt/${swtSystem}/swt.jar $out/lib + cp lib/swt/${swtSystem}/swt.jar $out/share/${name}/ - install -Dm644 releases/${_version}-*/jameica/jameica.jar $out/libexec/ - install -Dm644 plugin.xml $out/libexec/ + install -Dm644 releases/${_version}-*/jameica/jameica.jar $out/share/java/ + install -Dm644 plugin.xml $out/share/java/ install -Dm644 build/jameica-icon.png $out/share/pixmaps/jameica.png cp ${desktopItem}/share/applications/* $out/share/applications/ - echo "${launcher}" > $out/bin/jameica - chmod +x $out/bin/jameica - wrapProgram $out/bin/jameica --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath buildInputs} \ - --set CLASSPATH "$out/libexec/jameica.jar:$out/lib/*" \ - --run "cd $out/libexec" - # jameica expects its working dir set to the "program directory" + makeWrapper ${jre}/bin/java $out/bin/jameica \ + --add-flags "-cp $out/share/java/jameica.jar:$out/share/${name}/* ${ + stdenv.lib.optionalString stdenv.isDarwin ''-Xdock:name="Jameica" -XstartOnFirstThread'' + } de.willuhn.jameica.Main" \ + --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath buildInputs} \ + --run "cd $out/share/java/" ''; meta = with stdenv.lib; {