summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>2016-04-25 15:57:59 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-30 22:47:14 +0100
commit3891fcec863602a0ae6d0f3d305ea50a79a205d9 (patch)
tree95177438a0b3090f2351e62d97fc855ee9ae5398
parent5a149a051f91404b736a7c93b4b864f206cc7b1b (diff)
downloadopenembedded-core-3891fcec863602a0ae6d0f3d305ea50a79a205d9.tar.gz
openembedded-core-3891fcec863602a0ae6d0f3d305ea50a79a205d9.tar.bz2
openembedded-core-3891fcec863602a0ae6d0f3d305ea50a79a205d9.zip
python3-dir.bbclass: add a separate class for Python 3
This is much cleaner than sharing python-dir.bbclass between python 2 and 3 classes, and doing confusing overrides in them. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
-rw-r--r--meta/classes/distutils-common-base.bbclass2
-rw-r--r--meta/classes/distutils3-base.bbclass3
-rw-r--r--meta/classes/python-dir.bbclass6
-rw-r--r--meta/classes/python3-dir.bbclass5
-rw-r--r--meta/classes/python3native.bbclass4
5 files changed, 9 insertions, 11 deletions
diff --git a/meta/classes/distutils-common-base.bbclass b/meta/classes/distutils-common-base.bbclass
index 08511f59cc..dee06b4173 100644
--- a/meta/classes/distutils-common-base.bbclass
+++ b/meta/classes/distutils-common-base.bbclass
@@ -1,5 +1,3 @@
-inherit python-dir
-
EXTRA_OEMAKE = ""
export STAGING_INCDIR
diff --git a/meta/classes/distutils3-base.bbclass b/meta/classes/distutils3-base.bbclass
index 2a093d3a8c..82ab6a3d1c 100644
--- a/meta/classes/distutils3-base.bbclass
+++ b/meta/classes/distutils3-base.bbclass
@@ -1,8 +1,5 @@
DEPENDS += "${@["${PYTHON_PN}-native ${PYTHON_PN}", ""][(d.getVar('PACKAGES', True) == '')]}"
RDEPENDS_${PN} += "${@['', '${PYTHON_PN}-core']['${CLASSOVERRIDE}' == 'class-target']}"
-PYTHON_BASEVERSION = "3.5"
-PYTHON_ABI = "m"
-
inherit distutils-common-base python3native
diff --git a/meta/classes/python-dir.bbclass b/meta/classes/python-dir.bbclass
index ebfa4b30f6..a11dc350be 100644
--- a/meta/classes/python-dir.bbclass
+++ b/meta/classes/python-dir.bbclass
@@ -1,5 +1,5 @@
-PYTHON_BASEVERSION ?= "2.7"
-PYTHON_ABI ?= ""
+PYTHON_BASEVERSION = "2.7"
+PYTHON_ABI = ""
PYTHON_DIR = "python${PYTHON_BASEVERSION}"
-PYTHON_PN = "python${@'' if '${PYTHON_BASEVERSION}'.startswith('2') else '3'}"
+PYTHON_PN = "python"
PYTHON_SITEPACKAGES_DIR = "${libdir}/${PYTHON_DIR}/site-packages"
diff --git a/meta/classes/python3-dir.bbclass b/meta/classes/python3-dir.bbclass
new file mode 100644
index 0000000000..06bb046d9c
--- /dev/null
+++ b/meta/classes/python3-dir.bbclass
@@ -0,0 +1,5 @@
+PYTHON_BASEVERSION = "3.5"
+PYTHON_ABI = "m"
+PYTHON_DIR = "python${PYTHON_BASEVERSION}"
+PYTHON_PN = "python3"
+PYTHON_SITEPACKAGES_DIR = "${libdir}/${PYTHON_DIR}/site-packages"
diff --git a/meta/classes/python3native.bbclass b/meta/classes/python3native.bbclass
index 8ec6b769da..18998636b4 100644
--- a/meta/classes/python3native.bbclass
+++ b/meta/classes/python3native.bbclass
@@ -1,6 +1,4 @@
-PYTHON_BASEVERSION = "3.5"
-
-inherit python-dir
+inherit python3-dir
PYTHON="${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}"
EXTRANATIVEPATH += "${PYTHON_PN}-native"