-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPKGBUILD
115 lines (110 loc) · 2.04 KB
/
PKGBUILD
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
104
105
106
107
108
109
110
111
112
113
114
115
# SPDX-License-Identifier: AGPL-3.0
#
# Maintainer: Pellegrino Prevete (tallero) <pellegrinoprevete@gmail.com>
# Maintainer: Truocolo <truocolo@aol.com>
_offline="false"
_py="python"
_pyver="$( \
"${_py}" \
-V | \
awk \
'{print $2}')"
_pymajver="${_pyver%.*}"
_pyminver="${_pymajver#*.}"
_pynextver="${_pymajver%.*}.$(( \
${_pyminver} + 1))"
_pkg=propcache
pkgname="${_py}-${_pkg}"
pkgver=0.2.1
_commit="726b8989e792a463d1eed8ded51128d457736a93"
pkgrel=1
_pkgdesc=(
"Fast implementation of cached"
"properties for Python 3.8+"
)
arch=(
'any'
)
license=(
'Apache-2.0'
)
_http="https://github.com"
# _ns="aio-libs"
_ns="themartiancompany"
url="${_http}/${_ns}/${_pkg}"
depends=(
"${_py}>=${_pymajver}"
"${_py}<${_pynextver}"
)
makedepends=(
'git'
"cython"
"${_py}-build"
"${_py}-expandvars"
"${_py}-flit-core"
"${_py}-installer"
"${_py}-poetry-core"
"${_py}-pyproject-hooks"
"${_py}-setuptools"
"${_py}-sphinx"
"${_py}-tomli"
"towncrier"
)
checkdepends=(
"${_py}-pytest"
)
_tag_name="commit"
# _tag_name="tag"
_tag="${_commit}"
# _tag="v${pkgver}"
_src="git+${url}.git#${_tag_name}=${_tag}"
if [[ "${_offline}" == true ]]; then
_src="git+file://${HOME}/${_pkg}#${_tag_name}=${_tag}"
fi
source=(
"${_src}"
)
sha512sums=(
'SKIP'
)
build() {
cd \
"${_pkg}"
# export \
# PYTHONPATH="$(pwd)/packaging:$(pwd)/packaging/pep517_backend:${PYTHONPATH}"
# cp \
# -r \
# 'packaging/pep517_backend/'* \
# "packaging"
# PYTHONPATH="$(pwd)/packaging:${PYTHONPATH}" \
"${_py}" \
-m \
build \
-nw
}
check() {
cd \
"${_pkg}"
"${_py}" \
-m installer
--destdir=tmp_install \
dist/*.whl
# I am starting to think we should generate
# python packages automatically
PYTHONPATH="$PWD/tmp_install/usr/lib/python${_pymajver}/site-packages" \
pytest
}
package() {
cd \
"${_pkg}"
"${_py}" \
-m installer \
--destdir="${pkgdir}" \
dist/*.whl
install \
-Dm644 \
LICENSE \
-t \
"${pkgdir}/usr/share/licenses/${pkgname}/"
}
# vim:set sw=2 sts=-1 et: