jetbrains: Select best available launcher and wrap in all cases

This commit is contained in:
hacker1024 2024-08-17 22:51:35 +10:00 committed by James Ward
parent d4f311a338
commit 5ed7d4c9a3
No known key found for this signature in database
GPG Key ID: 9A0B94DEC0FFA7EE

View File

@ -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