diff options
author | Sven Ebenfeld <sven.ebenfeld@gmail.com> | 2016-01-22 23:08:46 +0100 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2016-02-01 15:51:15 +0100 |
commit | 1ec43c1e4f379ef5806268aa80ce8487388ab00c (patch) | |
tree | a7114429cf96419d47a1d523f889593fa3173869 /meta-python/classes | |
parent | f596306bca9b4226fbb9769787742780692fbc33 (diff) | |
download | meta-openembedded-1ec43c1e4f379ef5806268aa80ce8487388ab00c.tar.gz |
add pypi3 bbclass to make python3 recipe creation easier as well
Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
Diffstat (limited to 'meta-python/classes')
-rw-r--r-- | meta-python/classes/pypi-common.bbclass | 21 | ||||
-rw-r--r-- | meta-python/classes/pypi.bbclass | 22 | ||||
-rw-r--r-- | meta-python/classes/pypi3.bbclass | 1 |
3 files changed, 23 insertions, 21 deletions
diff --git a/meta-python/classes/pypi-common.bbclass b/meta-python/classes/pypi-common.bbclass new file mode 100644 index 000000000..365002ec0 --- /dev/null +++ b/meta-python/classes/pypi-common.bbclass | |||
@@ -0,0 +1,21 @@ | |||
1 | def pypi_package(d): | ||
2 | bpn = d.getVar('BPN', True) | ||
3 | if bpn.startswith('python-'): | ||
4 | return bpn[7:] | ||
5 | elif bpn.startswith('python3-'): | ||
6 | return bpn[8:] | ||
7 | return bpn | ||
8 | |||
9 | PYPI_PACKAGE ?= "${@pypi_package(d)}" | ||
10 | |||
11 | def pypi_src_uri(d): | ||
12 | package = d.getVar('PYPI_PACKAGE', True) | ||
13 | pv = d.getVar('PV', True) | ||
14 | return 'https://pypi.python.org/packages/source/%s/%s/%s-%s.tar.gz' % (package[0], package, package, pv) | ||
15 | |||
16 | PYPI_SRC_URI ?= "${@pypi_src_uri(d)}" | ||
17 | |||
18 | HOMEPAGE ?= "https://pypi.python.org/pypi/${PYPI_PACKAGE}/" | ||
19 | SECTION = "devel/python" | ||
20 | SRC_URI += "${PYPI_SRC_URI}" | ||
21 | S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}" | ||
diff --git a/meta-python/classes/pypi.bbclass b/meta-python/classes/pypi.bbclass index 41a70e25c..8d8350a2b 100644 --- a/meta-python/classes/pypi.bbclass +++ b/meta-python/classes/pypi.bbclass | |||
@@ -1,21 +1 @@ | |||
1 | def pypi_package(d): | inherit pypi-common setuptools | |
2 | bpn = d.getVar('BPN', True) | ||
3 | if bpn.startswith('python-'): | ||
4 | return bpn[7:] | ||
5 | return bpn | ||
6 | |||
7 | PYPI_PACKAGE ?= "${@pypi_package(d)}" | ||
8 | |||
9 | def pypi_src_uri(d): | ||
10 | package = d.getVar('PYPI_PACKAGE', True) | ||
11 | pv = d.getVar('PV', True) | ||
12 | return 'https://pypi.python.org/packages/source/%s/%s/%s-%s.tar.gz' % (package[0], package, package, pv) | ||
13 | |||
14 | PYPI_SRC_URI ?= "${@pypi_src_uri(d)}" | ||
15 | |||
16 | HOMEPAGE ?= "https://pypi.python.org/pypi/${PYPI_PACKAGE}/" | ||
17 | SECTION = "devel/python" | ||
18 | SRC_URI += "${PYPI_SRC_URI}" | ||
19 | S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}" | ||
20 | |||
21 | inherit setuptools | ||
diff --git a/meta-python/classes/pypi3.bbclass b/meta-python/classes/pypi3.bbclass new file mode 100644 index 000000000..e0f7bb36e --- /dev/null +++ b/meta-python/classes/pypi3.bbclass | |||
@@ -0,0 +1 @@ | |||
inherit pypi-common setuptools3 | |||