1 { lib, stdenv, fetchurl, makeDesktopItem, makeWrapper
2 , freetype, fontconfig, libX11, libXrender, zlib
3 , glib, gtk3, gtk2, libXtst, jdk, jdk8, gsettings-desktop-schemas
4 , webkitgtk ? null # for internal web browser
9 # use ./update.sh to help with updating for each quarterly release
12 # for e in cpp dsl embedcpp modeling platform sdk java jee committers rcp; do for s in pkgs pkgsCross.aarch64-multiplatform; do echo; echo $s $e; nix-build -A ${s}.eclipses.eclipse-${e} -o eclipse-${s}-${e}; done; done
16 platform_minor = "30";
18 month = "12"; #release month
19 buildmonth = "12"; #sometimes differs from release month
20 timestamp = "${year}${buildmonth}010110";
22 arch = if stdenv.hostPlatform.isx86_64 then
24 else if stdenv.hostPlatform.isAarch64 then
26 else throw "don't know what platform suffix for ${stdenv.hostPlatform.system} will be";
29 # work around https://bugs.eclipse.org/bugs/show_bug.cgi?id=476075#c3
30 buildEclipseUnversioned = callPackage ./build-eclipse.nix {
31 inherit stdenv makeDesktopItem freetype fontconfig libX11 libXrender zlib
32 jdk glib gtk libXtst gsettings-desktop-schemas webkitgtk
35 buildEclipse = eclipseData: buildEclipseUnversioned (eclipseData // { productVersion = "${platform_major}.${platform_minor}"; });
39 eclipse-cpp = buildEclipse {
40 name = "eclipse-cpp-${platform_major}.${platform_minor}";
41 description = "Eclipse IDE for C/C++ Developers";
44 url = "https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/${year}-${month}/R/eclipse-cpp-${year}-${month}-R-linux-gtk-${arch}.tar.gz";
46 x86_64 = "sha256-a5GqbghNlyvU/S36NcFSel1GRf/vZp01aaCxAswqyng=";
47 aarch64 = "sha256-w2bzolYBA4bf4kfcPza0LDLViKqXQkbZR07STN94nrY=";
54 eclipse-dsl = buildEclipse {
55 name = "eclipse-dsl-${platform_major}.${platform_minor}";
56 description = "Eclipse IDE for Java and DSL Developers";
59 url = "https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/${year}-${month}/R/eclipse-dsl-${year}-${month}-R-linux-gtk-${arch}.tar.gz";
61 x86_64 = "sha256-U9CMwcDZP1ptnc+C7gTfTOcyppe7r6RtgPp65b3A7Qk=";
62 aarch64 = "sha256-wuh6IZtRPDNJAVcfukFjZfuOVJgfj2zI616YNDnRgWM=";
67 ### Eclipse IDE for Embedded C/C++ Developers
69 eclipse-embedcpp = buildEclipse {
70 name = "eclipse-embedcpp-${platform_major}.${platform_minor}";
71 description = "Eclipse IDE for Embedded C/C++ Developers";
74 url = "https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/${year}-${month}/R/eclipse-embedcpp-${year}-${month}-R-linux-gtk-${arch}.tar.gz";
76 x86_64 = "sha256-c/dd/3PzTSnrtaa2gNw+crdNu/xA428hYr8YNeBSEyw=";
77 aarch64 = "sha256-tF6o3NpFNxXALf2UA8tLzFhqYe46cI2swvym8vDSxNI=";
84 eclipse-modeling = buildEclipse {
85 name = "eclipse-modeling-${platform_major}.${platform_minor}";
86 description = "Eclipse Modeling Tools";
89 url = "https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/${year}-${month}/R/eclipse-modeling-${year}-${month}-R-linux-gtk-${arch}.tar.gz";
91 x86_64 = "sha256-h1d0LTBKBKcYxeLr0QEK7VG3q8cKeHQPaKzoPU6qlkI=";
92 aarch64 = "sha256-nCkNNmL924I8Q6wjAmik7d3K4T4j0/Biyr4d9Y0KfSg=";
99 eclipse-platform = buildEclipse {
100 name = "eclipse-platform-${platform_major}.${platform_minor}";
101 description = "Eclipse Platform ${year}-${month}";
104 url = "https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops${platform_major}/R-${platform_major}.${platform_minor}-${timestamp}/eclipse-platform-${platform_major}.${platform_minor}-linux-gtk-${arch}.tar.gz";
106 x86_64 = "sha256-FbcSbDFyjx2uG0T844cBwAdaBZc2k/c4aogsCVYI7+E=";
107 aarch64 = "sha256-COQipICwcM7+gbpiD/G31bsW+9NDz8wt+HyY6FFkKos=";
112 ### Eclipse Scala SDK
115 (buildEclipseUnversioned.override { jdk = jdk8; gtk = gtk2; } {
116 name = "eclipse-scala-sdk-4.7.0";
117 description = "Eclipse IDE for Scala Developers";
118 productVersion = "4.7";
121 url = "https://downloads.typesafe.com/scalaide-pack/4.7.0-vfinal-oxygen-212-20170929/scala-SDK-4.7.0-vfinal-2.12-linux.gtk.x86_64.tar.gz";
122 sha256 = "1n5w2a7mh9ajv6fxcas1gpgwb04pdxbr9v5dzr67gsz5bhahq4ya";
124 }).overrideAttrs(oa: {
125 # Only download for x86_64
126 meta.platforms = [ "x86_64-linux" ];
131 eclipse-sdk = buildEclipse {
132 name = "eclipse-sdk-${platform_major}.${platform_minor}";
133 description = "Eclipse ${year}-${month} Classic";
136 url = "https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops${platform_major}/R-${platform_major}.${platform_minor}-${timestamp}/eclipse-SDK-${platform_major}.${platform_minor}-linux-gtk-${arch}.tar.gz";
138 x86_64 = "sha256-3UfaIwUpgD+VWB7Ar5by78zldqmrlg9csINkre+m8i0=";
139 aarch64 = "sha256-5wIlnTItwEstUHitlVPIxY7ayvxV4yI/8ID8WQ3mnDI=";
146 eclipse-java = buildEclipse {
147 name = "eclipse-java-${platform_major}.${platform_minor}";
148 description = "Eclipse IDE for Java Developers";
151 url = "https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/${year}-${month}/R/eclipse-java-${year}-${month}-R-linux-gtk-${arch}.tar.gz";
153 x86_64 = "sha256-Cf2jrNjakRteGO/W18oneE9EDM3VLyi/lIafgffprUc=";
154 aarch64 = "sha256-j0i1k3fHQ/+P5y6aRKUZM8uBQJOLweDtkjneqlx/kuQ=";
161 eclipse-jee = buildEclipse {
162 name = "eclipse-jee-${platform_major}.${platform_minor}";
163 description = "Eclipse IDE for Enterprise Java and Web Developers";
166 url = "https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/${year}-${month}/R/eclipse-jee-${year}-${month}-R-linux-gtk-${arch}.tar.gz";
168 x86_64 = "sha256-pN+x63J8+GhGmfsdzLknJXWCnvhS8VeLizmyqWM8XUA=";
169 aarch64 = "sha256-QVW2nx5P6mkj4oJ1qHs5D2TZBuBuxayhiJHh0VgAghU=";
174 ### Eclipse Committers
176 eclipse-committers = buildEclipse {
177 name = "eclipse-committers-${platform_major}.${platform_minor}";
178 description = "Eclipse IDE for Eclipse Committers and Eclipse Platform Plugin Developers";
181 url = "https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/${year}-${month}/R/eclipse-committers-${year}-${month}-R-linux-gtk-${arch}.tar.gz";
183 x86_64 = "sha256-Qj9Omc3+HP3twF0evhkRKE8PH/i4+eGtnkfjUu9+lY4=";
184 aarch64 = "sha256-DqkwHyEbttFBA9HM3GdqxxZNjCiKf6gS7KNQYIUBAGE=";
189 ### Eclipse IDE for RCP and RAP Developers
191 eclipse-rcp = buildEclipse {
192 name = "eclipse-rcp-${platform_major}.${platform_minor}";
193 description = "Eclipse IDE for RCP and RAP Developers";
196 url = "https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/${year}-${month}/R/eclipse-rcp-${year}-${month}-R-linux-gtk-${arch}.tar.gz";
198 x86_64 = "sha256-zhQU7hSF3KWJ0Q2TRzvGhL76Mxhhh/HS/wT/ahkFHXk=";
199 aarch64 = "sha256-XSqWx1V0XjtuYbZlRcJf7Xu1yL1VazT5Z/BcGkkXzb8=";
206 # Function that assembles a complete Eclipse environment from an
207 # Eclipse package and list of Eclipse plugins.
208 eclipseWithPlugins = { eclipse, plugins ? [], jvmArgs ? [] }:
210 # Gather up the desired plugins.
211 pluginEnv = buildEnv {
212 name = "eclipse-plugins";
215 filter (x: x ? isEclipsePlugin) (closePropagation plugins);
218 # Prepare the JVM arguments to add to the ini file. We here also
219 # add the property indicating the plugin directory.
220 dropinPropName = "org.eclipse.equinox.p2.reconciler.dropins.directory";
221 dropinProp = "-D${dropinPropName}=${pluginEnv}/eclipse/dropins";
222 jvmArgsText = lib.concatStringsSep "\n" (jvmArgs ++ [dropinProp]);
224 # Base the derivation name on the name of the underlying
226 name = (lib.meta.appendToName "with-plugins" eclipse).name;
228 runCommand name { nativeBuildInputs = [ makeWrapper ]; } ''
229 mkdir -p $out/bin $out/etc
231 # Prepare an eclipse.ini with the plugin directory.
232 cat ${eclipse}/eclipse/eclipse.ini - > $out/etc/eclipse.ini <<EOF
236 makeWrapper ${eclipse}/bin/eclipse $out/bin/eclipse \
237 --add-flags "--launcher.ini $out/etc/eclipse.ini"
239 ln -s ${eclipse}/share $out/
244 plugins = callPackage ./plugins.nix { } // { __attrsFailEvaluation = true; };