nixpkgs/pkgs/applications/editors/eclipse/default.nix
Daniel Albert 2355d9d545
eclipse-scala-sdk: 4.4.1 -> 4.7.0
Unfortunately scala-ide is based on eclipse 4.7 (oxygen).
Thus is requires a java SDK 8 and GTK2.
2020-04-16 21:58:48 +02:00

144 lines
5.3 KiB
Nix

{ stdenv, fetchurl, makeDesktopItem, makeWrapper
, freetype, fontconfig, libX11, libXrender, zlib
, glib, gtk3, gtk2, libXtst, jdk, jdk8, gsettings-desktop-schemas
, webkitgtk ? null # for internal web browser
, buildEnv, runCommand
, callPackage
}:
assert stdenv ? glibc;
# http://download.eclipse.org/eclipse/downloads/ is the main place to
# find the downloads needed for new versions
let
platform_major = "4";
platform_minor = "15";
year = "2020";
month = "03";
timestamp = "${year}${month}050155";
gtk = gtk3;
in rec {
buildEclipse = callPackage ./build-eclipse.nix {
inherit stdenv makeDesktopItem freetype fontconfig libX11 libXrender zlib
jdk glib gtk libXtst gsettings-desktop-schemas webkitgtk
makeWrapper;
};
### Eclipse CPP
eclipse-cpp = buildEclipse {
name = "eclipse-cpp-${platform_major}.${platform_minor}";
description = "Eclipse IDE for C/C++ Developers";
src =
fetchurl {
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-incubation-linux-gtk-x86_64.tar.gz";
sha512 = "2wy4a3p347fajr9zsfz1zlvz6jpy3vficdry27m5fs0azfmxmy2cfns5hh18sin4xqq3jvqppfqxh41rzcpcmiq12zhc6cz42brqgxw";
};
};
### Eclipse Modeling
eclipse-modeling = buildEclipse {
name = "eclipse-modeling-${platform_major}.${platform_minor}";
description = "Eclipse Modeling Tools";
src =
fetchurl {
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-x86_64.tar.gz";
sha512 = "0qccsclay9000sqrymm8hkg70a4jcvd70vymw1kkxsklcs7dnrhch55an98gbzf9r0jgd1ap62a4hyxlnm6hdqqniwcgdza0i4nwwgj";
};
};
### Eclipse Platform
eclipse-platform = buildEclipse {
name = "eclipse-platform-${platform_major}.${platform_minor}";
description = "Eclipse Platform ${year}-${month}";
src =
fetchurl {
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-x86_64.tar.gz";
sha512 = "01rv5x7qqm0a2p30828z2snms3nb2kjx9si63sr5rdkdgr3vbh6xq8n8fn757dqazmpz9zskmwxxmbxnwycfllhgb8msb77pcy3fpg7";
};
};
### Eclipse Scala SDK
eclipse-scala-sdk =
buildEclipse.override { jdk = jdk8; gtk = gtk2; } {
name = "eclipse-scala-sdk-4.7.0";
description = "Eclipse IDE for Scala Developers";
src =
fetchurl {
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";
sha256 = "1n5w2a7mh9ajv6fxcas1gpgwb04pdxbr9v5dzr67gsz5bhahq4ya";
};
};
### Eclipse SDK
eclipse-sdk = buildEclipse {
name = "eclipse-sdk-${platform_major}.${platform_minor}";
description = "Eclipse ${year}-${month} Classic";
src =
fetchurl {
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-x86_64.tar.gz";
sha512 = "33ra8qslwz73240xzjvr751lpl94drlcf425a7kxngq1qla2cda7gxr71bxlr9fm2hrqq0h097ihmg0ix9hv2dmwnc76gp4hwwrlk41";
};
};
### Eclipse Java
eclipse-java = buildEclipse {
name = "eclipse-java-${platform_major}.${platform_minor}";
description = "Eclipse IDE for Java Developers";
src =
fetchurl {
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-x86_64.tar.gz";
sha512 = "0ffa1q19z31j8i552mp9zg4v0p4iv002cvlzh49ia8hi0hgk75pbkp6vxlr75jz0as03n71f0ww8xbflji31qgwfmy6rs1rzqihfff9";
};
};
### Environments
# Function that assembles a complete Eclipse environment from an
# Eclipse package and list of Eclipse plugins.
eclipseWithPlugins = { eclipse, plugins ? [], jvmArgs ? [] }:
let
# Gather up the desired plugins.
pluginEnv = buildEnv {
name = "eclipse-plugins";
paths =
with stdenv.lib;
filter (x: x ? isEclipsePlugin) (closePropagation plugins);
};
# Prepare the JVM arguments to add to the ini file. We here also
# add the property indicating the plugin directory.
dropinPropName = "org.eclipse.equinox.p2.reconciler.dropins.directory";
dropinProp = "-D${dropinPropName}=${pluginEnv}/eclipse/dropins";
jvmArgsText = stdenv.lib.concatStringsSep "\n" (jvmArgs ++ [dropinProp]);
# Base the derivation name on the name of the underlying
# Eclipse.
name = (stdenv.lib.meta.appendToName "with-plugins" eclipse).name;
in
runCommand name { buildInputs = [ makeWrapper ]; } ''
mkdir -p $out/bin $out/etc
# Prepare an eclipse.ini with the plugin directory.
cat ${eclipse}/eclipse/eclipse.ini - > $out/etc/eclipse.ini <<EOF
${jvmArgsText}
EOF
makeWrapper ${eclipse}/bin/eclipse $out/bin/eclipse \
--add-flags "--launcher.ini $out/etc/eclipse.ini"
ln -s ${eclipse}/share $out/
'';
### Plugins
plugins = callPackage ./plugins.nix { };
}