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-04-21 15:54:59 +00:00
# for e in cpp dsl embedcpp modeling platform sdk java jee committers rcp; do for s in pkgs pkgsCross.aarch64-multiplatform; do echo; echo $s $e; nix-build -A ${s}.eclipses.eclipse-${e} -o eclipse-${s}-${e}; done; done
2020-04-24 23:36:52 +00:00
let
platform_major = " 4 " ;
2024-05-15 15:35:15 +00:00
platform_minor = " 3 1 " ;
year = " 2 0 2 4 " ;
month = " 0 3 " ; #release month
buildmonth = " 0 2 " ; #sometimes differs from release month
timestamp = " ${ year } ${ buildmonth } 2 9 0 5 2 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-05-15 15:35:15 +00:00
x86_64 = " s h a 2 5 6 - l Z t U / I U N x 2 t c 6 T w C F Q 5 W S 7 c O / G u i 2 J p e k n n L + Z / m B o w = " ;
aarch64 = " s h a 2 5 6 - i I U O i F p 0 u L O z w d q B V 1 t x R h l i a E 2 l 1 k b h G v 1 F 6 h 0 W O + w = " ;
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-05-15 15:35:15 +00:00
x86_64 = " s h a 2 5 6 - g d t D I 9 A + s U D A F s y q E m X u I k q g d / v 1 W F + E u j 0 T S W w j e L 4 = " ;
aarch64 = " s h a 2 5 6 - k Y a + 8 E 5 K L q H d u m B Q i I o m 3 e G 5 r M / 9 T F Z l J y y c 7 H p y S e s = " ;
2024-01-02 11:29:13 +00:00
} . ${ arch } ;
} ;
} ;
2024-04-21 15:54:59 +00:00
### Eclipse IDE for Embedded C/C++ Developers
eclipse-embedcpp = buildEclipse {
name = " e c l i p s e - e m b e d c p p - ${ platform_major } . ${ platform_minor } " ;
description = " E c l i p s e I D E f o r E m b e d d e d C / C + + 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 - e m b e d c p p - ${ year } - ${ month } - R - l i n u x - g t k - ${ arch } . t a r . g z " ;
hash = {
2024-05-15 15:35:15 +00:00
x86_64 = " s h a 2 5 6 - 5 g 4 C A X 2 m u 1 i 6 a M q m b g y 4 R 3 N p k 1 I C / W 7 3 F r I Z A Q w g G C c = " ;
aarch64 = " s h a 2 5 6 - K c f y b N D y G g l U L K F 3 H F 5 v 5 0 m B s 6 9 F F r y C M Z + o B t j B F i w = " ;
2024-04-21 15:54:59 +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-05-15 15:35:15 +00:00
x86_64 = " s h a 2 5 6 - y R J W S E g 0 T V W p g Q B S S + y 8 / Y r j d U 3 P S v J o r u E U w j Z c r L c = " ;
aarch64 = " s h a 2 5 6 - C z m 8 n Y A k V q S 8 g a o w D p 1 L r J 3 1 i E 3 2 d 6 k l T 6 J v H e k L 5 2 c = " ;
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-05-15 15:35:15 +00:00
x86_64 = " s h a 2 5 6 - P I v J e I T q f t d 9 e H h f b F + R + S Q + M X p 4 O m M 5 x i 8 Z D d U v X a I = " ;
aarch64 = " s h a 2 5 6 - C 0 4 A I C P c b 9 f o E a i 3 N k 4 S 4 z x Q 3 o U v + i 2 t c k w q D s c p x 7 I = " ;
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-05-15 15:35:15 +00:00
x86_64 = " s h a 2 5 6 - o m s A Z S l C v g g T j o A P Q t 0 o G q R U Z w y t 5 H 2 L s w G p F t 8 8 L + I = " ;
aarch64 = " s h a 2 5 6 - w c r Y V l L 5 x + W v e 2 M A g n E F Q 4 H 3 a / g c 2 y 8 F r 5 T m w H U 9 p 6 A = " ;
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-05-15 15:35:15 +00:00
x86_64 = " s h a 2 5 6 - 8 W q H F L y w Y Q X t z U G x B V s t x G q V U 5 5 W H o A p Z n y Z 6 u r 4 X g U = " ;
aarch64 = " s h a 2 5 6 - G l D 0 y k J b w d b z h 1 K 3 X Q Q 7 9 y B h C J Q U l m t 2 v 8 c 2 O M Y N W p 4 = " ;
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-05-15 15:35:15 +00:00
x86_64 = " s h a 2 5 6 - K 2 u o 2 V V L 6 r P 9 k x i c J R L z s J i O F K l o L D 0 v I n S o n 8 J s U W g = " ;
aarch64 = " s h a 2 5 6 - q e E Q T l F e W B a g 6 S L X o a t D e v i R / N G 8 E c T i 6 V y U o 9 P 6 S T 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 = {
2024-05-15 15:35:15 +00:00
x86_64 = " s h a 2 5 6 - K o 4 N C U 9 j b k j A W Y 7 K y 5 t P l h X O n z k p Y 4 G j P i 6 Z 0 C B m z z c = " ;
aarch64 = " s h a 2 5 6 - R B T + x w d Q c J h + Y g s u C P T W y 9 M M 2 y 4 5 b h I F 9 D t t P m 6 Q z + Q = " ;
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-05-15 15:35:15 +00:00
x86_64 = " s h a 2 5 6 - d W w D v 8 c f U x n U / 2 4 A S Y L v S T b S 3 x V 5 u g G 9 8 j Y M h A X T f S 8 = " ;
aarch64 = " s h a 2 5 6 - + b A K F Z 4 u 5 P v C d C 4 I f j 5 i n p p W b 6 C 8 w h 0 t a r 6 6 q r y x 7 6 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
2024-01-02 11:29:13 +00:00
plugins = callPackage ./plugins.nix { } // { __attrsFailEvaluation = true ; } ;
2020-04-24 23:36:52 +00:00
}