1. # Maintainer: Andrea Fagiani <andfagiani_at_gmail_dot_com>
  2.  
  3. pkgname=eclim
  4. pkgver=1.7.2
  5. pkgrel=1
  6. pkgdesc="Brings Eclipse functionality to Vim"
  7. url="http://eclim.org/"
  8. license=('GPL3')
  9. arch=(i686 x86_64)
  10. depends=('vim' 'eclipse')
  11. makedepends=('apache-ant' 'python-sphinx')
  12. optdepends=('eclipse-pdt: Eclipse PHP Development Tools support'
  13. 'eclipse-cdt: Eclipse C/C++ Plugin support'
  14. 'eclipse-dltk-core: Eclipse Dynamic Languagues Toolkit support'
  15. 'eclipse-dltk-ruby: Eclipse Ruby support'
  16. 'eclipse-wtp-wst: Eclipse Web Developer Tools support')
  17. conflicts=('eclim-git')
  18. install=$pkgname.install
  19. source=("http://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgver/${pkgname}_$pkgver.tar.gz"
  20. resources.patch)
  21. md5sums=('35882a173e8d340ceee527165cf359f8'
  22. '82ad75037bef68979aedc4f08a121a10')
  23. build() {
  24. cd $srcdir/${pkgname}_$pkgver
  25.  
  26. patch -Np1 -i $srcdir/resources.patch
  27.  
  28. # Manage plugins
  29. # jdt, ant and maven only require eclipse so they can be enabled without worries
  30. # might want to edit the _plugins array with those that suit your needs
  31. # options are : jdt, ant, maven, pdt, cdt, wst, dltk, dltkruby
  32. _plugins='jdt,ant,maven'
  33.  
  34. # Eventually enabling additional plugins, be sure to comment this if you're defining your own
  35. _plugins=$(pacman -Qs eclipse- | sed -n 's/.*\(pdt\|cdt\|wst\|dltk\(-ruby\)*\).*/\1/p' | tr '\n-' ',\0')$_plugins
  36.  
  37. # Get the ANT_HOME environment variable
  38. source /etc/profile.d/apache-ant.sh
  39.  
  40. # Build (necessary, we need to build with the correct environment variables
  41. mkdir -p $pkgdir/usr/share/eclipse
  42. mkdir -p $pkgdir/usr/share/vim/vimfiles
  43.  
  44. chmod +x src/nailgun/configure bin/sphinx
  45.  
  46. # recompiling nailgun to make sure the executable is compliant with our architecture
  47. cd src/nailgun
  48. ./configure
  49. make
  50. cd ../..
  51.  
  52. ant -Declipse.home=/usr/share/eclipse \
  53. -Dvim.files=/usr/share/vim/vimfiles \
  54. -Dplugins=$_plugins \
  55. build
  56.  
  57. ant -Declipse.home=$pkgdir/usr/share/eclipse \
  58. -Dvim.files=$pkgdir/usr/share/vim/vimfiles \
  59. -Dplugins=$_plugins \
  60. deploy
  61.  
  62. # fix eclim paths
  63. sed -i -e "s|$pkgdir||g" $pkgdir/usr/share/vim/vimfiles/eclim/plugin/eclim.vim
  64.  
  65. # delete Windows stuff
  66. for i in $(find $pkgdir -regex ".*bat\|.*cmd\|.*exe"); do rm -f $i ; done
  67. }