updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / eclim-git / PKGBUILD
blob69728232bf1ba85772837e0be5d493c9082e2b8b
1 # Maintainer: Dave Reisner <d@falconindy.com>
2 # Contributor: Andrea Fagiani <andfagiani_at_gmail_dot_com>
4 pkgname=eclim-git
5 pkgver=20110208
6 pkgrel=1
7 pkgdesc="Brings Eclipse functionality to Vim"
8 url="http://eclim.org/"
9 license=('GPL3')
10 arch=(i686 x86_64)
11 depends=('vim' 'eclipse')
12 makedepends=('apache-ant' 'python-sphinx')
13 optdepends=('eclipse-pdt: Eclipse PHP Development Tools support'
14             'eclipse-cdt: Eclipse C/C++ Plugin support'
15             'eclipse-dltk-core: Eclipse Dynamic Languagues Toolkit support'
16             'eclipse-dltk-ruby: Eclipse Ruby support'
17             'eclipse-wtp-wst: Eclipse Web Developer Tools support')
18 conflicts=('eclim-git')
19 install=eclim.install
20 source=('resources.patch')
21 md5sums=('82ad75037bef68979aedc4f08a121a10')
23 _gitroot="git://github.com/ervandew/eclim.git"
24 _gitname="eclim"
26 build() {
27   cd "$srcdir"
28   msg "Connecting to GIT server...."
30   if [[ -d $_gitname ]] ; then
31     ( cd $_gitname && git pull origin; )
32     msg "The local files are updated."
33   else
34     git clone "$_gitroot"
35   fi
37   msg "GIT checkout done or server timeout"
38   msg "Starting make..."
40   rm -rf "$srcdir/$_gitname-build"
41   git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
42   cd "$srcdir/$_gitname-build"
44   patch -Np1 < "$srcdir"/resources.patch
46   # Manage plugins
47   # jdt, ant and maven only require eclipse so they can be enabled without worries
48   # might want to edit the _plugins array with those that suit your needs
49   # options are : jdt, ant, maven, pdt, cdt, wst, dltk, dltkruby
50   _plugins='jdt,ant,maven'
52   # Eventually enabling additional plugins, be sure to comment this if you're defining your own
53   _plugins=$(pacman -Qs eclipse- | sed -n 's/.*\(pdt\|cdt\|wst\|dltk\(-ruby\)*\).*/\1/p' | tr '\n-' ',\0')$_plugins
55   # Get the ANT_HOME environment variable
56   source /etc/profile.d/apache-ant.sh
58   # Build (necessary, we need to build with the correct environment variables
59   mkdir -p $pkgdir/usr/share/eclipse
60   mkdir -p $pkgdir/usr/share/vim/vimfiles
62   chmod +x src/nailgun/configure bin/sphinx
64   export ECLIM_ECLIPSE_HOME="/usr/share/eclipse"
66   msg2 "Building..."
67   ant -Dvim.files=/usr/share/vim/vimfiles \
68       -Dplugins=$_plugins \
69       build
71   msg2 "Deploying..."
72   ant -Declipse.home=$pkgdir/usr/share/eclipse \
73       -Dvim.files=$pkgdir/usr/share/vim/vimfiles \
74       -Dplugins=$_plugins \
75       deploy
77   msg2 "Generating docs..."
78   ant docs
79   ant -Dvim.files=$pkgdir/usr/share/vim/vimfiles vimdocs
81   # copy eclim docs
82   mkdir -p $pkgdir/usr/share/doc/
83   cp -r build/doc/site $pkgdir/usr/share/doc/eclim
85   # fix eclim paths
86   sed -i -e "s|$pkgdir||g" $pkgdir/usr/share/vim/vimfiles/eclim/plugin/eclim.vim
88   # delete Windows stuff
89   find "$pkgdir" -regex ".*bat\|.*cmd\|.*exe" -delete