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