summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c6f154547b38b853f5bc706b2140f8dec820f8af (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
#Maintainer: Kimiblock Moe

pkgname=tdl-git
pkgver=r665.f46f64c
pkgrel=1
pkgdesc="A Telegram downloader/tools written in Golang"
arch=("any")
url="https://github.com/iyear/tdl"
license=("AGPL-3.0-or-later")
depends=()
makedepends=('go' 'git')
conflicts=('tdl')
backup=()
source=("git+https://github.com/iyear/tdl.git")
sha256sums=('SKIP')
provides=("tdl")

function pkgver() {
	cd "${srcdir}/tdl"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

function prepare() {
	cd "${srcdir}/tdl"
}

function build() {
	cd "${srcdir}/tdl"
	go build -trimpath -buildmode=pie -mod=readonly -modcacherw -ldflags "-linkmode external -extldflags \"${LDFLAGS}\""
}

#function check() {
#	cd "${srcdir}/tdl"
#	go test ./...
#}

function package() {
	install -Dm755 "${srcdir}/tdl/tdl" "${pkgdir}/usr/bin/tdl"
}