diff --git a/pkgs/applications/editors/jetbrains/JetbrainsRemoteDev.patch b/pkgs/applications/editors/jetbrains/JetbrainsRemoteDev.patch new file mode 100644 index 000000000000..e525512fe495 --- /dev/null +++ b/pkgs/applications/editors/jetbrains/JetbrainsRemoteDev.patch @@ -0,0 +1,17 @@ +--- a/plugins/remote-dev-server/bin/launcher.sh ++++ b/plugins/remote-dev-server/bin/launcher.sh +@@ -327,6 +327,8 @@ + REMOTE_DEV_SERVER_USE_SELF_CONTAINED_LIBS=1 + fi + ++REMOTE_DEV_SERVER_USE_SELF_CONTAINED_LIBS=0 ++ + if [ $REMOTE_DEV_SERVER_USE_SELF_CONTAINED_LIBS -eq 1 ]; then + SELFCONTAINED_LIBS="$REMOTE_DEV_SERVER_DIR/selfcontained/lib" + if [ ! -d "$SELFCONTAINED_LIBS" ]; then +@@ -568,3 +570,5 @@ + "$LAUNCHER" "$STARTER_COMMAND" "$PROJECT_PATH" "$@" + ;; + esac ++ ++unset REMOTE_DEV_SERVER_USE_SELF_CONTAINED_LIBS diff --git a/pkgs/applications/editors/jetbrains/linux.nix b/pkgs/applications/editors/jetbrains/linux.nix index 1c00e408aeac..efc939d0324f 100644 --- a/pkgs/applications/editors/jetbrains/linux.nix +++ b/pkgs/applications/editors/jetbrains/linux.nix @@ -84,6 +84,10 @@ with stdenv; lib.makeOverridable mkDerivation (rec { patchelf --set-interpreter "$interpreter" bin/fsnotifier munge_size_hack bin/fsnotifier $target_size fi + + if [ -d "plugins/remote-dev-server" ]; then + patch -p1 < ${./JetbrainsRemoteDev.patch} + fi ''; installPhase = '' @@ -99,7 +103,7 @@ with stdenv; lib.makeOverridable mkDerivation (rec { jdk=${jdk.home} item=${desktopItem} - makeWrapper "$out/$pname/bin/${loName}.sh" "$out/bin/${pname}" \ + wrapProgram "$out/$pname/bin/${loName}.sh" \ --prefix PATH : "$out/libexec/${pname}:${lib.makeBinPath [ jdk coreutils gnugrep which git python3 ]}" \ --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath ([ # Some internals want libstdc++.so.6 @@ -114,11 +118,14 @@ with stdenv; lib.makeOverridable mkDerivation (rec { --set ${hiName}_JDK "$jdk" \ --set ${hiName}_VM_OPTIONS ${vmoptsFile} + ln -s "$out/$pname/bin/${loName}.sh" $out/bin/$pname + 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 + ln -s "$out/$pname/bin/remote-dev-server-wrapped.sh" $out/bin/$pname-remote-dev-server ln -s "$item/share/applications" $out/share runHook postInstall ''; - } // lib.optionalAttrs (!(meta.license.free or true)) { preferLocalBuild = true; })