From 7d049ce0d65d43f9e0aef6d97216931b992d37fd Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Mon, 24 Feb 2025 21:43:13 +0000 Subject: [PATCH] jetbrains.plugins: clean-up --- .../editors/jetbrains/plugins/default.nix | 35 ++++++------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/pkgs/applications/editors/jetbrains/plugins/default.nix b/pkgs/applications/editors/jetbrains/plugins/default.nix index e1868da0efe6..af86b016b5a7 100644 --- a/pkgs/applications/editors/jetbrains/plugins/default.nix +++ b/pkgs/applications/editors/jetbrains/plugins/default.nix @@ -112,40 +112,25 @@ in { rm -f $out/${rootDir}/plugins/plugin-classpath.txt ( - IFS=' ' read -ra pluginArray <<< "$newPlugins" shopt -s nullglob + + IFS=' ' read -ra pluginArray <<< "$newPlugins" for plugin in "''${pluginArray[@]}"; do - pluginfiles=($plugin) - if [[ ''${#pluginfiles[@]} -eq 1 ]] && [[ "$pluginfiles" == *.jar ]]; then + if [[ "$plugin" == *.jar ]]; then # if the plugin contains a single jar file, link it directly into the plugins folder - ln -s "$pluginfiles" $out/${rootDir}/plugins/ + ln -s "$plugin" $out/${rootDir}/plugins/ else # otherwise link the plugin directory itself ln -s "$plugin" -t $out/${rootDir}/plugins/ fi done + + for exe in $out/bin/${meta.mainProgram}*; do + if [[ -x "$exe" ]]; then + substituteInPlace $(realpath "$exe") --replace-warn '${ide.outPath}' $out + fi + done ) - - substituteInPlace $(realpath "$out/bin/${meta.mainProgram}") \ - --replace-warn '${ide.outPath}' $out - IFS=' ' read -ra pluginArray <<< "$newPlugins" - for plugin in "''${pluginArray[@]}"; do - if [[ "$plugin" == *.jar ]]; then - # if the plugin contains a single jar file, link it directly into the plugins folder - ln -s "$plugin" $out/${rootDir}/plugins/ - else - # otherwise link the plugin directory itself - ln -s "$plugin" -t $out/${rootDir}/plugins/ - fi - done - - remote_dev="$out/bin/${meta.mainProgram}-remote-dev-server" - if [[ -f "$remote_dev" ]]; then - substituteInPlace $(realpath "$remote_dev") \ - --replace-warn '${ide.outPath}' $out - fi - '' + lib.optionalString stdenv.hostPlatform.isLinux '' - autoPatchelf $out ''; }; }