summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 47e24c519d8bdf4c79d7da63b76e18f1b455b64a (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: Deposite Pirate <dpirate@metalpunks.info>
#
# Upstream: https://git.metalpunks.info/arch-ports

_pkgname=youtube
pkgname=youtubedr
pkgver=2.10.1
pkgrel=1
pkgdesc="Download YouTube videos"
arch=('x86_64')
url="https://github.com/kkdai/youtube"
license=('MIT')
depends=('glibc')
makedepends=('go' 'git')
source=("git+$url#tag=v$pkgver")
sha256sums=('SKIP')

build() {
  cd "${srcdir}/${_pkgname}"
  GOOS=linux GOARCH=amd64 \
  CGO_CPPFLAGS="${CPPFLAGS}" \
  CGO_CFLAGS="${CFLAGS}" \
  CGO_CXXFLAGS="${CXXFLAGS}" \
  go build -v \
    -trimpath \
    -buildmode=pie \
    -mod=readonly \
    -modcacherw \
    -ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
    -o build ./cmd/...
}

check() {
  cd "${srcdir}/${_pkgname}"
  #go test
}

package() {
  cd "${srcdir}/${_pkgname}"
  install -Dm755 build "$pkgdir/usr/bin/${pkgname}"
  install -Dm644 README.md "$pkgdir/usr/share/doc/${pkgname}/README.md"
}