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-09 19:29:22 +00:00
platform_minor = " 2 8 " ;
2023-04-29 16:46:19 +00:00
year = " 2 0 2 3 " ;
2023-10-09 19:29:22 +00:00
month = " 0 6 " ; #release month
buildmonth = " 0 6 " ; #sometimes differs from release month
timestamp = " ${ year } ${ buildmonth } 0 5 0 4 4 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-09 19:29:22 +00:00
x86_64 = " s h a 2 5 6 - 0 V F g 6 8 + M 8 4 S E P b L v 2 f 3 h N T K 1 t v U j N 3 u 0 X 3 D Y F C M A F X 8 = " ;
aarch64 = " s h a 2 5 6 - K 1 e 1 Q / / X + R 4 F f Y 6 0 e E 4 n P g E a F 0 w U k U I O / A F z z j I r G R Y = " ;
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-09 19:29:22 +00:00
x86_64 = " s h a 2 5 6 - w d Z n i n K y n N Q 5 o 2 n x y O x A 7 G D Q 7 5 t W s 1 T B 2 j h 2 1 O 0 f E p g = " ;
aarch64 = " s h a 2 5 6 - 5 i A o M y e s B j m d A y / e S M k g t u Y v 5 r n X A E j g L b 0 y N X 0 2 m d w = " ;
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-09 19:29:22 +00:00
x86_64 = " s h a 2 5 6 - S Y e C X W G S i 8 b P b q n g G C + Z S B Q a K y Z r D T F e T + R L K C + Z s D k = " ;
aarch64 = " s h a 2 5 6 - D N 6 f l 7 p + q 9 6 w s g 9 M q 6 v 3 l T V 0 / 7 b 8 7 M F K T J S F u N r j L g s = " ;
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-09 19:29:22 +00:00
x86_64 = " s h a 2 5 6 - Q Y 1 6 K S N Z j 6 r q 7 Y L + g O a j I 8 0 X V t S d C h 7 M J G P s c R J u f 1 o = " ;
aarch64 = " s h a 2 5 6 - o Z X x 8 7 d l L Z 6 1 e z w D D 0 W n V 4 8 Z M j c K 0 F k S G l 8 3 L h k J v m c = " ;
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-09 19:29:22 +00:00
x86_64 = " s h a 2 5 6 - F C 4 z g x + 7 5 S 9 T J V p 0 a z W g O N / w N m o E y 0 0 7 4 t j + D O d v N O g = " ;
aarch64 = " s h a 2 5 6 - w n R Q K q g 1 V 4 h r D 9 V A g 6 s w 8 y y p B 9 7 W c i v t 4 c H 6 M F P 4 K P 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-09 19:29:22 +00:00
x86_64 = " s h a 2 5 6 - e S Y W u w 6 s 3 H 1 h t 4 z P D w j d 4 o Z 4 9 K h I n 1 O a y w t w K H y S 0 w I = " ;
aarch64 = " s h a 2 5 6 - 9 O 0 + S 3 G 3 v t j N 1 V d 4 e u f 3 g Y R P P t r V x o B B + U j 7 B l D A S 5 M = " ;
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-09 19:29:22 +00:00
x86_64 = " s h a 2 5 6 - k J o X a S w s j A r p e 4 t q e S k Z i U 4 A c R 5 d L B v d s y U 7 t B T i T d c = " ;
aarch64 = " s h a 2 5 6 - q y d F x a 0 l Q E w s x Z Q P l B X V / w i u X G u I c B H R a s K Z E m X J a O 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-09 19:29:22 +00:00
x86_64 = " s h a 2 5 6 - B A E X N 6 s x 4 f + B J n K z 0 l k P o A m R X n l b l 5 s 5 E T A y f E / A Z a k = " ;
aarch64 = " s h a 2 5 6 - x a y v s F A g l B x A B 4 9 j 2 t n t 5 2 d 6 K X 6 L x M B R f x 0 w R / p 8 K 7 0 = " ;
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 { } ;
}