lol
at v192 359 lines 12 kB view raw
1{ stdenv, fetchurl, fetchzip, unzip }: 2 3rec { 4 5 # A primitive builder of Eclipse plugins. This function is intended 6 # to be used when building more advanced builders. 7 buildEclipsePluginBase = { name 8 , buildInputs ? [] 9 , passthru ? {} 10 , ... } @ attrs: 11 stdenv.mkDerivation (attrs // { 12 name = "eclipse-plugin-" + name; 13 14 buildInputs = buildInputs ++ [ unzip ]; 15 16 passthru = { 17 isEclipsePlugin = true; 18 } // passthru; 19 }); 20 21 # Helper for the common case where we have separate feature and 22 # plugin JARs. 23 buildEclipsePlugin = { name, srcFeature, srcPlugin, ... } @ attrs: 24 buildEclipsePluginBase (attrs // { 25 srcs = [ srcFeature srcPlugin ]; 26 27 phases = [ "installPhase" ]; 28 29 installPhase = '' 30 dropinDir="$out/eclipse/dropins/${name}" 31 32 mkdir -p $dropinDir/features 33 unzip ${srcFeature} -d $dropinDir/features/ 34 35 mkdir -p $dropinDir/plugins 36 cp -v ${srcPlugin} $dropinDir/plugins/${name}.jar 37 ''; 38 39 }); 40 41 # Helper for the case where the build directory has the layout of an 42 # Eclipse update site, that is, it contains the directories 43 # `features` and `plugins`. All features and plugins inside these 44 # directories will be installed. 45 buildEclipseUpdateSite = { name, ... } @ attrs: 46 buildEclipsePluginBase (attrs // { 47 phases = [ "unpackPhase" "installPhase" ]; 48 49 installPhase = '' 50 dropinDir="$out/eclipse/dropins/${name}" 51 52 # Install features. 53 cd features 54 for feature in *.jar; do 55 featureName=''${feature%.jar} 56 mkdir -p $dropinDir/features/$featureName 57 unzip $feature -d $dropinDir/features/$featureName 58 done 59 cd .. 60 61 # Install plugins. 62 mkdir -p $dropinDir/plugins 63 64 # A bundle should be unpacked if the manifest matches this 65 # pattern. 66 unpackPat="Eclipse-BundleShape:\\s*dir" 67 68 cd plugins 69 for plugin in *.jar ; do 70 pluginName=''${plugin%.jar} 71 manifest=$(unzip -p $plugin META-INF/MANIFEST.MF) 72 73 if [[ $manifest =~ $unpackPat ]] ; then 74 mkdir $dropinDir/plugins/$pluginName 75 unzip $plugin -d $dropinDir/plugins/$pluginName 76 else 77 cp -v $plugin $dropinDir/plugins/ 78 fi 79 done 80 cd .. 81 ''; 82 }); 83 84 acejump = buildEclipsePlugin rec { 85 name = "acejump-${version}"; 86 version = "1.0.0.201501181511"; 87 88 srcFeature = fetchurl { 89 url = "https://tobiasmelcher.github.io/acejumpeclipse/features/acejump.feature_${version}.jar"; 90 sha256 = "127xqrnns4h96g21c9zg0iblxprx3fg6fg0w5f413rf84415z884"; 91 }; 92 93 srcPlugin = fetchurl { 94 url = "https://tobiasmelcher.github.io/acejumpeclipse/plugins/acejump_${version}.jar"; 95 sha256 = "0mz79ca32yryidd1wijirvnmfg4j5q4g84vdspdi56z0r4xrja13"; 96 }; 97 98 meta = with stdenv.lib; { 99 homepage = https://github.com/tobiasmelcher/EclipseAceJump; 100 description = "Provides fast jumps to text based on initial letter"; 101 license = licenses.mit; 102 platforms = platforms.all; 103 maintainers = [ maintainers.rycee ]; 104 }; 105 }; 106 107 anyedittools = buildEclipsePlugin rec { 108 name = "anyedit-${version}"; 109 version = "2.4.15.201504172030"; 110 111 srcFeature = fetchurl { 112 url = "http://andrei.gmxhome.de/eclipse/features/AnyEditTools_${version}.jar"; 113 sha256 = "19hbwgqn02ghflbcp5cw3qy203mym5kwgzq4xrn0xcl8ckl5s2pp"; 114 }; 115 116 srcPlugin = fetchurl { 117 url = "http://dl.bintray.com/iloveeclipse/plugins/de.loskutov.anyedit.AnyEditTools_${version}.jar"; 118 sha256 = "1i3ghf2mhdfhify30hlyxqmyqcp40pkd5zhsiyg6finn4w81sxv2"; 119 }; 120 121 meta = with stdenv.lib; { 122 homepage = http://andrei.gmxhome.de/anyedit/; 123 description = "Adds new tools to the context menu of text-based editors"; 124 license = licenses.epl10; 125 platforms = platforms.all; 126 maintainers = [ maintainers.rycee ]; 127 }; 128 }; 129 130 bytecode-outline = buildEclipsePlugin rec { 131 name = "bytecode-outline-${version}"; 132 version = "2.4.3"; 133 134 srcFeature = fetchurl { 135 url = "http://andrei.gmxhome.de/eclipse/features/de.loskutov.BytecodeOutline.feature_${version}.jar"; 136 sha256 = "0imhwp73gxy1y5d5gpjgd05ywn0xg3vqc5980wcx3fd51g4ifc67"; 137 }; 138 139 srcPlugin = fetchurl { 140 url = "http://dl.bintray.com/iloveeclipse/plugins/de.loskutov.BytecodeOutline_${version}.jar"; 141 sha256 = "0230i88mvvxhn11m9c5mv3494zhh1xkxyfyva9qahck0wbqwpzkw"; 142 }; 143 144 meta = with stdenv.lib; { 145 homepage = http://andrei.gmxhome.de/bytecode/; 146 description = "Shows disassembled bytecode of current java editor or class file"; 147 license = licenses.bsd2; 148 platforms = platforms.all; 149 maintainers = [ maintainers.rycee ]; 150 }; 151 }; 152 153 cdt = buildEclipseUpdateSite rec { 154 name = "cdt-${version}"; 155 version = "8.7.0"; 156 157 src = fetchzip { 158 stripRoot = false; 159 url = "http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/tools/cdt/releases/8.7/${name}.zip"; 160 sha256 = "0qpcjcl6n98x7ys4qz8p1x5hhk2ydrgh8w3r1kqk0zc7liqrx7vg"; 161 }; 162 163 meta = with stdenv.lib; { 164 homepage = https://eclipse.org/cdt/; 165 description = "C/C++ development tooling"; 166 license = licenses.epl10; 167 platforms = platforms.all; 168 maintainers = [ maintainers.bjornfor ]; 169 }; 170 }; 171 172 checkstyle = buildEclipseUpdateSite rec { 173 name = "checkstyle-${version}"; 174 version = "6.9.0.201508291549"; 175 176 src = fetchzip { 177 stripRoot = false; 178 url = "mirror://sourceforge/project/eclipse-cs/Eclipse%20Checkstyle%20Plug-in/6.9.0/net.sf.eclipsecs-updatesite_${version}-bin.zip"; 179 sha256 = "0r6lfbyhqcwa628i6wjp9d6mfp4jnc46bmwp9j7v02m79f8wx74g"; 180 }; 181 182 meta = with stdenv.lib; { 183 homepage = http://eclipse-cs.sourceforge.net/; 184 description = "Checkstyle integration into the Eclipse IDE"; 185 license = licenses.lgpl21; 186 platforms = platforms.all; 187 maintainers = [ maintainers.rycee ]; 188 }; 189 190 }; 191 192 color-theme = buildEclipsePlugin rec { 193 name = "color-theme-${version}"; 194 version = "1.0.0.201410260308"; 195 196 srcFeature = fetchurl { 197 url = "https://eclipse-color-theme.github.io/update/features/com.github.eclipsecolortheme.feature_${version}.jar"; 198 sha256 = "128b9b1cib5ff0w1114ns5mrbrhj2kcm358l4dpnma1s8gklm8g2"; 199 }; 200 201 srcPlugin = fetchurl { 202 url = "https://eclipse-color-theme.github.io/update/plugins/com.github.eclipsecolortheme_${version}.jar"; 203 sha256 = "0wz61909bhqwzpqwll27ia0cn3anyp81haqx3rj1iq42cbl42h0y"; 204 }; 205 206 meta = with stdenv.lib; { 207 homepage = http://eclipsecolorthemes.org/; 208 description = "Plugin to switch color themes conveniently and without side effects"; 209 license = licenses.epl10; 210 platforms = platforms.all; 211 maintainers = [ maintainers.rycee ]; 212 }; 213 }; 214 215 eclemma = buildEclipseUpdateSite rec { 216 name = "eclemma-${version}"; 217 version = "2.3.2.201409141915"; 218 219 src = fetchzip { 220 stripRoot = false; 221 url = "mirror://sourceforge/project/eclemma/01_EclEmma_Releases/2.3.2/eclemma-2.3.2.zip"; 222 sha256 = "0w1kwcjh45p7msv5vpc8i6dsqwrnfmjama6vavpnxlji56jd3c43"; 223 }; 224 225 meta = with stdenv.lib; { 226 homepage = http://www.eclemma.org/; 227 description = "EclEmma is a free Java code coverage tool for Eclipse"; 228 license = licenses.epl10; 229 platforms = platforms.all; 230 maintainers = [ maintainers.rycee ]; 231 }; 232 }; 233 234 emacsplus = buildEclipsePlugin rec { 235 name = "emacsplus-${version}"; 236 version = "4.2.0"; 237 238 srcFeature = fetchurl { 239 url = "http://www.mulgasoft.com/emacsplus/e4/update-site/features/com.mulgasoft.emacsplus.feature_${version}.jar"; 240 sha256 = "0wja3cd7gq8w25797fxnafvcncjnmlv8qkl5iwqj7zja2f45vka8"; 241 }; 242 243 srcPlugin = fetchurl { 244 url = "http://www.mulgasoft.com/emacsplus/e4/update-site/plugins/com.mulgasoft.emacsplus_${version}.jar"; 245 sha256 = "08yw45nr90mlpdzim74vsvdaxj41sgpxcrqk5ia6l2dzvrqlsjs1"; 246 }; 247 248 meta = with stdenv.lib; { 249 homepage = http://www.mulgasoft.com/emacsplus/; 250 description = "Provides a more Emacs-like experience in the Eclipse text editors"; 251 license = licenses.epl10; 252 platforms = platforms.all; 253 maintainers = [ maintainers.rycee ]; 254 }; 255 }; 256 257 findbugs = buildEclipsePlugin rec { 258 name = "findbugs-${version}"; 259 version = "3.0.1.20150306-5afe4d1"; 260 261 srcFeature = fetchurl { 262 url = "http://findbugs.cs.umd.edu/eclipse/features/edu.umd.cs.findbugs.plugin.eclipse_${version}.jar"; 263 sha256 = "1m9fav2xlb9wrx2d00lpnh2sy0w5yzawynxm6xhhbfdzd0vpfr9v"; 264 }; 265 266 srcPlugin = fetchurl { 267 url = "http://findbugs.cs.umd.edu/eclipse/plugins/edu.umd.cs.findbugs.plugin.eclipse_${version}.jar"; 268 sha256 = "10p3mrbp9wi6jhlmmc23qv7frh605a23pqsc7w96569bsfb5wa8q"; 269 }; 270 271 meta = with stdenv.lib; { 272 homepage = http://findbugs.sourceforge.net/; 273 description = "Plugin that uses static analysis to look for bugs in Java code"; 274 license = licenses.epl10; 275 platforms = platforms.all; 276 maintainers = [ maintainers.rycee ]; 277 }; 278 }; 279 280 gnuarmeclipse = buildEclipseUpdateSite rec { 281 name = "gnuarmeclipse-${version}"; 282 version = "2.8.1-201504061754"; 283 284 src = fetchzip { 285 stripRoot = false; 286 url = "mirror://sourceforge/project/gnuarmeclipse/Current%20Releases/2.x/ilg.gnuarmeclipse.repository-${version}.zip"; 287 sha256 = "08jsnyis1ry62cidr9sl11ylyxbkwh834nlhx6qp31gh1l439px9"; 288 }; 289 290 meta = with stdenv.lib; { 291 homepage = http://gnuarmeclipse.livius.net/; 292 description = "GNU ARM Eclipse Plug-ins"; 293 license = licenses.epl10; 294 platforms = platforms.all; 295 maintainers = [ maintainers.bjornfor ]; 296 }; 297 }; 298 299 jdt = buildEclipseUpdateSite rec { 300 name = "jdt-${version}"; 301 version = "4.5"; 302 303 src = fetchzip { 304 stripRoot = false; 305 url = "https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.5-201506032000/org.eclipse.jdt-4.5.zip"; 306 sha256 = "0zrdn26f7qsms2xfiyc049bhhh0czsbf989pgyq736b8hfmmh9iy"; 307 }; 308 309 meta = with stdenv.lib; { 310 homepage = https://www.eclipse.org/jdt/; 311 description = "Eclipse Java development tools"; 312 license = licenses.epl10; 313 platforms = platforms.all; 314 maintainers = [ maintainers.rycee ]; 315 }; 316 }; 317 318 scala = buildEclipseUpdateSite rec { 319 name = "scala-${version}"; 320 version = "4.1.1"; 321 322 src = fetchzip { 323 url = "http://download.scala-ide.org/sdk/lithium/e44/scala211/stable/update-site.zip"; 324 sha256 = "0x5cdcm7p2ynz5ryw041gb150sripf9i4m1yrfqklnn581yqm6y8"; 325 }; 326 327 meta = with stdenv.lib; { 328 homepage = "http://scala-ide.org/"; 329 description = "The Scala IDE for Eclipse"; 330 license = licenses.bsd3; 331 platforms = platforms.all; 332 maintainers = [ maintainers.rycee ]; 333 }; 334 }; 335 336 testng = buildEclipsePlugin rec { 337 name = "testng-${version}"; 338 version = "6.9.5.201508210528"; 339 340 srcFeature = fetchurl { 341 url = "http://beust.com/eclipse/features/org.testng.eclipse_${version}.jar"; 342 sha256 = "0xalm7pvj0vx61isgkjkgj073b4hlqlzx6xnkrnnnyi0r212a26j"; 343 }; 344 345 srcPlugin = fetchurl { 346 url = "http://beust.com/eclipse/plugins/org.testng.eclipse_${version}.jar"; 347 sha256 = "07wmivfvfsq6cjw5zwciajdxkfa7drk108jsr44gf4i1bv9fj055"; 348 }; 349 350 meta = with stdenv.lib; { 351 homepage = http://testng.org/; 352 description = "Eclipse plugin for the TestNG testing framework"; 353 license = licenses.asl20; 354 platforms = platforms.all; 355 maintainers = [ maintainers.rycee ]; 356 }; 357 }; 358 359}