aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-pip/APKBUILD
blob: 4c05fb0d1a780b7e5efee2830c352be4f04af309 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-pip
_pkgname=pip
pkgver=20.0.2
pkgrel=2
pkgdesc="Tool for installing and managing Python packages"
options="!check" # Requires pytest
url="http://www.pip-installer.org"
arch="noarch"
license="MIT"
depends="
	python3
	py3-appdirs
	py3-cachecontrol
	py3-colorama
	py3-distlib
	py3-distro
	py3-html5lib
	py3-msgpack
	py3-packaging
	py3-pep517
	py3-progress
	py3-parsing
	py3-pytoml
	py3-requests
	py3-retrying
	py3-setuptools
	py3-six
	py3-webencodings
	py3-contextlib2
	"
makedepends="
	py3-sphinx
	"
subpackages="
	$pkgname-doc
	$pkgname-zsh-completion:zshcomp:noarch
	$pkgname-bash-completion:bashcomp:noarch
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/pypa/pip/archive/$pkgver.tar.gz
	https://github.com/pypa/pip/commit/9be7454fd69081d06a3f8234a08a6d791e13173f.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"

provides="py-pip=$pkgver-r$pkgrel" # Backwards compatibility
replaces="py-pip" # Backwards compatibility

prepare() {
	default_prepare

	# Remove certifi usage
	sed -i 's|from pip._vendor.certifi import where|where = lambda: "/etc/ssl/certs/ca-certificates.crt"|' src/pip/_internal/commands/debug.py

	for f in src/pip/_vendor/*; do
		if [ "${f##*/}" = __init__.py ]; then
			continue
		fi
		rm -rf "$f"
	done
	sed -i -e 's/DEBUNDLED = False/DEBUNDLED = True/' src/pip/_vendor/__init__.py
}

build() {
	python3 setup.py build

	# Build manpage
	cd docs/
	PYTHONPATH="$srcdir/pip-$pkgver/src/" sphinx-build -W -b man -d build/doctrees/man man build/man -c html
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	install -Dm644 docs/build/man/* -t "$pkgdir"/usr/share/man/man1

	PYTHONPATH="$pkgdir"/usr/lib/python3.8/site-packages "$pkgdir"/usr/bin/pip \
		completion --bash | \
		install -Dm644 /dev/stdin "$pkgdir"/usr/share/bash-completion/completions/pip

	PYTHONPATH="$pkgdir"/usr/lib/python3.8/site-packages "$pkgdir"/usr/bin/pip \
		completion --zsh | \
		install -Dm644 /dev/stdin "$pkgdir"/usr/share/zsh/site-functions/_pip
}

bashcomp() {
	depends=""
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	amove usr/share/bash-completion/completions
}

zshcomp() {
	depends=""
	pkgdesc="Zsh completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel zsh"

	amove usr/share/zsh/site-functions
}

sha512sums="f9965944ca0f319d01db1638ce97cf64772afff1778b3b1271155de73208cfcb3954d89a469c1143c0bf3288a53d4446165a49df994374b16ac6f7ffdae85857  py3-pip-20.0.2.tar.gz
61732786303ca7ec7828d04099a884534034d50cdd9a7a0de2ace34c28381a992943880f03797a64d5d4f3a76d317d356f76ffff5e3ffd97ed611b234cc05528  9be7454fd69081d06a3f8234a08a6d791e13173f.patch"