Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jameica: get rid of launcher script, only use makeWrapper #45270

Merged
merged 1 commit into from
Aug 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 11 additions & 16 deletions pkgs/applications/office/jameica/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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; {
Expand Down