mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2025-12-15 06:45:32 +01:00
add pypi3 bbclass to make python3 recipe creation easier as well
Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
This commit is contained in:
parent
f596306bca
commit
1ec43c1e4f
21
meta-python/classes/pypi-common.bbclass
Normal file
21
meta-python/classes/pypi-common.bbclass
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
def pypi_package(d):
|
||||
bpn = d.getVar('BPN', True)
|
||||
if bpn.startswith('python-'):
|
||||
return bpn[7:]
|
||||
elif bpn.startswith('python3-'):
|
||||
return bpn[8:]
|
||||
return bpn
|
||||
|
||||
PYPI_PACKAGE ?= "${@pypi_package(d)}"
|
||||
|
||||
def pypi_src_uri(d):
|
||||
package = d.getVar('PYPI_PACKAGE', True)
|
||||
pv = d.getVar('PV', True)
|
||||
return 'https://pypi.python.org/packages/source/%s/%s/%s-%s.tar.gz' % (package[0], package, package, pv)
|
||||
|
||||
PYPI_SRC_URI ?= "${@pypi_src_uri(d)}"
|
||||
|
||||
HOMEPAGE ?= "https://pypi.python.org/pypi/${PYPI_PACKAGE}/"
|
||||
SECTION = "devel/python"
|
||||
SRC_URI += "${PYPI_SRC_URI}"
|
||||
S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}"
|
||||
|
|
@ -1,21 +1 @@
|
|||
def pypi_package(d):
|
||||
bpn = d.getVar('BPN', True)
|
||||
if bpn.startswith('python-'):
|
||||
return bpn[7:]
|
||||
return bpn
|
||||
|
||||
PYPI_PACKAGE ?= "${@pypi_package(d)}"
|
||||
|
||||
def pypi_src_uri(d):
|
||||
package = d.getVar('PYPI_PACKAGE', True)
|
||||
pv = d.getVar('PV', True)
|
||||
return 'https://pypi.python.org/packages/source/%s/%s/%s-%s.tar.gz' % (package[0], package, package, pv)
|
||||
|
||||
PYPI_SRC_URI ?= "${@pypi_src_uri(d)}"
|
||||
|
||||
HOMEPAGE ?= "https://pypi.python.org/pypi/${PYPI_PACKAGE}/"
|
||||
SECTION = "devel/python"
|
||||
SRC_URI += "${PYPI_SRC_URI}"
|
||||
S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}"
|
||||
|
||||
inherit setuptools
|
||||
inherit pypi-common setuptools
|
||||
|
|
|
|||
1
meta-python/classes/pypi3.bbclass
Normal file
1
meta-python/classes/pypi3.bbclass
Normal file
|
|
@ -0,0 +1 @@
|
|||
inherit pypi-common setuptools3
|
||||
Loading…
Reference in New Issue
Block a user