summaryrefslogtreecommitdiff
path: root/community/golangide/PKGBUILD
blob: f034f60c866da73e43b51fdefb773ae2fdc2ee64 (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
#$Id: PKGBUILD 81406 2012-12-19 18:29:25Z arodseth $
# Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Contributor: spambanane <happy.house@gmx.de>
# Contributor: Matteo <matteo.dek@gmail.com>

pkgname=golangide
pkgver=15
pkgrel=1
_hgrev=1011
pkgdesc='Simple IDE for Go to edit code and build projects'
license=('LGPL')
arch=('x86_64' 'i686')
url='https://github.com/visualfc/liteide'
depends=('go' 'libpng12' 'glib2')
makedepends=('gendesk')
options=('!strip')
_name=('Golang IDE')
_genericname=('Integrated development environment')

if [ "$CARCH" == "x86_64" ]; then
  source=("http://$pkgname.googlecode.com/files/liteidex${pkgver}.linux-amd64.hg${_hgrev}.tar.bz2"
          'golangide.png'
          'golangide.sh')
  sha256sums=('cb024050d1b41533c91722c005d08e99834585c3826e0b62cb55ec672b48f519'
            '47c52b22326034bd3d6a7b11b05a53c8b3838c08e145171cf5cad2ca00260697'
            '79eaede6c031e87a94627fb126a0aefab1feb971995d648436f142b3d684f1b2')
else
  source=("http://$pkgname.googlecode.com/files/liteidex${pkgver}.linux-386.hg${_hgrev}.tar.bz2"
          'golangide.png'
          'golangide.sh')
  sha256sums=('b41d9be3935524f38a3c8ba9db1014412e0daf7d57e2b8c2bee1de4572b67d18'
            '47c52b22326034bd3d6a7b11b05a53c8b3838c08e145171cf5cad2ca00260697'
            '79eaede6c031e87a94627fb126a0aefab1feb971995d648436f142b3d684f1b2')
fi

build() {
  cd "$srcdir"
  gendesk -n

  cd "liteide"
  # Fixing insecure RPATH
  find . -name "*.so" -type f -exec sed -i 's|/home/win|/usr/lib/|g' {} \;
  find . -name liteide -type f -exec sed -i 's|/home/win|/usr/lib/|g' {} \;
}

package() {
  cd "$srcdir/liteide"

  msg2 "Creating directories..."
  mkdir -p "$pkgdir/usr/lib/liteide"
  mkdir -p "$pkgdir/usr/share/liteide"
  mkdir -p "$pkgdir/usr/share/doc/$pkgname"

  msg2 "Packaging executables..."
  for binary in goastview goapi goexec godocview liteide; do
    install -Dm755 "bin/$binary" "$pkgdir/usr/bin/$binary"
  done
  install -Dm755 "$srcdir/$pkgname.sh" "$pkgdir/usr/bin/$pkgname"

  msg2 "Packaging resources..."
  cp -r share/liteide/* "$pkgdir/usr/share/liteide"

  msg2 "Packaging libraries and plugins..."
  cp -r lib/liteide/* "$pkgdir/usr/lib/liteide"

  msg2 "Packaging license and license exception..."
  install -Dm644 LICENSE.LGPL \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE.LGPL"
  install -Dm644 LGPL_EXCEPTION.TXT \
    "$pkgdir/usr/share/licenses/$pkgname/LGPL_EXCEPTION.TXT"

  cd ..

  msg2 "Packaging menu entry and icon..."
  install -Dm644 "$pkgname.desktop" \
    "$pkgdir/usr/share/applications/$pkgname.desktop"
  install -Dm644 "$pkgname.png" \
    "$pkgdir/usr/share/pixmaps/$pkgname.png"

  msg2 "Cleaning up..."
  rm -rf "$pkgdir/usr/share/$pkgname/doc"
}

# vim:set ts=2 sw=2 et: