Revert "jetbrains: update IDEA for generated plugins"

This reverts commit d851231ee9.

The change went ahead too early and the actual plugin generation system
is not complete.
This commit is contained in:
xeals 2020-12-09 10:35:02 +11:00
parent 80f909abb1
commit 8548791f31
Signed by: xeals
GPG Key ID: A498C7AF27EC6B5C
6 changed files with 29 additions and 101 deletions

View File

@ -4,7 +4,7 @@ self:
let let
commonBuild = import ../../../build-support/jetbrains/plugin-old.nix { commonBuild = import ../../../build-support/jetbrains/plugin.nix {
inherit lib stdenv fetchzip; inherit lib stdenv fetchzip;
jetbrainsPlatforms = [ jetbrainsPlatforms = [
"clion" "clion"

View File

@ -1,19 +1,19 @@
{ lib, stdenv, variant }: { lib, stdenv, fetchzip }:
self: self:
let let
ideaBuild = import ../../../build-support/jetbrains/plugin.nix { ideaBuild = import ../../../build-support/jetbrains/plugin.nix {
inherit lib stdenv variant; inherit lib stdenv fetchzip;
jetbrainsPlatforms = [ "idea-community" "idea-ultimate" ]; jetbrainsPlatforms = [ "idea-community" "idea-ultimate" ];
}; };
generateIdea = lib.makeOverridable ({ generateIdea = lib.makeOverridable ({
generated ? ./idea-generated.nix idea ? ./manual-idea-packages.nix
}: let }: let
imported = import generated { imported = import idea {
inherit (self) callPackage; inherit (self) callPackage;
}; };
@ -26,3 +26,4 @@ let
in ideaPlugins // { inherit ideaBuild; }); in ideaPlugins // { inherit ideaBuild; });
in generateIdea { } in generateIdea { }

View File

@ -21,13 +21,11 @@ in
assert assertMsg (length badPlugins == 0) errorMsg; assert assertMsg (length badPlugins == 0) errorMsg;
appendToName "with-plugins" (package.overrideAttrs (oldAttrs: { appendToName "with-plugins" (package.overrideAttrs (oldAttrs: {
inherit plugins; passthru = { inherit plugins; };
# TODO: Remove version from directory name # TODO: Purely aesthetics, but link the plugin to its name instead of hash-name-version
installPhase = oldAttrs.installPhase + '' installPhase = oldAttrs.installPhase + ''
for plugin in $plugins; do for plugin in $plugins; do
local dirname=$(basename "$plugin") ln -s "$plugin" "$out/$name/plugins/$(basename $plugin)"
dirname=''${dirname:33}
ln -s "$plugin" "$out/$name/plugins/$dirname"
done done
''; '';
})) }))

View File

@ -1,33 +0,0 @@
{ lib
, stdenv
, fetchzip
, jetbrainsPlatforms
}:
{ pluginId
, pname
, version
, versionId
, sha256
, filename ? "${pname}-${version}.zip"
}:
stdenv.mkDerivation {
inherit pname version;
src = fetchzip {
inherit sha256;
url = "https://plugins.jetbrains.com/files/${toString pluginId}/${toString versionId}/${filename}";
};
passthru = { inherit jetbrainsPlatforms; };
installPhase = ''
mkdir $out
cp -r * $out/
'';
meta = {
homepage = "https://plugins.jetbrains.com/plugin/${pluginId}-${lib.toLower pname}";
};
}

View File

@ -1,71 +1,33 @@
{ lib { lib
, stdenv , stdenv
, variant , fetchzip
, jetbrainsPlatforms , jetbrainsPlatforms
}: }:
with lib; { pluginId
, pname
{ pname
, version , version
, versionId
, sha256
, filename ? "${pname}-${version}.zip"
}:
, plugname stdenv.mkDerivation {
, plugid
, buildInputs ? []
, packageRequires ? []
, meta ? {}
, ...
}@args:
let
defaultMeta = {
broken = false;
platforms = variant.meta.platforms;
} // optionalAttrs ((args.src.meta.homepage or "") != "") {
homepage = args.src.meta.homepage;
} // optionalAttrs ((args.src.meta.description or "") != "") {
description = args.src.meta.description;
};
in
stdenv.mkDerivation ({
inherit pname version; inherit pname version;
unpackCmd = '' src = fetchzip {
case "$curSrc" in inherit sha256;
*.jar) url = "https://plugins.jetbrains.com/files/${toString pluginId}/${toString versionId}/${filename}";
# don't unpack; keep original source filename without the hash };
local filename=$(basename "$curSrc")
filename="''${filename:33}" passthru = { inherit jetbrainsPlatforms; };
cp $curSrc $filename
chmod +w $filename
sourceRoot="."
;;
*)
_defaultUnpack "$curSrc"
;;
esac
'';
# FIXME: Entirely possible this isn't correct for niche plugins;
# at the very least there are some plugins that come with JS
installPhase = '' installPhase = ''
mkdir -p "$out/lib" mkdir $out
find -iname '*.jar' -exec cp {} "$out/lib/" \; cp -r * $out/
''; '';
buildInputs = [ ] ++ packageRequires ++ buildInputs; meta = {
propagatedBuildInputs = packageRequires; homepage = "https://plugins.jetbrains.com/plugin/${pluginId}-${lib.toLower pname}";
};
passthru = { inherit jetbrainsPlatforms plugid plugname; };
doCheck = false;
meta = defaultMeta // meta;
} }
// removeAttrs args [ "buildInputs" "packageRequires" "meta" ])

View File

@ -13,7 +13,7 @@ let
}; };
mkIdeaPlugins = import ../applications/editors/jetbrains/idea-plugins.nix { mkIdeaPlugins = import ../applications/editors/jetbrains/idea-plugins.nix {
inherit lib stdenv variant; inherit lib stdenv fetchzip;
}; };
jetbrainsWithPlugins = import ../applications/editors/jetbrains/wrapper.nix { jetbrainsWithPlugins = import ../applications/editors/jetbrains/wrapper.nix {