1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils java-pkg-2 java-ant-2 multilib
11 DESCRIPTION="An integration of Eclipse and Vim"
12 HOMEPAGE="http://eclim.org/"
13 SRC_URI="mirror://sourceforge/eclim/${MY_P}.tar.gz"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="cdt +java php ruby"
20 COMMON_DEPEND="dev-util/eclipse-sdk:3.5"
21 DEPEND="${COMMON_DEPEND}
23 RDEPEND="${COMMON_DEPEND}
24 || ( app-editors/vim app-editors/gvim )
28 eclipse_home="${ROOT}/usr/$(get_libdir)/eclipse-3.5"
31 ewarn "Eclim can only use Eclipse plugins that are installed system-wide."
32 ewarn "Please make sure necessary plugins are installed in ${eclipse_home}."
35 mypkg_plugins="jdt,ant,maven"
38 mypkg_plugins="${mypkg_plugins},cdt"
39 ewarn "You have enabled the 'cdt' USE flag."
40 ewarn "The cdt plugin requires that you have the Eclipse CDT installed."
43 mypkg_plugins="${mypkg_plugins},wst,dltk,pdt"
44 ewarn "You have enabled the 'php' USE flag."
45 ewarn "The php plugin requires that you have the Eclipse PDT installed."
48 mypkg_plugins="${mypkg_plugins},dltk,dltkruby"
49 ewarn "You have enabled the 'ruby' USE flag."
50 ewarn "The ruby plugin requires that you have the Eclipse DLTK Ruby installed."
53 # Remove leading comma
54 mypkg_plugins=${mypkg_plugins#,}
56 EANT_BUILD_TARGET="build"
57 EANT_EXTRA_ARGS="-Declipse.home=${eclipse_home} \
58 -Dplugins=${mypkg_plugins}"
59 EANT_EXTRA_ARGS_INSTALL="-Declipse.home=${D}${eclipse_home} \
60 -Dplugins=${mypkg_plugins} \
61 -Dvim.files=${D}/usr/share/vim/vimfiles"
65 # Fix up the installation process
66 epatch "${FILESDIR}"/${P}_fix_build_gant.patch
68 # Fix nailgun Makefile
69 sed -i -e '/CFLAGS=/d' -e 's/${CFLAGS}/& ${LDFLAGS}/' \
70 src/nailgun/Makefile || die "sed failed"
74 eant ${EANT_EXTRA_ARGS_INSTALL} deploy
76 # Fix path to eclim script
77 sed -i "s:${D}::" "${D}"/usr/share/vim/vimfiles/eclim/plugin/eclim.vim \
80 dosym "${eclipse_home}"/plugins/org.${MY_P}/bin/eclimd \
81 /usr/bin/eclimd || die "symlink failed"
82 dosym "${eclipse_home}"/plugins/org.${MY_P}/bin/eclim \
83 "${eclipse_home}"/eclim || die "symlink failed"