summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 16acecf940465f260a041190775281006b8e945c (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: relrel <relrelbachar@gmail.com>
# Contributor: Luis Aranguren <pizzaman@hotmail.com>
# Contributor: Adrian Perez <aperez@igalia.com>
# Contributor: Chih-Hsuan Yen <yan12125@gmail.com>
# Contributor: rway <rway07@gmail.com>
# Contributor: wabi <aschrafl@jetnet.ch>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Andreas Schrafl <aschrafl@gmail.com>
# Contributor: piojo <aur@zwell.net>
# Contributor: hack.augusto <hack.augusto@gmail.com>
# Contributor: Rustmilian <Rustmilian@proton.me>

pkgname=depot-tools-git
pkgver=r9435.249e9a26c
pkgrel=1
pkgdesc='Tools for working with Chromium development'
arch=(x86_64)
url='https://chromium.googlesource.com/chromium/tools/depot_tools'
license=(custom)
depends=(git glibc python java-runtime)
install="$pkgname.install"
source=("git+$url.git")
sha512sums=('SKIP')

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

package() {
	install -d "$pkgdir/opt/"
	cp -r "$srcdir/depot_tools/" "$pkgdir/opt/depot_tools/"
	chmod 775 "$pkgdir/opt/depot_tools/"
	# Remove Git
	rm -rf "${pkgdir}/opt/depot_tools/"{.git,.gitignore,.gitattributes}
	# Remove Windows
	rm -r "${pkgdir}/opt/depot_tools/"{*.bat,win32imports.py,win_toolchain}
	# Remove Misc
	rm -r "${pkgdir}/opt/depot_tools/"{bootstrap,infra,testing_support,tests,OWNERS,WATCHLISTS}

	# Install license
	install -d "$pkgdir/usr/share/licenses/$pkgname/"
	mv "$pkgdir/opt/depot_tools/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/"

	# Install man pages
	install -d "$pkgdir/usr/share/man/"
	mv "$pkgdir/opt/depot_tools/man/"man[0-8]/ "$pkgdir/usr/share/man/"

	# Install docs
	install -d "$pkgdir/usr/share/doc/$pkgname/"
	mv "$pkgdir/opt/depot_tools/man/html/" "$pkgdir/usr/share/doc/$pkgname/"
	mv "$pkgdir/opt/depot_tools/"README* "$pkgdir/usr/share/doc/$pkgname/"

	# Remove man/ leftovers
	rm -r "$pkgdir/opt/depot_tools/man/"

	# Install bash completions
	install -Dm0644 "$pkgdir/opt/depot_tools/gclient_completion.sh" "$pkgdir/usr/share/bash-completion/completions/gclient"
	install -Dm0644 "$pkgdir/opt/depot_tools/git_cl_completion.sh" "$pkgdir/usr/share/bash-completion/completions/git-cl"

	# Install zsh completions
	install -Dm0644 -t "$pkgdir/usr/share/zsh/site-functions/" "$pkgdir/opt/depot_tools/zsh-goodies/_gclient"
}