summary refs log tree commit diff
path: root/pkgs/applications/editors/eclipse/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/editors/eclipse/default.nix')
-rw-r--r--pkgs/applications/editors/eclipse/default.nix258
1 files changed, 134 insertions, 124 deletions
diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix
index eb12aa0819ed..bc53dfc70f32 100644
--- a/pkgs/applications/editors/eclipse/default.nix
+++ b/pkgs/applications/editors/eclipse/default.nix
@@ -1,153 +1,163 @@
 { stdenv, fetchurl, patchelf, makeDesktopItem, makeWrapper
 , freetype, fontconfig, libX11, libXext, libXrender, zlib
 , glib, gtk, libXtst, jre
- # defaulting to this version because not all installable plugins work with 3.5.2 yet
- # can also be set to "latest"
-, version ? "3.5.1"
 }:
 
-/*
-  Note: Eclipse stores various Eclipse instance specific data in ~/.eclipse/*-instance/...
-  The '*' depends on the executable location of Eclipse.
-
-  So if an Eclipse dependency such as gtk changes a different Eclipse setup directory will be used and
-  the plugins and update site list and more global settings seem to be gone.
-
-  Staring Eclipse from ~/.nix-profile/bin/eclipse doesn't help.
-
-  So I suggest copying the store path to ~/eclipse and run ~/eclipse/bin/eclipse instead.
+assert stdenv ? glibc;
 
-  However this still has some drawbacks: If you run nix-collect-garbage the gtk
-  libs the wrapper refers to might be gone. It should be easy for you to
-  replace the imortant lines in the wrapper.
+let
 
-  You can also put this eclipse wrapper script (which was removed from
-  all-packages.nix -r 18458)
-  to your packageOverrides section and use that to run eclipse/eclipse.
+  buildEclipse =
+    { name, src, description }:
 
-  Its parameterized by system because you may want to run both: i686 and x86_64 systems.
+    stdenv.mkDerivation rec {
+      inherit name src;
 
-    eclipseRunner =
-      pkgs.stdenv.mkDerivation {
-      name = "nix-eclipse-runner-script-${stdenv.system}";
+      desktopItem = makeDesktopItem {
+        name = "Eclipse";
+        exec = "eclipse";
+        icon = "eclipse";
+        comment = "Integrated Development Environment";
+        desktopName = "Eclipse IDE";
+        genericName = "Integrated Development Environment";
+        categories = "Application;Development;";
+      };
 
-      phases = "installPhase";
-      installPhase = ''
-        ensureDir $out/bin
-        target=$out/bin/nix-run-eclipse-${stdenv.system}
-        cat > $target << EOF
-        #!/bin/sh
-        export PATH=${pkgs.jre}/bin:\$PATH
-        export LD_LIBRARY_PATH=${pkgs.gtkLibs216.glib}/lib:${pkgs.gtkLibs216.gtk}/lib:${pkgs.xlibs.libXtst}/lib
-        # If you run out of XX space try these? -vmargs -Xms512m -Xmx2048m -XX:MaxPermSize=256m
-        eclipse="\$1"; shift
-        exec \$eclipse -vmargs -Xms512m -Xmx2048m -XX:MaxPermSize=256m "\$@"
-        EOF
-        chmod +x $target
-      '';
+      buildInputs = [ makeWrapper patchelf ];
+
+      buildCommand = ''
+        # Unpack tarball.
+        ensureDir $out
+        tar xfvz $src -C $out
+
+        # Patch binaries.
+        interpreter=$(echo ${stdenv.glibc}/lib/ld-linux*.so.2)
+        patchelf --set-interpreter $interpreter $out/eclipse/eclipse
+        patchelf --set-rpath ${freetype}/lib:${fontconfig}/lib:${libX11}/lib:${libXrender}/lib:${zlib}/lib $out/eclipse/libcairo-swt.so
+
+        # Create wrapper script.  Pass -configuration to store
+        # settings in ~/.eclipse/org.eclipse.platform_<version> rather
+        # than ~/.eclipse/org.eclipse.platform_<version>_<number>.
+        productId=$(sed 's/id=//; t; d' $out/eclipse/.eclipseproduct)
+        productVersion=$(sed 's/version=//; t; d' $out/eclipse/.eclipseproduct)
+        
+        makeWrapper $out/eclipse/eclipse $out/bin/eclipse \
+          --prefix PATH : ${jre}/bin \
+          --prefix LD_LIBRARY_PATH : ${glib}/lib:${gtk}/lib:${libXtst}/lib \
+          --add-flags "-configuration \$HOME/.eclipse/''${productId}_$productVersion/configuration"
+
+        # Create desktop item.
+        ensureDir $out/share/applications
+        cp ${desktopItem}/share/applications/* $out/share/applications
+      ''; # */
 
       meta = {
-        description = "provide environment to run Eclipse";
-        longDescription = ''
-          Is there one distribution providing support for up to date Eclipse installations?
-          There are various reasons why not.
-          Installing binaries just works. Get Eclipse binaries form eclipse.org/downloads
-          install this wrapper then run Eclipse like this:
-          nix-run-eclipse $PATH_TO_ECLIPSE/eclipse/eclipse
-          and be happy. Everything works including update sites.
-        '';
-        maintainers = [pkgs.lib.maintainers.marcweber];
-        platforms = pkgs.lib.platforms.linux;
+        homepage = http://www.eclipse.org/;
+        inherit description;
       };
