nur-packages/pkgs/build-support/jetbrains/plugin.nix

42 lines
811 B
Nix
Raw Normal View History

{ lib
, stdenv
, fetchzip
2020-10-15 19:05:13 +11:00
, jetbrainsPlatforms
}:
{ plugid
, pname
2020-10-15 19:05:13 +11:00
, version
, ...
}@args:
2020-10-15 19:05:13 +11:00
let
defaultMeta = {
broken = false;
} // lib.optionalAttrs ((args.src.meta.homepage or "") != "") {
homepage = args.src.meta.homepage;
} // lib.optionalAttrs ((args.src.meta.description or "") != "") {
description = args.src.meta.description;
} // lib.optionalAttrs ((args.src.meta.license or {}) != {}) {
license = args.src.meta.license;
2020-10-15 19:05:13 +11:00
};
in
stdenv.mkDerivation (args // {
passthru = { inherit jetbrainsPlatforms; };
dontUnpack = lib.any (lib.hasSuffix ".jar") args.src.urls;
2020-10-15 19:05:13 +11:00
installPhase = ''
mkdir $out
cp -r * $out/
2020-10-15 19:05:13 +11:00
'';
meta = {
inherit (args.meta) license description;
homepage = if (args.meta.homepage == "") then null else args.meta.homepage;
};
})