mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 08:53:21 +00:00
jetbrains: add support for plugins on darwin (#242562)
This commit is contained in:
commit
4765af7624
@ -19,8 +19,10 @@ let
|
||||
loname = lib.toLower productShort;
|
||||
in
|
||||
stdenvNoCC.mkDerivation {
|
||||
inherit pname meta src version plugins;
|
||||
inherit pname src version plugins;
|
||||
passthru.buildNumber = buildNumber;
|
||||
passthru.product = product;
|
||||
meta = meta // { mainProgram = loname; };
|
||||
desktopName = product;
|
||||
dontFixup = true;
|
||||
installPhase = ''
|
||||
|
@ -90,23 +90,33 @@ in {
|
||||
passthru.plugins = plugins ++ (ide.plugins or [ ]);
|
||||
newPlugins = plugins;
|
||||
disallowedReferences = [ ide ];
|
||||
nativeBuildInputs = [ autoPatchelfHook ] ++ (ide.nativeBuildInputs or [ ]);
|
||||
nativeBuildInputs = (lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook) ++ (ide.nativeBuildInputs or [ ]);
|
||||
buildInputs = lib.unique ((ide.buildInputs or [ ]) ++ [ glib ]);
|
||||
|
||||
inherit (ide) meta;
|
||||
|
||||
buildPhase = ''
|
||||
buildPhase =
|
||||
let
|
||||
rootDir = if stdenv.hostPlatform.isDarwin then "Applications/${ide.product}.app/Contents" else meta.mainProgram;
|
||||
in
|
||||
''
|
||||
cp -r ${ide} $out
|
||||
chmod +w -R $out
|
||||
rm -f $out/${meta.mainProgram}/plugins/plugin-classpath.txt
|
||||
rm -f $out/${rootDir}/plugins/plugin-classpath.txt
|
||||
IFS=' ' read -ra pluginArray <<< "$newPlugins"
|
||||
for plugin in "''${pluginArray[@]}"
|
||||
do
|
||||
ln -s "$plugin" -t $out/${meta.mainProgram}/plugins/
|
||||
ln -s "$plugin" -t "$out/${rootDir}/plugins/"
|
||||
done
|
||||
sed "s|${ide.outPath}|$out|" \
|
||||
-i $(realpath $out/bin/${meta.mainProgram}) \
|
||||
-i $(realpath $out/bin/${meta.mainProgram}-remote-dev-server)
|
||||
-i $(realpath $out/bin/${meta.mainProgram})
|
||||
|
||||
if test -f "$out/bin/${meta.mainProgram}-remote-dev-server"; then
|
||||
sed "s|${ide.outPath}|$out|" \
|
||||
-i $(realpath $out/bin/${meta.mainProgram}-remote-dev-server)
|
||||
fi
|
||||
|
||||
'' + lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||
autoPatchelf $out
|
||||
'';
|
||||
};
|
||||
|
@ -4,17 +4,17 @@
|
||||
{
|
||||
"631" = {
|
||||
# Python
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
nativeBuildInputs = lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook;
|
||||
buildInputs = [ stdenv.cc.cc.lib ];
|
||||
};
|
||||
"7322" = {
|
||||
# Python community edition
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
nativeBuildInputs = lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook;
|
||||
buildInputs = [ stdenv.cc.cc.lib ];
|
||||
};
|
||||
"8182" = {
|
||||
# Rust (deprecated)
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
nativeBuildInputs = lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook;
|
||||
buildInputs = [ stdenv.cc.cc.lib ];
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
@ -65,7 +65,7 @@
|
||||
};
|
||||
"22407" = {
|
||||
# Rust
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
nativeBuildInputs = lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook;
|
||||
buildInputs = [ stdenv.cc.cc.lib ];
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
Loading…
Reference in New Issue
Block a user