summaryrefslogtreecommitdiff
path: root/main/py3-setuptools/APKBUILD
blob: 1103a0f3162bd82e28a1b7d0e26a331eb4721c5f (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
# Contributor: Andrew Manison <amanison@anselsystems.com>
# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: psykose <alice@ayaya.dev>
pkgname=py3-setuptools
_pkgname=${pkgname#py3-}
pkgver=65.6.0
pkgrel=1
pkgdesc="Collection of enhancements to the Python3 distutils"
options="!check" # Tests require packages out of main/
url="https://pypi.python.org/pypi/setuptools"
arch="noarch"
license="MIT"
# everything is vendored
depends="
	py3-packaging
	python3
	"
# depends="
# 	py3-appdirs
# 	py3-more-itertools
# 	py3-ordered-set
# 	py3-packaging
# 	py3-parsing
# 	python3
# 	"
makedepends="py3-setuptools-stage0"
source="$_pkgname-$pkgver.tar.gz::https://github.com/pypa/$_pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

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

# py3-setuptools needs itself to build, bootstrapped with a lower version
# in main/py3-setuptools-stage0
provides="$provides py3-setuptools-bootstrap"
provider_priority=100 # highest

export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0

prepare() {
	default_prepare

	# Unbundle
	# rm -rf pkg_resources/extern pkg_resources/_vendor \
	# 	setuptools/extern setuptools/_vendor

	# Upstream devendoring logic is badly broken, see:
	# https://bugs.archlinux.org/task/58670
	# https://github.com/pypa/pip/issues/5429
	# https://github.com/pypa/setuptools/issues/1383
	# The simplest fix is to simply rewrite import paths to use the canonical
	# location in the first place
	# for _module in setuptools pkg_resources '' ; do
	# 	find . -name \*.py -exec sed -i \
	# 		-e 's/from '$_module.extern' import/import/' \
	# 		-e 's/from '$_module.extern'./from /' \
	# 		-e 's/import '$_module.extern'./import /' \
	# 		-e "s/__import__('$_module.extern./__import__('/" \
	# 		{} +
	# done

	# Fix post-release tag
	sed -e '/tag_build = .post/d' \
		-e '/tag_date = 1/d' \
		-i setup.cfg
}

build() {
	python3 setup.py build
}

package() {
	# Otherwise it complains that build/scripts-3.10 cannot be found
	# no other changes noted
	mkdir -p build/scripts-3.11

	python3 setup.py install --root="$pkgdir" --skip-build
}

sha512sums="
4ee08da80b7357adfaaf37b3164ae41841ec3ed0220541f33e870f8f188e5c499e28807d864c1bca3d4257ab0bf53c7a7b09f8224133d44099c61971b36129c8  setuptools-65.6.0.tar.gz
"