mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-04 11:37:19 +03:00
modularized Eclipse package
This commit is contained in:
parent
5a162cd068
commit
5b4fa99f1d
54
pkgs/applications/editors/eclipse/buildEclipse.nix
Normal file
54
pkgs/applications/editors/eclipse/buildEclipse.nix
Normal file
@ -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;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -4,66 +4,14 @@
|
|||||||
, webkitgtk2 ? null # for internal web browser
|
, webkitgtk2 ? null # for internal web browser
|
||||||
, buildEnv, writeText, runCommand
|
, buildEnv, writeText, runCommand
|
||||||
, callPackage
|
, callPackage
|
||||||
}:
|
} @ args:
|
||||||
|
|
||||||
assert stdenv ? glibc;
|
assert stdenv ? glibc;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
buildEclipse =
|
buildEclipse = import ./buildEclipse.nix args;
|
||||||
{ 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;
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
eclipse_sdk_35 = buildEclipse {
|
eclipse_sdk_35 = buildEclipse {
|
||||||
|
Loading…
Reference in New Issue
Block a user