From 5b4fa99f1d5c035f1ccfa4f8d08694edb3523888 Mon Sep 17 00:00:00 2001 From: Murad Ulityonok Date: Fri, 6 Nov 2015 05:41:35 -0800 Subject: [PATCH 1/4] modularized Eclipse package --- .../editors/eclipse/buildEclipse.nix | 54 ++++++++++++++++++ pkgs/applications/editors/eclipse/default.nix | 56 +------------------ 2 files changed, 56 insertions(+), 54 deletions(-) create mode 100644 pkgs/applications/editors/eclipse/buildEclipse.nix diff --git a/pkgs/applications/editors/eclipse/buildEclipse.nix b/pkgs/applications/editors/eclipse/buildEclipse.nix new file mode 100644 index 00000000000..558c9fa3de5 --- /dev/null +++ b/pkgs/applications/editors/eclipse/buildEclipse.nix @@ -0,0 +1,54 @@ +{ stdenv, makeDesktopItem, freetype, fontconfig, libX11, libXrender, zlib, jre, glib, gtk, libXtst, webkitgtk2, makeWrapper, ... }: + +{ name, src ? builtins.getAttr stdenv.system sources, sources ? null, description }: + +stdenv.mkDerivation rec { + inherit name src; + + desktopItem = makeDesktopItem { + name = "Eclipse"; + exec = "eclipse"; + icon = "eclipse"; + comment = "Integrated Development Environment"; + desktopName = "Eclipse IDE"; + genericName = "Integrated Development Environment"; + categories = "Application;Development;"; + }; + + buildInputs = [ makeWrapper ]; + + buildCommand = '' + # Unpack tarball. + mkdir -p $out + tar xfvz $src -C $out + + # Patch binaries. + interpreter=$(echo ${stdenv.glibc}/lib/ld-linux*.so.2) + libCairo=$out/eclipse/libcairo-swt.so + patchelf --set-interpreter $interpreter $out/eclipse/eclipse + [ -f $libCairo ] && patchelf --set-rpath ${freetype}/lib:${fontconfig}/lib:${libX11}/lib:${libXrender}/lib:${zlib}/lib $libCairo + + # Create wrapper script. Pass -configuration to store + # settings in ~/.eclipse/org.eclipse.platform_ rather + # than ~/.eclipse/org.eclipse.platform__. + 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${stdenv.lib.optionalString (webkitgtk2 != null) ":${webkitgtk2}/lib"} \ + --add-flags "-configuration \$HOME/.eclipse/''${productId}_$productVersion/configuration" + + # Create desktop item. + mkdir -p $out/share/applications + cp ${desktopItem}/share/applications/* $out/share/applications + mkdir -p $out/share/pixmaps + ln -s $out/eclipse/icon.xpm $out/share/pixmaps/eclipse.xpm + ''; # */ + + meta = { + homepage = http://www.eclipse.org/; + inherit description; + }; + +} diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix index 7d543c4ed55..693e2b9babe 100644 --- a/pkgs/applications/editors/eclipse/default.nix +++ b/pkgs/applications/editors/eclipse/default.nix @@ -4,66 +4,14 @@ , webkitgtk2 ? null # for internal web browser , buildEnv, writeText, runCommand , callPackage -}: +} @ args: assert stdenv ? glibc; let - buildEclipse = - { name, src ? builtins.getAttr stdenv.system sources, sources ? null, description }: + buildEclipse = import ./buildEclipse.nix args; - stdenv.mkDerivation rec { - inherit name src; - - desktopItem = makeDesktopItem { - name = "Eclipse"; - exec = "eclipse"; - icon = "eclipse"; - comment = "Integrated Development Environment"; - desktopName = "Eclipse IDE"; - genericName = "Integrated Development Environment"; - categories = "Application;Development;"; - }; - - buildInputs = [ makeWrapper ]; - - buildCommand = '' - # Unpack tarball. - mkdir -p $out - tar xfvz $src -C $out - - # Patch binaries. - interpreter=$(echo ${stdenv.glibc}/lib/ld-linux*.so.2) - libCairo=$out/eclipse/libcairo-swt.so - patchelf --set-interpreter $interpreter $out/eclipse/eclipse - [ -f $libCairo ] && patchelf --set-rpath ${freetype}/lib:${fontconfig}/lib:${libX11}/lib:${libXrender}/lib:${zlib}/lib $libCairo - - # Create wrapper script. Pass -configuration to store - # settings in ~/.eclipse/org.eclipse.platform_ rather - # than ~/.eclipse/org.eclipse.platform__. - 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${stdenv.lib.optionalString (webkitgtk2 != null) ":${webkitgtk2}/lib"} \ - --add-flags "-configuration \$HOME/.eclipse/''${productId}_$productVersion/configuration" - - # Create desktop item. - mkdir -p $out/share/applications - cp ${desktopItem}/share/applications/* $out/share/applications - mkdir -p $out/share/pixmaps - ln -s $out/eclipse/icon.xpm $out/share/pixmaps/eclipse.xpm - ''; # */ - - meta = { - homepage = http://www.eclipse.org/; - inherit description; - }; - - }; - in { eclipse_sdk_35 = buildEclipse { From 2a8129924bfe0c0e56f8a9aca0df43a1d74da75a Mon Sep 17 00:00:00 2001 From: Murad Ulityonok Date: Fri, 6 Nov 2015 06:26:34 -0800 Subject: [PATCH 2/4] added Eclipse Mars SDK 4.5.1 --- pkgs/applications/editors/eclipse/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix index 693e2b9babe..177e7046132 100644 --- a/pkgs/applications/editors/eclipse/default.nix +++ b/pkgs/applications/editors/eclipse/default.nix @@ -285,6 +285,21 @@ in { }; }; + eclipse_sdk_451 = buildEclipse { + name = "eclipse-sdk-4.5.1"; + description = "Eclipse Mars Classic"; + sources = { + "x86_64-linux" = fetchurl { + url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.5.1-201509040015/eclipse-SDK-4.5.1-linux-gtk-x86_64.tar.gz; + sha256 = "b56503ab4b86f54e1cdc93084ef8c32fb1eaabc6f6dad9ef636153b14c928e02"; + }; + "i686-linux" = fetchurl { + url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.5.1-201509040015/eclipse-SDK-4.5.1-linux-gtk.tar.gz; + sha256 = "f2e41da52e138276f8f121fd4d57c3f98839817836b56f8424e99b63c9b1b025"; + }; + }; + }; + eclipse-platform = buildEclipse { name = "eclipse-platform-4.5"; description = "Eclipse platform"; From ace6ed9127bd83e3552d84a27ebeddee8b8e4947 Mon Sep 17 00:00:00 2001 From: Murad Ulityonok Date: Fri, 6 Nov 2015 06:32:30 -0800 Subject: [PATCH 3/4] homogenized style --- pkgs/applications/editors/eclipse/default.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix index 177e7046132..3dc28fce6b4 100644 --- a/pkgs/applications/editors/eclipse/default.nix +++ b/pkgs/applications/editors/eclipse/default.nix @@ -260,7 +260,6 @@ in { "x86_64-linux" = fetchurl { url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.4.2-201502041700/eclipse-SDK-4.4.2-linux-gtk-x86_64.tar.gz; sha256 = "0g00alsixfaakmn4khr0m9fxvkrbhbg6qqfa27xr6a9np6gzg98l"; - }; "i686-linux" = fetchurl { url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.4.2-201502041700/eclipse-SDK-4.4.2-linux-gtk.tar.gz; @@ -276,7 +275,6 @@ in { "x86_64-linux" = fetchurl { url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.5-201506032000/eclipse-SDK-4.5-linux-gtk-x86_64.tar.gz; sha256 = "0vfql4gh263ms8bg7sgn05gnjajplx304cn3nr03jlacgr3pkarf"; - }; "i686-linux" = fetchurl { url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.5-201506032000/eclipse-SDK-4.5-linux-gtk.tar.gz; @@ -305,12 +303,11 @@ in { description = "Eclipse platform"; sources = { "x86_64-linux" = fetchurl { - url = "https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.5-201506032000/eclipse-platform-4.5-linux-gtk-x86_64.tar.gz"; + url = https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.5-201506032000/eclipse-platform-4.5-linux-gtk-x86_64.tar.gz; sha256 = "1510j41yr86pbzwf48kjjdd46nkpkh8zwn0hna0cqvsw1gk2vqcg"; - }; "i686-linux" = fetchurl { - url = "https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.5-201506032000/eclipse-platform-4.5-linux-gtk.tar.gz"; + url = https://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.5-201506032000/eclipse-platform-4.5-linux-gtk.tar.gz; sha256 = "1f97jd3qbi3830y3djk8bhwzd9whsq8gzfdk996chxc55prn0qbd"; }; }; From 6115684b73e55f196ad8d58c755851ffd96d0697 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sat, 16 Jan 2016 18:35:35 +0100 Subject: [PATCH 4/4] Avoid CamelCase in filenames and add buildEclipse --- .../editors/eclipse/{buildEclipse.nix => build-eclipse.nix} | 0 pkgs/applications/editors/eclipse/default.nix | 6 ++---- 2 files changed, 2 insertions(+), 4 deletions(-) rename pkgs/applications/editors/eclipse/{buildEclipse.nix => build-eclipse.nix} (100%) diff --git a/pkgs/applications/editors/eclipse/buildEclipse.nix b/pkgs/applications/editors/eclipse/build-eclipse.nix similarity index 100% rename from pkgs/applications/editors/eclipse/buildEclipse.nix rename to pkgs/applications/editors/eclipse/build-eclipse.nix diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix index 3dc28fce6b4..3fed254d6e9 100644 --- a/pkgs/applications/editors/eclipse/default.nix +++ b/pkgs/applications/editors/eclipse/default.nix @@ -8,11 +8,9 @@ assert stdenv ? glibc; -let +rec { - buildEclipse = import ./buildEclipse.nix args; - -in { + buildEclipse = import ./build-eclipse.nix args; eclipse_sdk_35 = buildEclipse { name = "eclipse-sdk-3.5.2";