diff --git a/pkgs/applications/editors/eclipse/plugins.nix b/pkgs/applications/editors/eclipse/plugins.nix index 1f851815858d..d65d1a48b88f 100644 --- a/pkgs/applications/editors/eclipse/plugins.nix +++ b/pkgs/applications/editors/eclipse/plugins.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, unzip }: +{ stdenv, fetchurl, fetchzip, unzip }: let @@ -25,6 +25,32 @@ 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; + + buildInputs = [ unzip ]; + phases = [ "unpackPhase" "installPhase" ]; + + installPhase = '' + dropinDir="$out/eclipse/dropins/${name}" + + cd features + for feature in *.jar; do + feat=''${feature%.jar} + mkdir -p $dropinDir/features/$feat + unzip $feature -d $dropinDir/features/$feat + done + cd .. + + mkdir -p $dropinDir/plugins + cp -v "plugins/"*.jar $dropinDir/plugins/ + ''; + }; + in { anyedittools = buildEclipsePlugin rec { @@ -51,6 +77,26 @@ in { }; }; + checkstyle = buildEclipseUpdateSite rec { + name = "checkstyle-${version}"; + version = "6.5.0.201504121610"; + + src = fetchzip { + stripRoot = false; + url = "mirror://sourceforge/project/eclipse-cs/Eclipse%20Checkstyle%20Plug-in/6.5.0/net.sf.eclipsecs-updatesite_6.5.0.201504121610-bin.zip"; + sha256 = "1zikpkss0c3l460ipvznp22kpak8w31n7k6yk41nc1w49zflvcf0"; + }; + + meta = with stdenv.lib; { + homepage = http://eclipse-cs.sourceforge.net/; + description = "Checkstyle integration into the Eclipse IDE"; + license = licenses.lgpl21; + platforms = platforms.all; + maintainers = [ maintainers.rycee ]; + }; + + }; + color-theme = buildEclipsePlugin rec { name = "color-theme-${version}"; version = "1.0.0.201410260308";