updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / go-xgb-hg / PKGBUILD
blob4401836583e7b128d4a420a855dede82c39b2b47
1 # Maintainer: Rémy Oudompheng <remy@archlinux.org>
3 pkgname=go-xgb-hg
4 _goname=xgb
5 pkgver=9
6 pkgrel=1
7 pkgdesc="Go package for X11 protocol based on XCB descriptions"
8 arch=('i686' 'x86_64')
9 url="http://code.google.com/p/x-go-binding"
10 license=('custom')
11 depends=('go')
12 makedepends=('mercurial' 'python2' 'xcb-proto')
13 provides=('go-xgb')
14 options=('!strip')
15 source=("Makefile")
16 md5sums=('0cca2741e62b642aef9175db471c9262')
18 _hgroot="https://code.google.com/p/x-go-binding/"
19 _hgrepo="x-go-binding"
21 build() {
22   cd "$srcdir"
23   msg "Connecting to Mercurial server...."
25   if [ -d $_hgrepo ] ; then
26     cd $_hgrepo
27     hg pull -u
28     msg "The local files are updated."
29   else
30     hg clone $_hgroot $_hgrepo
31   fi
33   msg "Mercurial checkout done or server timeout"
34   msg "Starting make..."
36   rm -rf "$srcdir/$_hgrepo-build"
37   cp -r "$srcdir/$_hgrepo" "$srcdir/$_hgrepo-build"
38   cd "$srcdir/$_hgrepo-build"
40   source /etc/profile.d/go.sh
41   cd ${_goname}
42   cp ${srcdir}/Makefile .
43   gomake
46 package() {
47   cd "$srcdir/$_hgrepo-build"
48   source /etc/profile.d/go.sh
49   mkdir -p ${pkgdir}/${GOROOT}/src/pkg/${_goname}
50   # copy source files
51   cp -Rv ${srcdir}/${_hgrepo}/* ${pkgdir}/${GOROOT}/src/pkg/${_goname}
52   # install libraries
53   cd ${_goname}
54   cp -v ${GOROOT}/src/Make.* ${pkgdir}/${GOROOT}/src/
55   GOROOT=${pkgdir}/${GOROOT} gomake install
56   rm -f ${pkgdir}/${GOROOT}/src/Make.*
59 # vim: set ts=2 sw=2 et: