summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0cb010a852b2f068f49505edbcec868d879404fd (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
# Contributor: Joaquin Garmendia <joaquingc123 at gmail dot com>
# Contributor: Aniket Pradhan <aniket17133@iiitd.ac.in>
# Contributor: Xinzhao Xu <z2d@jifangcheng.com>

pkgname=annie-git
pkgver=0.11.0.r20.g8b53403
pkgrel=1
arch=('x86_64')
pkgdesc="A fast, simple and clean video downloader written in Go"
url="https://github.com/iawia002/annie"
license=('MIT')
makedepends=('go')
depends=('ffmpeg')
conflicts=('annie')
provides=('annie')
source=("git+https://github.com/iawia002/annie.git")
sha256sums=('SKIP')

pkgver() {
  cd annie
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | sed 's/^v//g'
  # Upstream adds a 'v' in its version since 0.11
}

build(){
    cd annie

    export CGO_CPPFLAGS="${CPPFLAGS}"
    export CGO_CFLAGS="${CFLAGS}"
    export CGO_CXXFLAGS="${CXXFLAGS}"
    export CGO_LDFLAGS="${LDFLAGS}"

    go build \
        -trimpath \
        -buildmode=pie \
        -mod=readonly \
        -modcacherw \
        -ldflags "-linkmode=external"

}

package() {
    cd annie
    install -Dm755 annie -t "$pkgdir/usr/bin"
    install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}