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 modeling platform sdk java jee committers rcp; do for s in pkgs pkgsCross.aarch64-multiplatform; do echo; echo $s $e; nix build -f default.nix ${s}.eclipses.eclipse-${e} -o eclipse-${s}-${e}; done; done
16 platform_minor = "29";
18 month = "09"; #release month
19 buildmonth = "09"; #sometimes differs from release month
20 timestamp = "${year}${buildmonth}031000";
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-r9ZDt1D7Wt0Gp2JvW4Qwkw0Rj8F4IhUiNpVgm8FDdbY=";
47 aarch64 = "sha256-fyIvDY9jQfLwwNL4iaLb80X2eWaYqkLqtMd09yOQGo4=";
54 eclipse-modeling = buildEclipse {
55 name = "eclipse-modeling-${platform_major}.${platform_minor}";
56 description = "Eclipse Modeling Tools";
59 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";
61 x86_64 = "sha256-eO+fnoN0jZCURwmy6M0Okb9U4R3z8u1gzfm2mGp+Chc=";
62 aarch64 = "sha256-gN0wu7QOyVslvWum9SIkptADtQoX47UPentEupJBnQ8=";
69 eclipse-platform = buildEclipse {
70 name = "eclipse-platform-${platform_major}.${platform_minor}";
71 description = "Eclipse Platform ${year}-${month}";
74 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";
76 x86_64 = "sha256-+0yzlB89v8KrhDfo5oqT0NKY/3hPk+Pkp2yGQ0silEg=";
77 aarch64 = "sha256-CvzDldzcmLzL7z9ZRxHQblmvkzza4wQYeDIZf6V6uXk=";
85 (buildEclipseUnversioned.override { jdk = jdk8; gtk = gtk2; } {
86 name = "eclipse-scala-sdk-4.7.0";
87 description = "Eclipse IDE for Scala Developers";
88 productVersion = "4.7";
91 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";
92 sha256 = "1n5w2a7mh9ajv6fxcas1gpgwb04pdxbr9v5dzr67gsz5bhahq4ya";
94 }).overrideAttrs(oa: {
95 # Only download for x86_64
96 meta.platforms = [ "x86_64-linux" ];
101 eclipse-sdk = buildEclipse {
102 name = "eclipse-sdk-${platform_major}.${platform_minor}";
103 description = "Eclipse ${year}-${month} Classic";
106 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";
108 x86_64 = "sha256-Qp9yKSNWVPH8SX1D4PMfSv3XqiKAQCVXWFcSyQaMFmA=";
109 aarch64 = "sha256-cp8/BiewoNt4txhHmpiBTSXZ2sXXPu6zxuAYi24DF9I=";
116 eclipse-java = buildEclipse {
117 name = "eclipse-java-${platform_major}.${platform_minor}";
118 description = "Eclipse IDE for Java Developers";
121 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";
123 x86_64 = "sha256-TX8LbbBxRGWJ7lmf3tfK+Eux54dSapCsP7OmLfDw4Do=";
124 aarch64 = "sha256-AltrVmCuSTAoRgVsw98oNiR1HPpbYovz3UNGRXQgiVs=";
131 eclipse-jee = buildEclipse {
132 name = "eclipse-jee-${platform_major}.${platform_minor}";
133 description = "Eclipse IDE for Enterprise Java and Web Developers";
136 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";
138 x86_64 = "sha256-kMEeY27Q97+5/pbl3of93p43dMXE1NQmuESCsK5sK3g=";
139 aarch64 = "sha256-sf+l/BjJ1VAyrc94oJUKYEInG7wEivbYEhpEXLi4C+w=";
144 ### Eclipse Committers
146 eclipse-committers = buildEclipse {
147 name = "eclipse-committers-${platform_major}.${platform_minor}";
148 description = "Eclipse IDE for Eclipse Committers and Eclipse Platform Plugin Developers";
151 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";
153 x86_64 = "sha256-K9+Up4nDXZCBKxzj2LX7F9ioPocHnxPdpHMQuc5oehs=";
154 aarch64 = "sha256-ibB3D+0UuX2c+Cbr0L5r8Rh6BfpmOyXNnSk13m2Q7Zk=";
159 ### Eclipse IDE for RCP and RAP Developers
161 eclipse-rcp = buildEclipse {
162 name = "eclipse-rcp-${platform_major}.${platform_minor}";
163 description = "Eclipse IDE for RCP and RAP Developers";
166 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";
168 x86_64 = "sha256-J+8UbkDiG9F+mDBZwr4HVGJWqeSBGMsl3EIRtA7+fK0=";
169 aarch64 = "sha256-+oYY37fBjEi2GJCZVaCsUyWwAhsPPD6nAstUDGmywwo=";
176 # Function that assembles a complete Eclipse environment from an
177 # Eclipse package and list of Eclipse plugins.
178 eclipseWithPlugins = { eclipse, plugins ? [], jvmArgs ? [] }:
180 # Gather up the desired plugins.
181 pluginEnv = buildEnv {
182 name = "eclipse-plugins";
185 filter (x: x ? isEclipsePlugin) (closePropagation plugins);
188 # Prepare the JVM arguments to add to the ini file. We here also
189 # add the property indicating the plugin directory.
190 dropinPropName = "org.eclipse.equinox.p2.reconciler.dropins.directory";
191 dropinProp = "-D${dropinPropName}=${pluginEnv}/eclipse/dropins";
192 jvmArgsText = lib.concatStringsSep "\n" (jvmArgs ++ [dropinProp]);
194 # Base the derivation name on the name of the underlying
196 name = (lib.meta.appendToName "with-plugins" eclipse).name;
198 runCommand name { nativeBuildInputs = [ makeWrapper ]; } ''
199 mkdir -p $out/bin $out/etc
201 # Prepare an eclipse.ini with the plugin directory.
202 cat ${eclipse}/eclipse/eclipse.ini - > $out/etc/eclipse.ini <<EOF
206 makeWrapper ${eclipse}/bin/eclipse $out/bin/eclipse \
207 --add-flags "--launcher.ini $out/etc/eclipse.ini"
209 ln -s ${eclipse}/share $out/
214 plugins = callPackage ./plugins.nix { };