2009-11-20 15:19:00 +00:00
|
|
|
{ stdenv, fetchurl, patchelf, makeDesktopItem, makeWrapper
|
|
|
|
, freetype, fontconfig, libX11, libXext, libXrender, zlib
|
|
|
|
, glib, gtk, libXtst, jre
|
2009-05-13 14:55:53 +01:00
|
|
|
}:
|
|
|
|
|
2009-05-29 10:59:26 +01:00
|
|
|
assert stdenv ? glibc;
|
|
|
|
|
2009-05-13 14:55:53 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2009-11-03 11:00:18 +00:00
|
|
|
name = "eclipse-3.5.1";
|
2009-11-20 15:19:00 +00:00
|
|
|
|
|
|
|
src =
|
|
|
|
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";
|
|
|
|
}
|
2009-05-13 14:55:53 +01:00
|
|
|
else
|
2009-11-20 15:19:00 +00:00
|
|
|
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";
|
|
|
|
};
|
2009-05-13 14:55:53 +01:00
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "Eclipse";
|
|
|
|
exec = "eclipse";
|
|
|
|
icon = "eclipse";
|
|
|
|
comment = "Integrated Development Environment";
|
|
|
|
desktopName = "Eclipse IDE";
|
|
|
|
genericName = "Integrated Development Environment";
|
|
|
|
categories = "Application;Development;";
|
|
|
|
};
|
|
|
|
|
2009-11-20 15:19:00 +00:00
|
|
|
buildInputs = [ makeWrapper patchelf ];
|
|
|
|
|
2009-05-13 14:55:53 +01:00
|
|
|
buildCommand = ''
|
|
|
|
# Unpack tarball
|
2009-11-20 15:19:00 +00:00
|
|
|
ensureDir $out
|
|
|
|
tar xfvz $src -C $out
|
2009-05-13 14:55:53 +01:00
|
|
|
|
|
|
|
# Patch binaries
|
2009-11-20 15:19:00 +00:00
|
|
|
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
|
2009-05-13 14:55:53 +01:00
|
|
|
|
|
|
|
# Create wrapper script
|
2009-11-20 15:19:00 +00:00
|
|
|
makeWrapper $out/eclipse/eclipse $out/bin/eclipse \
|
|
|
|
--prefix PATH : ${jre}/bin \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${glib}/lib:${gtk}/lib:${libXtst}/lib
|
2009-05-13 14:55:53 +01:00
|
|
|
|
|
|
|
# Create desktop item
|
|
|
|
ensureDir $out/share/applications
|
|
|
|
cp ${desktopItem}/share/applications/* $out/share/applications
|
|
|
|
'';
|
|
|
|
}
|