jetbrains: update IDEA for generated plugins
This commit is contained in:
33
pkgs/build-support/jetbrains/plugin-old.nix
Normal file
33
pkgs/build-support/jetbrains/plugin-old.nix
Normal file
@ -0,0 +1,33 @@
|
||||
{ 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}";
|
||||
};
|
||||
}
|
@ -1,33 +1,71 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchzip
|
||||
, variant
|
||||
, jetbrainsPlatforms
|
||||
}:
|
||||
|
||||
{ pluginId
|
||||
, pname
|
||||
, version
|
||||
, versionId
|
||||
, sha256
|
||||
, filename ? "${pname}-${version}.zip"
|
||||
}:
|
||||
with lib;
|
||||
|
||||
stdenv.mkDerivation {
|
||||
{ pname
|
||||
, version
|
||||
|
||||
, plugname
|
||||
, 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;
|
||||
|
||||
src = fetchzip {
|
||||
inherit sha256;
|
||||
url = "https://plugins.jetbrains.com/files/${toString pluginId}/${toString versionId}/${filename}";
|
||||
};
|
||||
|
||||
passthru = { inherit jetbrainsPlatforms; };
|
||||
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
cp -r * $out/
|
||||
unpackCmd = ''
|
||||
case "$curSrc" in
|
||||
*.jar)
|
||||
# don't unpack; keep original source filename without the hash
|
||||
local filename=$(basename "$curSrc")
|
||||
filename="''${filename:33}"
|
||||
cp $curSrc $filename
|
||||
chmod +w $filename
|
||||
sourceRoot="."
|
||||
;;
|
||||
*)
|
||||
_defaultUnpack "$curSrc"
|
||||
;;
|
||||
esac
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "https://plugins.jetbrains.com/plugin/${pluginId}-${lib.toLower pname}";
|
||||
};
|
||||
# FIXME: Entirely possible this isn't correct for niche plugins;
|
||||
# at the very least there are some plugins that come with JS
|
||||
installPhase = ''
|
||||
mkdir -p "$out/lib"
|
||||
find -iname '*.jar' -exec cp {} "$out/lib/" \;
|
||||
'';
|
||||
|
||||
buildInputs = [ ] ++ packageRequires ++ buildInputs;
|
||||
propagatedBuildInputs = packageRequires;
|
||||
|
||||
passthru = { inherit jetbrainsPlatforms plugid plugname; };
|
||||
|
||||
doCheck = false;
|
||||
|
||||
meta = defaultMeta // meta;
|
||||
}
|
||||
|
||||
// removeAttrs args [ "buildInputs" "packageRequires" "meta" ])
|
||||
|
Reference in New Issue
Block a user