summary refs log tree commit diff
diff options
context:
space:
mode:
authorMurad Ulityonok <mooooorad@gmail.com>2015-11-06 05:41:35 -0800
committerMurad Ulityonok <mooooorad@gmail.com>2015-11-06 05:41:35 -0800
commit5b4fa99f1d5c035f1ccfa4f8d08694edb3523888 (patch)
tree7517acd541788338f241877d535e2215678a9c0f
parent5a162cd06891c23a05a4b3070d89d8e78821e4e8 (diff)
downloadnixlib-5b4fa99f1d5c035f1ccfa4f8d08694edb3523888.tar
nixlib-5b4fa99f1d5c035f1ccfa4f8d08694edb3523888.tar.gz
nixlib-5b4fa99f1d5c035f1ccfa4f8d08694edb3523888.tar.bz2
nixlib-5b4fa99f1d5c035f1ccfa4f8d08694edb3523888.tar.lz
nixlib-5b4fa99f1d5c035f1ccfa4f8d08694edb3523888.tar.xz
nixlib-5b4fa99f1d5c035f1ccfa4f8d08694edb3523888.tar.zst
nixlib-5b4fa99f1d5c035f1ccfa4f8d08694edb3523888.zip
modularized Eclipse package
-rw-r--r--pkgs/applications/editors/eclipse/buildEclipse.nix54
-rw-r--r--pkgs/applications/editors/eclipse/default.nix56
2 files changed, 56 insertions, 54 deletions
diff --git a/pkgs/applications/editors/eclipse/buildEclipse.nix b/pkgs/applications/editors/eclipse/buildEclipse.nix
new file mode 100644
index 000000000000..558c9fa3de5f
--- /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_<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${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 7d543c4ed55f..693e2b9babec 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_<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${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 {