summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7088fbaa7884aaa55ba1db893352c2c8f8a4e33d (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
# Maintainer: Daniel Bershatsky <bepshatsky@yandex.ru>
pkgname=swift-protobuf-git
pkgver=1.0.2
pkgrel=1
epoch=0
pkgdesc="Plugin and runtime library for using protobuf with Swift."
arch=('i686' 'x86_64')
url="https://github.com/apple/swift-protobuf"
license=('Apache-2.0')
depends=('protobuf' 'swift-language')
makedepends=()
checkdepends=()
optdepends=()
provides=('swift-protobuf')
conflicts=()
replaces=()
backup=()
options=()

source=("swift-protobuf::git+https://github.com/apple/swift-protobuf.git")
md5sums=('SKIP')

validpgpkeys=()

pkgver() {
    cd "$srcdir/swift-protobuf"
    version=$(git tag -l | tail -n 1)
    digest=$(git describe --long --all)
    release=$(sed "s/heads\/master/$version/" <<< $digest)
    echo $release
}

package() {
    cd $srcdir/swift-protobuf

    version=$(git tag -l | tail -n 1)
    git checkout tags/$version

    swift build -c release -Xswiftc -static-stdlib
}

install() {
    target=protoc-gen-swift
    mkdir -p $pkgdir/usr/bin
    cp $srcdir/swift-protobuf/.build/release/$target $pkgdir/usr/bin
    chmod +x $pkgdir/usr/bin/$target
}