summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6eb12e0788fff224cde87b292abe5da25306f346 (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
# Maintainer: Tony Lambiris <tony@libpcap.net>

pkgname=ginkgo-git
pkgver=2.9.5.r1.g3e39231
pkgrel=1
pkgdesc="BDD Testing Framework for Go"
arch=('x86_64')
url="http://onsi.github.io/ginkgo/"
license=('MIT')
depends=()
makedepends=('go')
optdepends=()
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("${pkgname}::git+https://github.com/onsi/ginkgo.git")
sha256sums=('SKIP')

pkgver() {
    cd "${srcdir}/${pkgname}"

    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//g'
}

prepare() {
    cd "${srcdir}/${pkgname}"

    mkdir -p "${srcdir}/go/src/github.com/onsi"
    ln -sf "${srcdir}/${pkgname}" "${srcdir}/go/src/github.com/onsi/ginkgo"
}

build() {
    cd "${srcdir}/go/src/github.com/onsi/ginkgo"

    mkdir -p build

    export GOPATH="${srcdir}/go"
    go build \
        -trimpath -modcacherw -ldflags "-s -w" \
        -o build/ginkgo ./ginkgo
}

package() {
    cd "${srcdir}/go/src/github.com/onsi/ginkgo"

    install -Dm755 build/ginkgo "${pkgdir}/usr/bin/ginkgo"
}