2021-01-17 00:15:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeDesktopItem, makeWrapper
|
2020-04-24 23:36:52 +00:00
|
|
|
, 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;
|
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
# https://download.eclipse.org/eclipse/downloads/ is the main place to
|
2020-04-24 23:36:52 +00:00
|
|
|
# find the downloads needed for new versions
|
2020-11-21 19:51:51 +00:00
|
|
|
#
|
|
|
|
# to test:
|
2021-04-26 19:14:03 +00:00
|
|
|
# $ for e in cpp modeling platform sdk java jee committers rcp; do nix build -f default.nix pkgs.eclipses.eclipse-${e} -o eclipse-${e}; done
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
platform_major = "4";
|
2021-04-26 19:14:03 +00:00
|
|
|
platform_minor = "19";
|
|
|
|
year = "2021";
|
|
|
|
month = "03";
|
|
|
|
timestamp = "${year}${month}031800";
|
2020-04-24 23:36:52 +00:00
|
|
|
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 {
|
2020-06-15 15:56:04 +00:00
|
|
|
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-x86_64.tar.gz";
|
2021-04-26 19:14:03 +00:00
|
|
|
sha512 = "3j0lmll0glcr9p0hf49jiaq9xr8hadsy0y58wbbkdpldj3rclxr056dkswmiw2bkypfiwrjygbli5qxyp6mz380562hc2kjwijqq476";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
### 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";
|
2021-04-26 19:14:03 +00:00
|
|
|
sha512 = "0iqz9a3ixcbmaci6lnspdnzwd2h1fcygi54hmsl89pq3d1k5scyhcl123ixi24csi782w847bn0lq00n0zwras9akmnhsflra4mw5pz";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
### 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";
|
2021-04-26 19:14:03 +00:00
|
|
|
sha512 = "03v1ly7j9d9qnl3d9rl5a9kp483dz8i8v3cfnh55ksm9fk8iy2fzg6wq178ggnx2z5x9k88a4wk6n647yilh2hgc2l7926imkh2j1ly";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
### 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";
|
2021-04-26 19:14:03 +00:00
|
|
|
sha512 = "37m91my121pch12bwpwk5svfqkm7vl07wjx4fkhpy947v5kjf36hm6x0i45swdg7f0hk72y2qz5ka15ki5jv890qy5psj6z7ax9sys7";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
### 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";
|
2021-04-26 19:14:03 +00:00
|
|
|
sha512 = "3qrnj6krhrqc9rfwlim3v7kshwfhsi050pszw6xdfbj56mzr9whr7l76isbpxd5j0zipgfw3qrzrx379pdp899d35fv284ilvllzl4k";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
### Eclipse Java EE
|
|
|
|
|
|
|
|
eclipse-jee = buildEclipse {
|
|
|
|
name = "eclipse-jee-${platform_major}.${platform_minor}";
|
|
|
|
description = "Eclipse IDE for Enterprise Java and Web Developers";
|
|
|
|
src =
|
|
|
|
fetchurl {
|
|
|
|
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-x86_64.tar.gz";
|
|
|
|
sha512 = "04k4x9imabxddqlrgajn33ak8i58wcap40ll09xz23d1sxn9a8prh01s06ymgwg6ldg939srphvbz4112p8p0b1hl7m25a02qll91zv";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
### Eclipse Committers
|
|
|
|
|
|
|
|
eclipse-committers = buildEclipse {
|
|
|
|
name = "eclipse-committers-${platform_major}.${platform_minor}";
|
|
|
|
description = "Eclipse IDE for Eclipse Committers and Eclipse Platform Plugin Developers";
|
|
|
|
src =
|
|
|
|
fetchurl {
|
|
|
|
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-x86_64.tar.gz";
|
2021-04-26 19:14:03 +00:00
|
|
|
sha512 = "2yksl3w7yr1a3h4zdpa9zf394r5c185zqxhigdv858ldg46kmr9h0l2c7shbgb16kkybcnrk4x44dhjvh60x8xw6ma05klp4lp9v5va";
|
2020-12-25 13:55:36 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
### Eclipse IDE for RCP and RAP Developers
|
|
|
|
|
|
|
|
eclipse-rcp = buildEclipse {
|
|
|
|
name = "eclipse-rcp-${platform_major}.${platform_minor}";
|
|
|
|
description = "Eclipse IDE for RCP and RAP Developers";
|
|
|
|
src =
|
|
|
|
fetchurl {
|
|
|
|
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-x86_64.tar.gz";
|
2021-04-26 19:14:03 +00:00
|
|
|
sha512 = "3fhrhwbyqcys56c93s1vl9rbvn269nn5y3cb9f3n1qwgw6i97mim2zy98jl3r8cksf97jwsmqmsqclsgz9v799wcckv81dj1l628382";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
### 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 =
|
2021-01-17 00:15:33 +00:00
|
|
|
with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
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";
|
2021-01-17 00:15:33 +00:00
|
|
|
jvmArgsText = lib.concatStringsSep "\n" (jvmArgs ++ [dropinProp]);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Base the derivation name on the name of the underlying
|
|
|
|
# Eclipse.
|
2021-01-17 00:15:33 +00:00
|
|
|
name = (lib.meta.appendToName "with-plugins" eclipse).name;
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
2021-03-09 03:18:52 +00:00
|
|
|
runCommand name { nativeBuildInputs = [ makeWrapper ]; } ''
|
2020-04-24 23:36:52 +00:00
|
|
|
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 { };
|
|
|
|
|
|
|
|
}
|