]> Pileus Git - ~andy/sunrise/blob - dev-util/eclim/eclim-1.5.6.ebuild
move to appropriate category
[~andy/sunrise] / dev-util / eclim / eclim-1.5.6.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="2"
6
7 inherit eutils java-pkg-2 java-ant-2 multilib
8
9 MY_P=${P/-/_}
10
11 DESCRIPTION="An integration of Eclipse and Vim"
12 HOMEPAGE="http://eclim.org/"
13 SRC_URI="mirror://sourceforge/eclim/${MY_P}.tar.gz"
14
15 LICENSE="GPL-3"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="cdt +java php ruby"
19
20 COMMON_DEPEND="dev-util/eclipse-sdk:3.5"
21 DEPEND="${COMMON_DEPEND}
22         >=virtual/jdk-1.5"
23 RDEPEND="${COMMON_DEPEND}
24         || ( app-editors/vim app-editors/gvim )
25         >=virtual/jre-1.5"
26
27 S=${WORKDIR}/${MY_P}
28 eclipse_home="${ROOT}/usr/$(get_libdir)/eclipse-3.5"
29
30 pkg_setup() {
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}."
33
34         if use java ; then
35                 mypkg_plugins="jdt,ant,maven"
36         fi
37         if use cdt ; then
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."
41         fi
42         if use php ; then
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."
46         fi
47         if use ruby ; then
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."
51         fi
52
53         # Remove leading comma
54         mypkg_plugins=${mypkg_plugins#,}
55
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"
62 }
63
64 src_prepare() {
65         # Fix up the installation process
66         epatch "${FILESDIR}"/${P}_fix_build_gant.patch
67
68         # Fix nailgun Makefile
69         sed -i -e '/CFLAGS=/d' -e 's/${CFLAGS}/& ${LDFLAGS}/' \
70                 src/nailgun/Makefile || die "sed failed"
71 }
72
73 src_install() {
74         eant ${EANT_EXTRA_ARGS_INSTALL} deploy
75
76         # Fix path to eclim script
77         sed -i "s:${D}::" "${D}"/usr/share/vim/vimfiles/eclim/plugin/eclim.vim \
78                 || die "sed failed"
79
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"
84 }