summary refs log tree commit diff
path: root/pkgs/applications/editors/eclipse/plugins.nix
diff options
context:
space:
mode:
authorRobert Helgesson <robert@rycee.net>2015-07-29 23:29:38 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2015-08-10 23:12:03 +0200
commitc24e01665b72a537c6ff3623439a676e4c6d0ca9 (patch)
treeb7183b84c9a24de3b99954129f9785815f4c1c7c /pkgs/applications/editors/eclipse/plugins.nix
parent2fca9e09c411577f0ab1129dc8140e31c8a8d098 (diff)
downloadnixpkgs-c24e01665b72a537c6ff3623439a676e4c6d0ca9.tar
nixpkgs-c24e01665b72a537c6ff3623439a676e4c6d0ca9.tar.gz
nixpkgs-c24e01665b72a537c6ff3623439a676e4c6d0ca9.tar.bz2
nixpkgs-c24e01665b72a537c6ff3623439a676e4c6d0ca9.tar.lz
nixpkgs-c24e01665b72a537c6ff3623439a676e4c6d0ca9.tar.xz
nixpkgs-c24e01665b72a537c6ff3623439a676e4c6d0ca9.tar.zst
nixpkgs-c24e01665b72a537c6ff3623439a676e4c6d0ca9.zip
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.
Diffstat (limited to 'pkgs/applications/editors/eclipse/plugins.nix')
-rw-r--r--pkgs/applications/editors/eclipse/plugins.nix31
1 files changed, 21 insertions, 10 deletions
diff --git a/pkgs/applications/editors/eclipse/plugins.nix b/pkgs/applications/editors/eclipse/plugins.nix
index cba556074a1..88ebaa4c4a5 100644
--- a/pkgs/applications/editors/eclipse/plugins.nix
+++ b/pkgs/applications/editors/eclipse/plugins.nix
@@ -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 = ''