-    };
-
-*/
 
+    };
+    
+in {
 
-let
+  eclipse_sdk_35 = buildEclipse {
+    name = "eclipse-sdk-3.5.2";
+    description = "Eclipse Classic";
+    src =
+      if stdenv.system == "x86_64-linux" then
+        fetchurl {
+          url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.5.2-201002111343/eclipse-SDK-3.5.2-linux-gtk-x86_64.tar.gz;
+          md5 = "54e2ce0660b2b1b0eb4267acf70ea66d";
+        }
+      else
+        fetchurl {
+          url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.5.2-201002111343/eclipse-SDK-3.5.2-linux-gtk.tar.gz;
+          md5 = "bde55a2354dc224cf5f26e5320e72dac";
+        };
+  };
 
-  v = if version == "latest" then "3.5.2" else version;
+  # !!! Use mirror://eclipse/.
 
-in
+  eclipse_sdk_36 = buildEclipse {
+    name = "eclipse-sdk-3.6.2";
+    description = "Eclipse Classic";
+    src =
+      if stdenv.system == "x86_64-linux" then
+        fetchurl {
+          url = http://ftp.ing.umu.se/mirror/eclipse/eclipse/downloads/drops/R-3.6.2-201102101200/eclipse-SDK-3.6.2-linux-gtk-x86_64.tar.gz;
+          sha256 = "0dfcfadcd6337c897fbfd5b292de481931dfce12d43289ecb93691fd27dd47f4";
+        }
+      else
+        fetchurl {
+          url = http://ftp.ing.umu.se/mirror/eclipse/eclipse/downloads/drops/R-3.6.2-201102101200/eclipse-SDK-3.6.2-linux-gtk.tar.gz;
+          sha256 = "1bh8ykliqr8wbciv13vpiy50rvm7yszk7y8dslr796dbwhi5b1cj";
+        };
+  };
 
-assert stdenv ? glibc;
+  eclipse_cpp_36 = buildEclipse {
+    name = "eclipse-cpp-3.6.2";
+    description = "Eclipse IDE for C/C++ Developers";
+    src =
+      if stdenv.system == "x86_64-linux" then
+        fetchurl {
+          url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/helios/SR2/eclipse-cpp-helios-SR2-linux-gtk-x86_64.tar.gz;
+          sha1 = "6f914e11fa15a900c46825e4aa8299afd76e7e65";
+        }
+      else
+        fetchurl {
+          url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/helios/SR2/eclipse-cpp-helios-SR2-linux-gtk.tar.gz;
+          sha1 = "1156e4bc0253ae3a3a4e54839e4944dc64d3108f";
+        };
+  };
 
-stdenv.mkDerivation rec {
-  name = "eclipse-${v}";
-  
-  src =
-    if v == "3.5.2" then
+  eclipse_modeling_36 = buildEclipse {
+    name = "eclipse-modeling-3.6.2";
+    description = "Eclipse Modeling Tools (includes Incubating components)";
+    src =
       if stdenv.system == "x86_64-linux" then
         fetchurl {
-          url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/eclipse/downloads/drops/R-3.5.2-201002111343/eclipse-SDK-3.5.2-linux-gtk-x86_64.tar.gz;
-          md5 = "54e2ce0660b2b1b0eb4267acf70ea66d";
+          url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/helios/SR2/eclipse-modeling-helios-SR2-incubation-linux-gtk-x86_64.tar.gz;
+          sha1 = "e96f5f006298f68476f4a15a2be8589158d5cc61";
         }
       else
         fetchurl {
-          url = http://mirror.selfnet.de/eclipse/eclipse/downloads/drops/R-3.5.2-201002111343/eclipse-SDK-3.5.2-linux-gtk.tar.gz;
-          md5 = "bde55a2354dc224cf5f26e5320e72dac";
+          url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/helios/SR2/eclipse-modeling-helios-SR2-incubation-linux-gtk.tar.gz;
+          sha1 = "696377895bb26445de39d82a916b7e69edb1d939";
+        };
+  };
+
+  eclipse_sdk_37 = buildEclipse {
+    name = "eclipse-sdk-3.7";
+    description = "Eclipse Classic";
+    src =
+      if stdenv.system == "x86_64-linux" then
+        fetchurl {
+          url = http://eclipse.ialto.com/eclipse/downloads/drops/R-3.7-201106131736/eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz;
+          sha256 = "00ig3ww98r8imf32sx5npm6csn5nx288gvdk6w653nijni0di16j";
         }
-    else if v == "3.5.1" then
-     if stdenv.system == "x86_64-linux" then
-       fetchurl {
-        url = http://ftp.ing.umu.se/mirror/eclipse/eclipse/downloads/drops/R-3.5.1-200909170800/eclipse-SDK-3.5.1-linux-gtk-x86_64.tar.gz;
-        sha256 = "132zd7q9q29h978wnlsfbrlszc85r1wj30yqs2aqbv3l5xgny1kk";
-       }
-     else
-       fetchurl {
-        url = http://mirrors.linux-bg.org/eclipse/eclipse/downloads/drops/R-3.5.1-200909170800/eclipse-SDK-3.5.1-linux-gtk.tar.gz;
-        sha256 = "0a0lpa7gxg91zswpahi6fvg3csl4csvlym4z2ad5cc1d4yvicp56";
-      }
-    else if v == "3.6.1" then
-     if stdenv.system == "x86_64-linux" then
-       fetchurl {
-        url = http://ftp.ing.umu.se/mirror/eclipse/eclipse/downloads/drops/R-3.6.1-201009090800/eclipse-SDK-3.6.1-linux-gtk-x86_64.tar.gz;
-        sha256 = "1cg9rrb5w978sdqbzz9lnli1lds9zhb6wfsj3wp725bqf1i6v9lg";
-       }
-     else
-       fetchurl {
-        url = http://ftp.ing.umu.se/mirror/eclipse/eclipse/downloads/drops/R-3.6.1-201009090800/eclipse-SDK-3.6.1-linux-gtk.tar.gz;
-        sha256 = "0s48rjaswi8m5gan1zlqvfwb4l06x5nslkq41wpkrbyj9ka8gh4x";
-      }
-    else throw "no source for eclipse version ${v} known";
-
-  desktopItem = makeDesktopItem {
-    name = "Eclipse";
-    exec = "eclipse";
-    icon = "eclipse";
-    comment = "Integrated Development Environment";
-    desktopName = "Eclipse IDE";
-    genericName = "Integrated Development Environment";
-    categories = "Application;Development;";
+      else
+        fetchurl {
+          url = http://eclipse.ialto.com/eclipse/downloads/drops/R-3.7-201106131736/eclipse-SDK-3.7-linux-gtk.tar.gz;
+          sha256 = "08rgw85cam51l98mzb39fdc3ykb369v8pap93qhknbs6a3f5dnff";
+        };
   };
 
-  buildInputs = [ makeWrapper patchelf ];
-  
-  buildCommand = ''
-    # Unpack tarball
-    ensureDir $out
-    tar xfvz $src -C $out
-    
-    # Patch binaries
-    interpreter=$(echo ${stdenv.glibc}/lib/ld-linux*.so.2)
-    patchelf --set-interpreter $interpreter $out/eclipse/eclipse
-    patchelf --set-rpath ${freetype}/lib:${fontconfig}/lib:${libX11}/lib:${libXrender}/lib:${zlib}/lib $out/eclipse/libcairo-swt.so
-
-    # Create wrapper script
-    makeWrapper $out/eclipse/eclipse $out/bin/eclipse \
-      --prefix PATH : ${jre}/bin \
-      --prefix LD_LIBRARY_PATH : ${glib}/lib:${gtk}/lib:${libXtst}/lib
-    
-    # Create desktop item
-    ensureDir $out/share/applications
-    cp ${desktopItem}/share/applications/* $out/share/applications
-  '';
-  
-  meta = {
-    homepage = http://www.eclipse.org/;
-    description = "A extensible multi-language software development environment";
-    longDescription = ''
-    '';
+  eclipse_cpp_37 = buildEclipse {
+    name = "eclipse-cpp-3.7";
+    description = "Eclipse IDE for C/C++ Developers";
+    src =
+      if stdenv.system == "x86_64-linux" then
+        fetchurl {
+          url = http://eclipse.ialto.com/technology/epp/downloads/release/indigo/R/eclipse-cpp-indigo-incubation-linux-gtk-x86_64.tar.gz;
+          sha256 = "14ppc9g9igzvj1pq7jl01vwhzb66nmzbl9wsdl1sf3xnwa9wnqk3";
+        }
+      else
+        fetchurl {
+          url = http://eclipse.ialto.com/technology/epp/downloads/release/indigo/R/eclipse-cpp-indigo-incubation-linux-gtk.tar.gz;
+          sha256 = "1cvg1vgyazrkinwzlvlf0dpl197p4784752srqybqylyj5psdi3b";
+        };
   };
-  
+
+
 }
+