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:
2024-01-02 11:29:13 +00:00
# for e in cpp dsl 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 " ;
2024-01-13 08:15:51 +00:00
platform_minor = " 3 0 " ;
2023-04-29 16:46:19 +00:00
year = " 2 0 2 3 " ;
2024-01-13 08:15:51 +00:00
month = " 1 2 " ; #release month
buildmonth = " 1 2 " ; #sometimes differs from release month
timestamp = " ${ year } ${ buildmonth } 0 1 0 1 1 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 = {
2024-01-13 08:15:51 +00:00
x86_64 = " s h a 2 5 6 - a 5 G q b g h N l y v U / S 3 6 N c F S e l 1 G R f / v Z p 0 1 a a C x A s w q y n g = " ;
aarch64 = " s h a 2 5 6 - w 2 b z o l Y B A 4 b f 4 k f c P z a 0 L D L V i K q X Q k b Z R 0 7 S T N 9 4 n r Y = " ;
2023-02-02 18:25:31 +00:00
} . ${ arch } ;
2020-04-24 23:36:52 +00:00
} ;
} ;
2024-01-02 11:29:13 +00:00
### Eclipse DSL
eclipse-dsl = buildEclipse {
name = " e c l i p s e - d s l - ${ platform_major } . ${ platform_minor } " ;
description = " E c l i p s e I D E f o r J a v a a n d D S L D e v e l o p e r s " ;
src =
fetchurl {
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 - d s l - ${ year } - ${ month } - R - l i n u x - g t k - ${ arch } . t a r . g z " ;
hash = {
2024-01-13 08:15:51 +00:00
x86_64 = " s h a 2 5 6 - U 9 C M w c D Z P 1 p t n c + C 7 g T f T O c y p p e 7 r 6 R t g P p 6 5 b 3 A 7 Q k = " ;
aarch64 = " s h a 2 5 6 - w u h 6 I Z t R P D N J A V c f u k F j Z f u O V J g f j 2 z I 6 1 6 Y N D n R g W M = " ;
2024-01-02 11:29:13 +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 = {
2024-01-13 08:15:51 +00:00
x86_64 = " s h a 2 5 6 - h 1 d 0 L T B K B K c Y x e L r 0 Q E K 7 V G 3 q 8 c K e H Q P a K z o P U 6 q l k I = " ;
aarch64 = " s h a 2 5 6 - n C k N N m L 9 2 4 I 8 Q 6 w j A m i k 7 d 3 K 4 T 4 j 0 / B i y r 4 d 9 Y 0 K f S g = " ;
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 = {
2024-01-13 08:15:51 +00:00
x86_64 = " s h a 2 5 6 - F b c S b D F y j x 2 u G 0 T 8 4 4 c B w A d a B Z c 2 k / c 4 a o g s C V Y I 7 + E = " ;
aarch64 = " s h a 2 5 6 - C O Q i p I C w c M 7 + g b p i D / G 3 1 b s W + 9 N D z 8 w t + H y Y 6 F F k K o 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 = {
2024-01-13 08:15:51 +00:00
x86_64 = " s h a 2 5 6 - 3 U f a I w U p g D + V W B 7 A r 5 b y 7 8 z l d q m r l g 9 c s I N k r e + m 8 i 0 = " ;
aarch64 = " s h a 2 5 6 - 5 w I l n T I t w E s t U H i t l V P I x Y 7 a y v x V 4 y I / 8 I D 8 W Q 3 m n D 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 = {
2024-01-13 08:15:51 +00:00
x86_64 = " s h a 2 5 6 - C f 2 j r N j a k R t e G O / W 1 8 o n e E 9 E D M 3 V L y i / l I a f g f f p r U c = " ;
aarch64 = " s h a 2 5 6 - j 0 i 1 k 3 f H Q / + P 5 y 6 a R K U Z M 8 u B Q J O L w e D t k j n e q l x / k u Q = " ;
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 = {
2024-01-13 08:15:51 +00:00
x86_64 = " s h a 2 5 6 - p N + x 6 3 J 8 + G h G m f s d z L k n J X W C n v h S 8 V e L i z m y q W M 8 X U A = " ;
aarch64 = " s h a 2 5 6 - Q V W 2 n x 5 P 6 m k j 4 o J 1 q H s 5 D 2 T Z B u B u x a y h i J H h 0 V g A g h U = " ;
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 = {
2024-01-13 08:15:51 +00:00
x86_64 = " s h a 2 5 6 - Q j 9 O m c 3 + H P 3 t w F 0 e v h k R K E 8 P H / i 4 + e G t n k f j U u 9 + l Y 4 = " ;
aarch64 = " s h a 2 5 6 - D q k w H y E b t t F B A 9 H M 3 G d q x x Z N j C i K f 6 g S 7 K N Q Y I U B A G E = " ;
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 = {
2024-01-13 08:15:51 +00:00
x86_64 = " s h a 2 5 6 - z h Q U 7 h S F 3 K W J 0 Q 2 T R z v G h L 7 6 M x h h h / H S / w T / a h k F H X k = " ;
aarch64 = " s h a 2 5 6 - X S q W x 1 V 0 X j t u Y b Z l R c J f 7 X u 1 y L 1 V a z T 5 Z / B c G k k X z b 8 = " ;
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
2024-01-02 11:29:13 +00:00
plugins = callPackage ./plugins.nix { } // { __attrsFailEvaluation = true ; } ;
2020-04-24 23:36:52 +00:00
}