[gnome-continuous-yocto/gnomeostree-3.28-rocko: 574/8267] python3-dir.bbclass: add a separate class for Python 3
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 574/8267] python3-dir.bbclass: add a separate class for Python 3
- Date: Sat, 16 Dec 2017 20:37:04 +0000 (UTC)
commit 03da683a55582a05154104abf986678f3d578a6c
Author: Alexander Kanavin <alexander kanavin linux intel com>
Date: Mon Apr 25 15:57:59 2016 +0300
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.
(From OE-Core rev: 3891fcec863602a0ae6d0f3d305ea50a79a205d9)
Signed-off-by: Alexander Kanavin <alexander kanavin linux intel com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
meta/classes/distutils-common-base.bbclass | 2 --
meta/classes/distutils3-base.bbclass | 3 ---
meta/classes/python-dir.bbclass | 6 +++---
meta/classes/python3-dir.bbclass | 5 +++++
meta/classes/python3native.bbclass | 4 +---
5 files changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/meta/classes/distutils-common-base.bbclass b/meta/classes/distutils-common-base.bbclass
index 08511f5..dee06b4 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 2a093d3..82ab6a3 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 ebfa4b3..a11dc35 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 0000000..06bb046
--- /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 8ec6b76..1899863 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"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]