eclipses.plugins: add buildEclipsePluginBase

This function provides functionality common to all Eclipse plugin
builders. In particular, it sets a package name and flags the derivation
as an Eclipse plugin.
This commit is contained in:
Robert Helgesson 2015-07-29 23:29:38 +02:00 committed by Bjørn Forsman
parent 2fca9e09c4
commit c24e01665b
2 changed files with 24 additions and 11 deletions

View file

@ -358,7 +358,9 @@ in {
# Gather up the desired plugins.
pluginEnv = buildEnv {
name = "eclipse-plugins";
paths = plugins;
paths =
with stdenv.lib;
filter (x: x ? isEclipsePlugin) (closePropagation plugins);
};
# Prepare the JVM arguments to add to the ini file. We here also

View file

@ -2,20 +2,33 @@
let
buildEclipsePluginBase = { name
, buildInputs ? []
, passthru ? {}
, ... } @ attrs:
stdenv.mkDerivation (attrs // {
name = "eclipse-" + name;
buildInputs = buildInputs ++ [ unzip ];
passthru = {
isEclipsePlugin = true;
} // passthru;
});
# Helper for the common case where we have separate feature and
# plugin JARs.
buildEclipsePlugin = { name, version, javaName, srcFeature, srcPlugin, meta }:
stdenv.mkDerivation {
name = "eclipse-" + name;
inherit meta;
buildEclipsePlugin = { name, version, javaName, srcFeature, srcPlugin, meta, propagatedBuildInputs ? [] }:
buildEclipsePluginBase {
inherit name meta propagatedBuildInputs;
srcs = [ srcFeature srcPlugin ];
buildInputs = [ unzip ];
phases = [ "installPhase" ];
installPhase = ''
dropinDir="$out/eclipse/dropins/${name}"
mkdir -p $dropinDir/features/${javaName}_${version}
unzip ${srcFeature} -d $dropinDir/features/${javaName}_${version}
@ -27,12 +40,10 @@ let
# Helper for the case where we have a ZIP file containing an Eclipse
# update site.
buildEclipseUpdateSite = { name, version, src, meta }:
stdenv.mkDerivation {
name = "eclipse-" + name;
inherit meta src;
buildEclipseUpdateSite = { name, version, src, meta, propagatedBuildInputs ? [] }:
buildEclipsePluginBase {
inherit name meta src propagatedBuildInputs;
buildInputs = [ unzip ];
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''