From 20a15e993b2fd5eae224446fe85cf20a61bcc7ee Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Sun, 26 Oct 2008 17:45:14 +0000 Subject: [PATCH] eclipse-new expression (update of eclipse_classic_src) It supports now insntalling some plugins (however the eclipse path will be copied once) You can still just copy the whole store path to you home directory to install additional plugins using update sites svn path=/nixpkgs/trunk/; revision=13121 --- .../editors/eclipse-new/3.3.1.1.nix | 96 +++++++++++++++++++ .../3.3.1.1/build-with-jdk-compiler.patch | 22 +++++ .../editors/eclipse-new/3.3.1.1/eclipse.nix | 57 +++++++++++ pkgs/top-level/all-packages.nix | 16 ++++ 4 files changed, 191 insertions(+) create mode 100644 pkgs/applications/editors/eclipse-new/3.3.1.1.nix create mode 100644 pkgs/applications/editors/eclipse-new/3.3.1.1/build-with-jdk-compiler.patch create mode 100644 pkgs/applications/editors/eclipse-new/3.3.1.1/eclipse.nix diff --git a/pkgs/applications/editors/eclipse-new/3.3.1.1.nix b/pkgs/applications/editors/eclipse-new/3.3.1.1.nix new file mode 100644 index 00000000000..2c039b9213e --- /dev/null +++ b/pkgs/applications/editors/eclipse-new/3.3.1.1.nix @@ -0,0 +1,96 @@ +args: with args; let + + # hint: eclipse -data + + eclipsePlugin = name : src : stdenv.mkDerivation { + inherit src; + name = "${name}-eclipse-plugin"; + phases = "unpackPhase"; + buildInputs = [ args.unzip ]; + unpackPhase = '' + mkdir tmp; cd tmp + unpackFile "$src" + [ -d ./eclipse ] || { # if plugin doesn't contain the eclipse directory itself create it (eg viPlugin) + mkdir "$TMP/eclipse" + mv * "$TMP/eclipse" + cd "$TMP" + } + ensureDir $out; + mv eclipse "$out" + ''; + }; + + eclipseEnv = {name, eclipse, links}: runCommand name { inherit links eclipse; } '' + ensureDir $out/eclipse/links; + cp -r "$eclipse/bin" "$out/bin" + for f in $eclipse/eclipse/*; do + # using ln eclipse doesn't take the correct link folder :-( (TODO) + # ln -s "$f" "$out/eclipse/$(basename "$f")" + cp -r "$f" "$out/eclipse/$(basename "$f")" + done + # create links + for link in $links; do + echo "path=$link" >> "$out/eclipse/links/$(basename "$link").link" + done + ''; + + # mmh, this derivation is superfluous. We could also create them directly + # instead of symlinking them into the final env build by buildEnv + linkFile = deriv : writeTextFile { + name = "${deriv.name}-eclipse-feature-link"; + destination = "/eclipse/links/${deriv.name}.link"; + }; + + attr = rec { + eclipse = import ( ../eclipse-new + "/${version}/eclipse.nix") args; # without any additional plugins, why can't I use ./ instead of ../eclipse-new ? + + plugins = rec { + + viPlugin = { # see its license! + plugin = eclipsePlugin "viPlugin_1.15.6" (fetchurl { + url = http://www.satokar.com/viplugin/files/viPlugin_1.15.6.zip; + sha256 = "0p53q45a754j143pnnp51rjwj7lzawcxfy9xzpjasdic4a2l0f96"; + # license = "Other/Proprietary License with Free Trial"; + }); + }; + + # PHP developement + emfSdoXsdSDK232 = { + plugin = eclipsePlugin "emf-sdo-xsd-SDK-2.3.2" (fetchurl { + url = http://eclipsemirror.yoxos.com/eclipse.org/modeling/emf/emf/downloads/drops/2.3.2/R200802051830/emf-sdo-xsd-SDK-2.3.2.zip; + sha256 = "1k20fn47x1giwhc80rzkqaw3mn0p3861sjp7aw39842lv2hjwn1c"; + }); + }; + gefSDK332 = { + plugin = eclipsePlugin "GEF-SDK-3.3.2" (fetchurl { + url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/tools/gef/downloads/drops/3.3.2/R200802211602/GEF-SDK-3.3.2.zip; + sha256 = "1pk5qlwk0iyvs85s966y96ks8vq1g81fivvbf4lh43155rg0z037"; + }); + }; + wtpSdkR202X = { + plugin = eclipsePlugin "wtp-sdk-R-2.0.2-20080223205547" (fetchurl { + url = http://ftp.wh2.tu-dresden.de/pub/mirrors/eclipse/webtools/downloads/drops/R2.0/R-2.0.2-20080223205547/wtp-sdk-R-2.0.2-20080223205547.zip; + sha256 = "0hmmmqzcd67jir2gmjd0xri5w2434xb2dk21hpgcv2qp0h9hhx0f"; + }); + }; + pdt = { + deps = [ wtpSdkR202X gefSDK332 emfSdoXsdSDK232 ]; + plugin = eclipsePlugin "pdt-runtime-1.0.3" (fetchurl { + url = http://sunsite.informatik.rwth-aachen.de:3080/eclipse/tools/pdt/downloads/drops/1.0.3/R200806030000/pdt-runtime-1.0.3.zip; + sha256 = "0wd2vc9bqrk5mqj5al2ichm8lxlf7gwifsb9lzv1d896j04ilm96"; + }); + }; + }; + }; + pluginToList = a : [ a.plugin ] ++ lib.optionals (a ? deps ) (lib.concatMap pluginToList a.deps); + in + eclipseEnv { + name = "eclipse-${version}-with-plugins"; + inherit (attr) eclipse; + links = + # example custom config: eclipse = { plugins = {eclipse, version, plugins } : let p = plugins; in [p.pdt]; }; + let userChosenPlugins = (getConfig [ "eclipse" "plugins" ] ( {eclipse, version, plugins} : [] )) + { inherit (attr) eclipse plugins; inherit version; }; + in # concatenate plugins and plugin dependencies + (lib.uniqList { inputList = lib.concatMap pluginToList userChosenPlugins; }); + } diff --git a/pkgs/applications/editors/eclipse-new/3.3.1.1/build-with-jdk-compiler.patch b/pkgs/applications/editors/eclipse-new/3.3.1.1/build-with-jdk-compiler.patch new file mode 100644 index 00000000000..bac6fc035f1 --- /dev/null +++ b/pkgs/applications/editors/eclipse-new/3.3.1.1/build-with-jdk-compiler.patch @@ -0,0 +1,22 @@ +--- a/build.xml 2008-03-02 14:34:05.000000000 +0100 ++++ b/build.xml 2008-03-02 14:34:57.000000000 +0100 +@@ -291,19 +291,6 @@ + + + +- +- +- +- +- +- +- +- +- +- +- +- +- + + + diff --git a/pkgs/applications/editors/eclipse-new/3.3.1.1/eclipse.nix b/pkgs/applications/editors/eclipse-new/3.3.1.1/eclipse.nix new file mode 100644 index 00000000000..ddd3dd83ac0 --- /dev/null +++ b/pkgs/applications/editors/eclipse-new/3.3.1.1/eclipse.nix @@ -0,0 +1,57 @@ +# Note, if you want to install plugins using the update manager you should +# copy the store path to a local directory and chown -R $USER yourcopy +# Then start your local copy + +args: with args; +let arch = if stdenv.system == "x86_64-linux" then "x86_64" + else if stdenv.system == "i686-linux" then "x86" + else throw "not supported system"; +in +args.stdenv.mkDerivation rec { + #name = "eclipse-classic-3.4M5"; + name = "eclipse-classic-3.3.1.1"; + + unpackPhase = "unzip \$src; set -x "; + buildInputs = [ unzip jdk gtk glib libXtst ant makeWrapper]; + + + patches=./build-with-jdk-compiler.patch; + + buildPhase = "./build -os linux -ws gtk -arch ${arch}"; + + libraries = [gtk glib libXtst]; + + installPhase = " + t=\$out/share/${name} + ensureDir \$t \$out/bin + cd result + tar xfz linux-gtk-*.tar.gz + mv eclipse \$out + " + #copied from other eclipse expressions + +" rpath= + for i in \$libraries; do + rpath=\$rpath\${rpath:+:}\$i/lib + done + find \$out \\( -type f -a -perm +0100 \\) \\ + -print \\ + -exec patchelf --interpreter \"$(cat \$NIX_GCC/nix-support/dynamic-linker)\" \\ + --set-rpath \"\$rpath\" {} \\; + + # Make a wrapper script so that the proper JDK is found. + makeWrapper \$out/eclipse/eclipse \$out/bin/eclipse \\ + --prefix PATH \":\" \"\$jdk/bin\" \\ + --prefix LD_LIBRARY_PATH \":\" \"\$rpath\" + sed -e 's=exec.*=exec \$(dirname $0)/../eclipse/eclipse $@=' -i \$out/bin/eclipse + "; + # using dirname so that eclipse still runs after copying the whole store + # directory somewhere else (so that you can use the update manager + + src = args.fetchurl { + #url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/eclipse/downloads/drops/S-3.4M5-200802071530/eclipse-sourceBuild-srcIncluded-3.4M5.zip; + #sha256 = "1w6fbpwkys65whygc045556772asggj24x8assnaba6nl70z00az"; + + url = http://download.micromata.de/eclipse/eclipse/downloads/drops/R-3.3.1.1-200710231652/eclipse-sourceBuild-srcIncluded-3.3.1.1.zip; + sha256 = "0n56i7ml816f839704qlkgs5ahl0iqgwc80kjq7n7g5rl9a4vhp4"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8afb645f8b6..6b33e8012b8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6991,6 +6991,22 @@ let inherit (xlibs) libX11 libXinerama; }; + + # put something like this into your ~/.nixpkgs/config.nix file + #eclipse = { + # plugins = {eclipse, version, plugins } : let p = plugins; in + # [ p.pdt # PHP developement + # p.viPlugin # vim keybindings (see license) + # ]; + #}; + eclipseNew = (selectVersion ../applications/editors/eclipse-new "3.3.1.1" { + # outdated, but 3.3.1.1 does already compile on nix, feel free to work 3.4 + inherit fetchurl stdenv makeWrapper jdk unzip ant selectVersion buildEnv + getConfig lib zip writeTextFile runCommand; + inherit (gtkLibs) gtk glib; + inherit (xlibs) libXtst; + }); + # building eclipise from source # experimental tested on x86_64-linux only eclipse_classic_src = import ../applications/editors/eclipse/eclipse_classic.nix {