jetbrains.plugins: clean-up

This commit is contained in:
Thiago Kenji Okada
2025-02-25 11:21:42 +00:00
parent 89d7d9b6dc
commit 7d049ce0d6
@@ -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
'';
};
}