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
} :
2023-10-09 19:29:22 +00:00
# use ./update.sh to help with updating for each quarterly release
2020-11-21 19:51:51 +00:00
#
2023-10-09 19:29:22 +00:00
# then, to test:
2023-04-29 16:46:19 +00:00
# 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
2020-04-24 23:36:52 +00:00
let
platform_major = " 4 " ;
2023-10-19 13:55:26 +00:00
platform_minor = " 2 9 " ;
2023-04-29 16:46:19 +00:00
year = " 2 0 2 3 " ;
2023-10-19 13:55:26 +00:00
month = " 0 9 " ; #release month
buildmonth = " 0 9 " ; #sometimes differs from release month
timestamp = " ${ year } ${ buildmonth } 0 3 1 0 0 0 " ;
2020-04-24 23:36:52 +00:00
gtk = gtk3 ;
2023-02-02 18:25:31 +00:00
arch = if stdenv . hostPlatform . isx86_64 then
" x 8 6 _ 6 4 "
else if stdenv . hostPlatform . isAarch64 then
" a a r c h 6 4 "
else throw " d o n ' t k n o w w h a t p l a t f o r m s u f f i x f o r ${ stdenv . hostPlatform . system } w i l l b e " ;
2020-04-24 23:36:52 +00:00
in rec {
2023-04-29 16:46:19 +00:00
# work around https://bugs.eclipse.org/bugs/show_bug.cgi?id=476075#c3
buildEclipseUnversioned = callPackage ./build-eclipse.nix {
2020-04-24 23:36:52 +00:00
inherit stdenv makeDesktopItem freetype fontconfig libX11 libXrender zlib
jdk glib gtk libXtst gsettings-desktop-schemas webkitgtk
makeWrapper ;
} ;
2023-04-29 16:46:19 +00:00
buildEclipse = eclipseData : buildEclipseUnversioned ( eclipseData // { productVersion = " ${ platform_major } . ${ platform_minor } " ; } ) ;
2020-04-24 23:36:52 +00:00
### Eclipse CPP
eclipse-cpp = buildEclipse {
name = " e c l i p s e - c p p - ${ platform_major } . ${ platform_minor } " ;
description = " E c l i p s e I D E f o r C / C + + D e v e l o p e r s " ;
src =
fetchurl {
2023-02-02 18:25:31 +00:00
url = " h t t p s : / / w w w . e c l i p s e . o r g / d o w n l o a d s / d o w n l o a d . p h p ? r = 1 & n f = 1 & f i l e = / t e c h n o l o g y / e p p / d o w n l o a d s / r e l e a s e / ${ year } - ${ month } / R / e c l i p s e - c p p - ${ year } - ${ month } - R - l i n u x - g t k - ${ arch } . t a r . g z " ;
hash = {
2023-10-19 13:55:26 +00:00
x86_64 = " s h a 2 5 6 - r 9 Z D t 1 D 7 W t 0 G p 2 J v W 4 Q w k w 0 R j 8 F 4 I h U i N p V g m 8 F D d b Y = " ;
aarch64 = " s h a 2 5 6 - f y I v D Y 9 j Q f L w w N L 4 i a L b 8 0 X 2 e W a Y q k L q t M d 0 9 y O Q G o 4 = " ;
2023-02-02 18:25:31 +00:00
} . ${ arch } ;
2020-04-24 23:36:52 +00:00
} ;
} ;
### Eclipse Modeling
eclipse-modeling = buildEclipse {
name = " e c l i p s e - m o d e l i n g - ${ platform_major } . ${ platform_minor } " ;
description = " E c l i p s e M o d e l i n g T o o l s " ;
src =
fetchurl {
2023-02-02 18:25:31 +00:00
url = " h t t p s : / / w w w . e c l i p s e . o r g / d o w n l o a d s / d o w n l o a d . p h p ? r = 1 & n f = 1 & f i l e = / t e c h n o l o g y / e p p / d o w n l o a d s / r e l e a s e / ${ year } - ${ month } / R / e c l i p s e - m o d e l i n g - ${ year } - ${ month } - R - l i n u x - g t k - ${ arch } . t a r . g z " ;
hash = {
2023-10-19 13:55:26 +00:00
x86_64 = " s h a 2 5 6 - e O + f n o N 0 j Z C U R w m y 6 M 0 O k b 9 U 4 R 3 z 8 u 1 g z f m 2 m G p + C h c = " ;
aarch64 = " s h a 2 5 6 - g N 0 w u 7 Q O y V s l v W u m 9 S I k p t A D t Q o X 4 7 U P e n t E u p J B n Q 8 = " ;
2023-02-02 18:25:31 +00:00
} . ${ arch } ;
2020-04-24 23:36:52 +00:00
} ;
} ;
### Eclipse Platform
eclipse-platform = buildEclipse {
name = " e c l i p s e - p l a t f o r m - ${ platform_major } . ${ platform_minor } " ;
description = " E c l i p s e P l a t f o r m ${ year } - ${ month } " ;
src =
fetchurl {
2023-02-02 18:25:31 +00:00
url = " h t t p s : / / w w w . e c l i p s e . o r g / d o w n l o a d s / d o w n l o a d . p h p ? r = 1 & n f = 1 & f i l e = / e c l i p s e / d o w n l o a d s / d r o p s ${ platform_major } / R - ${ platform_major } . ${ platform_minor } - ${ timestamp } / e c l i p s e - p l a t f o r m - ${ platform_major } . ${ platform_minor } - l i n u x - g t k - ${ arch } . t a r . g z " ;
hash = {
2023-10-19 13:55:26 +00:00
x86_64 = " s h a 2 5 6 - + 0 y z l B 8 9 v 8 K r h D f o 5 o q T 0 N K Y / 3 h P k + P k p 2 y G Q 0 s i l E g = " ;
aarch64 = " s h a 2 5 6 - C v z D l d z c m L z L 7 z 9 Z R x H Q b l m v k z z a 4 w Q Y e D I Z f 6 V 6 u X k = " ;
2023-02-02 18:25:31 +00:00
} . ${ arch } ;
2020-04-24 23:36:52 +00:00
} ;
} ;
### Eclipse Scala SDK
eclipse-scala-sdk =
2023-04-29 16:46:19 +00:00
( buildEclipseUnversioned . override { jdk = jdk8 ; gtk = gtk2 ; } {
2020-04-24 23:36:52 +00:00
name = " e c l i p s e - s c a l a - s d k - 4 . 7 . 0 " ;
description = " E c l i p s e I D E f o r S c a l a D e v e l o p e r s " ;
2023-04-29 16:46:19 +00:00
productVersion = " 4 . 7 " ;
2020-04-24 23:36:52 +00:00
src =
fetchurl {
url = " h t t p s : / / d o w n l o a d s . t y p e s a f e . c o m / s c a l a i d e - p a c k / 4 . 7 . 0 - v f i n a l - o x y g e n - 2 1 2 - 2 0 1 7 0 9 2 9 / s c a l a - S D K - 4 . 7 . 0 - v f i n a l - 2 . 1 2 - l i n u x . g t k . x 8 6 _ 6 4 . t a r . g z " ;
sha256 = " 1 n 5 w 2 a 7 m h 9 a j v 6 f x c a s 1 g p g w b 0 4 p d x b r 9 v 5 d z r 6 7 g s z 5 b h a h q 4 y a " ;
} ;
2023-02-02 18:25:31 +00:00
} ) . overrideAttrs ( oa : {
# Only download for x86_64
meta . platforms = [ " x 8 6 _ 6 4 - l i n u x " ] ;
} ) ;
2020-04-24 23:36:52 +00:00
### Eclipse SDK
eclipse-sdk = buildEclipse {
name = " e c l i p s e - s d k - ${ platform_major } . ${ platform_minor } " ;
description = " E c l i p s e ${ year } - ${ month } C l a s s i c " ;
src =
fetchurl {
2023-02-02 18:25:31 +00:00
url = " h t t p s : / / w w w . e c l i p s e . o r g / d o w n l o a d s / d o w n l o a d . p h p ? r = 1 & n f = 1 & f i l e = / e c l i p s e / d o w n l o a d s / d r o p s ${ platform_major } / R - ${ platform_major } . ${ platform_minor } - ${ timestamp } / e c l i p s e - S D K - ${ platform_major } . ${ platform_minor } - l i n u x - g t k - ${ arch } . t a r . g z " ;
hash = {
2023-10-19 13:55:26 +00:00
x86_64 = " s h a 2 5 6 - Q p 9 y K S N W V P H 8 S X 1 D 4 P M f S v 3 X q i K A Q C V X W F c S y Q a M F m A = " ;
aarch64 = " s h a 2 5 6 - c p 8 / B i e w o N t 4 t x h H m p i B T S X Z 2 s X X P u 6 z x u A Y i 2 4 D F 9 I = " ;
2023-02-02 18:25:31 +00:00
} . ${ arch } ;
2020-04-24 23:36:52 +00:00
} ;
} ;
### Eclipse Java
eclipse-java = buildEclipse {
name = " e c l i p s e - j a v a - ${ platform_major } . ${ platform_minor } " ;
description = " E c l i p s e I D E f o r J a v a D e v e l o p e r s " ;
src =
fetchurl {
2023-02-02 18:25:31 +00:00
url = " h t t p s : / / w w w . e c l i p s e . o r g / d o w n l o a d s / d o w n l o a d . p h p ? r = 1 & n f = 1 & f i l e = / t e c h n o l o g y / e p p / d o w n l o a d s / r e l e a s e / ${ year } - ${ month } / R / e c l i p s e - j a v a - ${ year } - ${ month } - R - l i n u x - g t k - ${ arch } . t a r . g z " ;
hash = {
2023-10-19 13:55:26 +00:00
x86_64 = " s h a 2 5 6 - T X 8 L b b B x R G W J 7 l m f 3 t f K + E u x 5 4 d S a p C s P 7 O m L f D w 4 D o = " ;
aarch64 = " s h a 2 5 6 - A l t r V m C u S T A o R g V s w 9 8 o N i R 1 H P p b Y o v z 3 U N G R X Q g i V s = " ;
2023-02-02 18:25:31 +00:00
} . ${ arch } ;
2021-04-26 19:14:03 +00:00
} ;
} ;
### Eclipse Java EE
eclipse-jee = buildEclipse {
name = " e c l i p s e - j e e - ${ platform_major } . ${ platform_minor } " ;
description = " E c l i p s e I D E f o r E n t e r p r i s e J a v a a n d W e b D e v e l o p e r s " ;
src =
fetchurl {
2023-02-02 18:25:31 +00:00
url = " h t t p s : / / w w w . e c l i p s e . o r g / d o w n l o a d s / d o w n l o a d . p h p ? r = 1 & n f = 1 & f i l e = / t e c h n o l o g y / e p p / d o w n l o a d s / r e l e a s e / ${ year } - ${ month } / R / e c l i p s e - j e e - ${ year } - ${ month } - R - l i n u x - g t k - ${ arch } . t a r . g z " ;
hash = {
2023-10-19 13:55:26 +00:00
x86_64 = " s h a 2 5 6 - k M E e Y 2 7 Q 9 7 + 5 / p b l 3 o f 9 3 p 4 3 d M X E 1 N Q m u E S C s K 5 s K 3 g = " ;
aarch64 = " s h a 2 5 6 - s f + l / B j J 1 V A y r c 9 4 o J U K Y E I n G 7 w E i v b Y E h p E X L i 4 C + w = " ;
2023-02-02 18:25:31 +00:00
} . ${ arch } ;
2020-04-24 23:36:52 +00:00
} ;
} ;
2020-07-18 16:06:22 +00:00
### Eclipse Committers
eclipse-committers = buildEclipse {
name = " e c l i p s e - c o m m i t t e r s - ${ platform_major } . ${ platform_minor } " ;
description = " E c l i p s e I D E f o r E c l i p s e C o m m i t t e r s a n d E c l i p s e P l a t f o r m P l u g i n D e v e l o p e r s " ;
src =
fetchurl {
2023-02-02 18:25:31 +00:00
url = " h t t p s : / / w w w . e c l i p s e . o r g / d o w n l o a d s / d o w n l o a d . p h p ? r = 1 & n f = 1 & f i l e = / t e c h n o l o g y / e p p / d o w n l o a d s / r e l e a s e / ${ year } - ${ month } / R / e c l i p s e - c o m m i t t e r s - ${ year } - ${ month } - R - l i n u x - g t k - ${ arch } . t a r . g z " ;
hash = {
2023-10-19 13:55:26 +00:00
x86_64 = " s h a 2 5 6 - K 9 + U p 4 n D X Z C B K x z j 2 L X 7 F 9 i o P o c H n x P d p H M Q u c 5 o e h s = " ;
aarch64 = " s h a 2 5 6 - i b B 3 D + 0 U u X 2 c + C b r 0 L 5 r 8 R h 6 B f p m O y X N n S k 1 3 m 2 Q 7 Z k = " ;
2023-02-02 18:25:31 +00:00
} . ${ arch } ;
2020-12-25 13:55:36 +00:00
} ;
} ;
### Eclipse IDE for RCP and RAP Developers
eclipse-rcp = buildEclipse {
name = " e c l i p s e - r c p - ${ platform_major } . ${ platform_minor } " ;
description = " E c l i p s e I D E f o r R C P a n d R A P D e v e l o p e r s " ;
src =
fetchurl {
2023-02-02 18:25:31 +00:00
url = " h t t p s : / / w w w . e c l i p s e . o r g / d o w n l o a d s / d o w n l o a d . p h p ? r = 1 & n f = 1 & f i l e = / t e c h n o l o g y / e p p / d o w n l o a d s / r e l e a s e / ${ year } - ${ month } / R / e c l i p s e - r c p - ${ year } - ${ month } - R - l i n u x - g t k - ${ arch } . t a r . g z " ;
hash = {
2023-10-19 13:55:26 +00:00
x86_64 = " s h a 2 5 6 - J + 8 U b k D i G 9 F + m D B Z w r 4 H V G J W q e S B G M s l 3 E I R t A 7 + f K 0 = " ;
aarch64 = " s h a 2 5 6 - + o Y Y 3 7 f B j E i 2 G J C Z V a C s U y W w A h s P P D 6 n A s t U D G m y w w o = " ;
2023-02-02 18:25:31 +00:00
} . ${ arch } ;
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 = " e c l i p s e - p l u g i n s " ;
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 = " o r g . e c l i p s e . e q u i n o x . p 2 . r e c o n c i l e r . d r o p i n s . d i r e c t o r y " ;
dropinProp = " - D ${ dropinPropName } = ${ pluginEnv } / e c l i p s e / d r o p i n s " ;
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 " w i t h - p l u g i n s " 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 " - - l a u n c h e r . i n i $ o u t / e t c / e c l i p s e . i n i "
ln - s $ { eclipse } /share $ out /
'' ;
### Plugins
plugins = callPackage ./plugins.nix { } ;
}