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. # Gather up the desired plugins.
pluginEnv = buildEnv { pluginEnv = buildEnv {
name = "eclipse-plugins"; 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 # Prepare the JVM arguments to add to the ini file. We here also

View File

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