Unverified Commit 5ed7d4c9 authored by hacker1024's avatar hacker1024 Committed by James Ward
Browse files

jetbrains: Select best available launcher and wrap in all cases

parent d4f311a3
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -104,7 +104,14 @@ with stdenv; lib.makeOverridable mkDerivation (rec {
    jdk=${jdk.home}
    item=${desktopItem}

    wrapProgram  "$out/$pname/bin/${loName}.sh" \
    launcher="$out/$pname/bin/${loName}"
    if [ -e "$launcher" ]; then
      rm "$launcher".sh # We do not wrap the old script-style launcher anymore.
    else
      launcher+=.sh
    fi

    wrapProgram  "$launcher" \
      --prefix PATH : "${lib.makeBinPath [ jdk coreutils gnugrep which git ]}" \
      --suffix PATH : "${lib.makeBinPath [ python3 ]}" \
      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath extraLdPath}" \
@@ -117,7 +124,7 @@ with stdenv; lib.makeOverridable mkDerivation (rec {
      --set-default LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive" \
      --set-default ${vmoptsIDE}_VM_OPTIONS ${vmoptsFile}

    ln -s "$out/$pname/bin/${loName}" $out/bin/$pname
    ln -s "$launcher" $out/bin/$pname
    rm -rf $out/$pname/plugins/remote-dev-server/selfcontained/
    echo -e '#!/usr/bin/env bash\n'"$out/$pname/bin/remote-dev-server.sh"' "$@"' > $out/$pname/bin/remote-dev-server-wrapped.sh
    chmod +x $out/$pname/bin/remote-dev-server-wrapped.sh