summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9d3aafe7616fa1e782d64591c5fa1dfb9be50d13 (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
# Maintainer: Simone Cimarelli <aquilairreale [AT] ymail [DOT] com>

_basename=drive
pkgname=$_basename-git
pkgver=0.3.9.1.r51.gb868c96
pkgrel=1
pkgdesc="Google Drive client for the command line (development version)"
arch=("i686" "pentium4" "x86_64" "arm" "armv6h" "armv7h" "aarch64")
url="https://github.com/odeke-em/$_basename"
license=("APACHE")
makedepends=("git" "go>=1.9")
source=("$_basename::git+https://github.com/odeke-em/$_basename.git#branch=master")
md5sums=("SKIP")
provides=("$_basename")
conflicts=("$_basename")

pkgver() {
    cd "$srcdir/$_basename"
    git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    mkdir -p go/src/github.com/odeke-em
    ln -rTsf "$_basename" "go/src/github.com/odeke-em/$_basename"
    export GOPATH="$srcdir/go"
    cd "go/src/github.com/odeke-em/$_basename"
    go get -v -d ./...
}

build() {
    export GOPATH="$srcdir/go"
    cd "go/src/github.com/odeke-em/$_basename"
    go install -v \
        -gcflags "all=-trimpath=$GOPATH" \
        -asmflags "all=-trimpath=$GOPATH" \
        -ldflags "-extldflags $LDFLAGS" \
        ./...
}

package() {
    install -Dm755 "$srcdir/go/bin/$_basename" "$pkgdir/usr/bin/$_basename"
}