summaryrefslogtreecommitdiff
path: root/pcr/eclim/PKGBUILD
blob: 4c4e7d10fd396a236b23e89fa6dc84b66f146d2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Maintainer: Aurélien DESBRIÈRES <aurelien@hackers.camp>
# Contributor: Andrea Fagiani <andfagiani_at_gmail_dot_com>

pkgname=eclim
pkgver=2.5.0
pkgrel=1
pkgdesc="Brings Eclipse functionality to Vim"
url="http://eclim.org/"
license=('GPL3')
arch=(i686 x86_64)
depends=('vim' 'eclipse')
makedepends=('apache-ant' 'python2-sphinx')
optdepends=('eclipse-pdt: Eclipse PHP Development Tools support'
            'eclipse-cdt: Eclipse C/C++ Plugin support'
            'eclipse-dltk-core: Eclipse Dynamic Languagues Toolkit support'
            'eclipse-dltk-ruby: Eclipse Ruby support'
            'eclipse-wtp: Eclipse Web Developer Tools support')
conflicts=('eclim-git')
install=$pkgname.install
source=("http://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgver/${pkgname}_$pkgver.tar.gz")

prepare() {
  cd $srcdir/${pkgname}_$pkgver

  # fix build, thanks to mikezackles
  sed -e "s/'sphinx-build'/'sphinx-build2'/g" \
    -e 's|${user.home}/\.|${vim.files}/|g' \
    -e "s|File(getVariable('eclipse')|File('/usr/lib/eclipse/'|g" \
    -e '68,88d' \
    -i ant/build.gant

  # Get the ANT_HOME environment variable
  source /etc/profile.d/apache-ant.sh

  chmod +x org.eclim/nailgun/configure bin/sphinx
}

build() {
  cd $srcdir/${pkgname}_$pkgver

  # recompiling nailgun to make sure the executable is compliant with our architecture
  cd org.eclim/nailgun
  ./configure
  make

  cd ../..

  ant -Declipse.home=/usr/lib/eclipse \
      -Dvim.files=/usr/share/vim/vimfiles \
      build
}

package() {
  cd $srcdir/${pkgname}_$pkgver

  mkdir -p $pkgdir/usr/lib/eclipse
  mkdir -p $pkgdir/usr/share/vim/vimfiles

  ant -Declipse.home=/usr/lib/eclipse \
      -Dvim.files=$pkgdir/usr/share/vim/vimfiles \
      docs vimdocs

  ant -Declipse.home=$pkgdir/usr/lib/eclipse \
      -Dvim.files=$pkgdir/usr/share/vim/vimfiles \
      deploy

  # copy eclim docs
  mkdir -p $pkgdir/usr/share/doc/
  cp -r build/doc/site $pkgdir/usr/share/doc/eclim

  # fix eclim paths
  sed -e "s|$pkgdir||g" \
    -i $pkgdir/usr/share/vim/vimfiles/eclim/plugin/eclim.vim \
    -i $pkgdir/usr/lib/eclipse/plugins/org.eclim_$pkgver/bin/eclimd \
    -i $pkgdir/usr/lib/eclipse/plugins/org.eclim_$pkgver/plugin.properties

  # delete doctrees
  rm -fr $pkgdir/usr/share/doc/eclim/.doctrees

  # delete Windows stuff
  for i in $(find $pkgdir -regex ".*bat\|.*cmd\|.*exe"); do  rm -f $i ; done

  rm $pkgdir/usr/lib/eclipse/plugins/org.eclim_${pkgver}/nailgun/config.status
}