]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
Use PYTHON_SITEPACKAGES_DIR insted of hard-coded *site-packages*
authorMing Liu <peter.x.liu@external.atlascopco.com>
Tue, 9 Aug 2016 08:01:41 +0000 (10:01 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 17 Aug 2016 09:33:32 +0000 (10:33 +0100)
For thoese recipes that are inheriting python*-dir.bbclass, there is
already a PYTHON_SITEPACKAGES_DIR present, use that definition replacing
redundant "${libdir}/python*/site-packages".

Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb
meta/recipes-devtools/python/python-setuptools.inc
meta/recipes-devtools/python/python-setuptools_22.0.5.bb
meta/recipes-devtools/python/python-smartpm_git.bb
meta/recipes-devtools/python/python3-pip_8.1.2.bb
meta/recipes-devtools/python/python3-setuptools_22.0.5.bb
meta/recipes-devtools/rpm/rpm_5.4.16.bb
meta/recipes-kernel/lttng/lttng-tools_git.bb
meta/recipes-kernel/perf/perf.bb

index d0555c3edbe46f93c7f553b3038bec48d0a43a70..d039b1b94773e5c8142b5317fe5afae9243d0ac5 100644 (file)
@@ -134,7 +134,7 @@ do_install () {
 }
 
 PACKAGES =+ "pybootchartgui"
-FILES_pybootchartgui += "${libdir}/python*/site-packages/pybootchartgui ${bindir}/pybootchartgui"
+FILES_pybootchartgui += "${PYTHON_SITEPACKAGES_DIR}/pybootchartgui ${bindir}/pybootchartgui"
 RDEPENDS_pybootchartgui = "python3-pycairo python3-compression python3-image python3-textutils python3-shell python3-compression python3-codecs"
 RDEPENDS_${PN}_class-target += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit-pidof', 'procps', d)}"
 RDEPENDS_${PN}_class-target += "lsb"
index 53a514b14db36dc9d3a96d7882d87975f58172dd..92ca9a0028e361aca1808afb9848e0445733c11d 100644 (file)
@@ -17,5 +17,5 @@ UPSTREAM_CHECK_URI = "https://pypi.python.org/pypi/setuptools"
 S = "${WORKDIR}/${SRCNAME}-${PV}"
 
 do_install_prepend() {
-    install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages
+    install -d ${D}${PYTHON_SITEPACKAGES_DIR}
 }
index c1720392310032f51e13b92c108a4a234045cb39..526474c7ea5d555be94247ffdb3a993213c72b91 100644 (file)
@@ -7,7 +7,7 @@ DEPENDS_class-native += "python-native"
 
 inherit distutils
 
-DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${PYTHON_SITEPACKAGES_DIR}"
 
 RDEPENDS_${PN} = "\
   python-stringold \
index 668d171a58ab53a943b5ee5bd5eb6787011d085c..0c260482dfba5cf6974dc5c243b09f46eb1f9504 100644 (file)
@@ -56,41 +56,41 @@ inherit distutils
 
 do_install_append() {
    # We don't support the following items
-   rm -rf ${D}${libdir}/python*/site-packages/smart/backends/slack
-   rm -rf ${D}${libdir}/python*/site-packages/smart/backends/arch
-   rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt
+   rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/backends/slack
+   rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/backends/arch
+   rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/qt
 
    # Temporary, debian support in OE is missing the python module
-   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/aptchannelsync.py*
-   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/debdir.py*
-   rm -rf ${D}${libdir}/python*/site-packages/smart/backends/deb
+   rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/aptchannelsync.py*
+   rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/debdir.py*
+   rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/backends/deb
 
    # Disable automatic channel detection
-   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/detectsys.py*
+   rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/detectsys.py*
 
    # Disable landscape support
-   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/landscape.py*
+   rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/landscape.py*
 
    # Disable urpmi channel support
-   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/urpmichannelsync.py*
+   rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/urpmichannelsync.py*
 
    # Disable yum channel support
-   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/yumchannelsync.py*
+   rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/yumchannelsync.py*
 
    # Disable zypper channel support
-   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/zyppchannelsync.py*
+   rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/zyppchannelsync.py*
 
    if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'rpm', 'rpm', '', d)}" ]; then
-      rm -f ${D}${libdir}/python*/site-packages/smart/plugins/rpmdir.py*
-      rm -rf ${D}${libdir}/python*/site-packages/smart/backends/rpm
+      rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/rpmdir.py*
+      rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/backends/rpm
    fi
 
    if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'qt4', 'qt4', '', d)}" ]; then
-      rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt4
+      rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/qt4
    fi
 
    if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'gtk', '', d)}" ]; then
-      rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/gtk
+      rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/gtk
    fi
 }
 
@@ -130,10 +130,10 @@ RDEPENDS_${PN}-interface-gtk = "gtk+ ${PN}-interface-images"
 
 FILES_smartpm = "${bindir}/smart"
 
-FILES_${PN}-backend-rpm = "${libdir}/python*/site-packages/smart/backends/rpm"
+FILES_${PN}-backend-rpm = "${PYTHON_SITEPACKAGES_DIR}/smart/backends/rpm"
 
-FILES_${PN}-interface-qt4 = "${libdir}/python*/site-packages/smart/interfaces/qt4"
-FILES_${PN}-interface-gtk = "${libdir}/python*/site-packages/smart/interfaces/gtk"
+FILES_${PN}-interface-qt4 = "${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/qt4"
+FILES_${PN}-interface-gtk = "${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/gtk"
 FILES_${PN}-interface-images = "${datadir}/${baselib}/python*/site-packages/smart/interfaces/images"
 
 BBCLASSEXTEND = "native nativesdk"
index e319dff675649eddf1576f3dc6acd8ceef7ef55c..eefb4cb79608d85cf5c70d377c380eabc81e764a 100644 (file)
@@ -18,16 +18,16 @@ S = "${WORKDIR}/${SRCNAME}-${PV}"
 
 inherit distutils3
 
-DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${PYTHON_SITEPACKAGES_DIR}"
 
 do_install_prepend() {
-    install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages
+    install -d ${D}${PYTHON_SITEPACKAGES_DIR}
 }
 
 # Use setuptools site.py instead, avoid shared state issue
 do_install_append() {
-    rm ${D}/${libdir}/${PYTHON_DIR}/site-packages/site.py
-    rm ${D}/${libdir}/${PYTHON_DIR}/site-packages/__pycache__/site.cpython-*.pyc
+    rm ${D}${PYTHON_SITEPACKAGES_DIR}/site.py
+    rm ${D}${PYTHON_SITEPACKAGES_DIR}/__pycache__/site.cpython-*.pyc
 
     # Install as pip3 and leave pip2 as default
     rm ${D}/${bindir}/pip
index fb2931c3f2b6b200c8ea491e0ecd786e7772330b..65af6f0dadd11cb1f29d9c95844d3ab7478af820 100644 (file)
@@ -5,7 +5,7 @@ DEPENDS_class-native += "python3-native"
 
 inherit distutils3
 
-DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${PYTHON_SITEPACKAGES_DIR}"
 
 # The installer puts the wrong path in the setuptools.pth file.  Correct it.
 do_install_append() {
index d264d5011a92196d209a2bb21aead5a2dccc069d..84adef661ac68c2a42e3612fce84ee12d5ed32d8 100644 (file)
@@ -259,7 +259,7 @@ PACKAGECONFIG[xar] = "--with-xar,--without-xar,xar,"
 
 WITH_PYTHON = " --with-python=${PYTHON_BASEVERSION} \
                --with-python-inc-dir=${STAGING_INCDIR}/python${PYTHON_BASEVERSION} \
-               --with-python-lib-dir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \
+               --with-python-lib-dir=${PYTHON_SITEPACKAGES_DIR} \
                --without-pythonembed"
 PACKAGECONFIG[python] = "${WITH_PYTHON},--without-python,python,"
 
@@ -477,7 +477,7 @@ RDEPENDS_${PN}-build = "file bash perl"
 
 RDEPENDS_python-rpm = "${PN} python"
 
-FILES_python-rpm = "${libdir}/python*/site-packages/rpm"
+FILES_python-rpm = "${PYTHON_SITEPACKAGES_DIR}/rpm"
 PROVIDES += "python-rpm"
 
 FILES_perl-module-rpm = "${libdir}/perl/*/* \
@@ -512,7 +512,7 @@ FILES_${PN}-staticdev = " \
                ${libdir}/librpmmisc.a \
                ${libdir}/librpmbuild.a \
                ${libdir}/rpm/lib/liblua.a \
-               ${libdir}/python*/site-packages/rpm/*.a \
+               ${PYTHON_SITEPACKAGES_DIR}/rpm/*.a \
                "
 
 do_configure() {
@@ -581,10 +581,10 @@ do_install_append() {
        rm -f ${D}/${mandir}/man1/lz*.1
        rm -f ${D}/${libdir}/pkgconfig/liblzma*
 
-       rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.a
-       rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.la
-       rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.a
-       rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.la
+       rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/*.a
+       rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/*.la
+       rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/rpm/*.a
+       rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/rpm/*.la
 
        #find ${D}/${libdir}/perl5 -type f -a \( -name perllocal.pod -o -name .packlist \
        #       -o \( -name '*.bs' -a -empty \) \) -exec rm -f {} ';'
@@ -647,11 +647,11 @@ EOF
 }
 
 do_install_append_class-native () {
-       sed -i -e 's|^#!.*/usr/bin/python|#! /usr/bin/env nativepython|' ${D}/${libdir}/python2.7/site-packages/rpm/transaction.py
+       sed -i -e 's|^#!.*/usr/bin/python|#! /usr/bin/env nativepython|' ${D}${PYTHON_SITEPACKAGES_DIR}/rpm/transaction.py
 }
 
 do_install_append_class-nativesdk () {
-       sed -i -e 's|^#!.*/usr/bin/python|#! /usr/bin/env python|' ${D}/${libdir}/python2.7/site-packages/rpm/transaction.py
+       sed -i -e 's|^#!.*/usr/bin/python|#! /usr/bin/env python|' ${D}${PYTHON_SITEPACKAGES_DIR}/rpm/transaction.py
 }
 
 def multilib_rpmmacros(d):
index b0c369ce964a29b8917dd8c992458541e7b5ee40..fe1e2a31676bac890cd8fb95805812ad6a667ed3 100644 (file)
@@ -16,8 +16,8 @@ RDEPENDS_${PN}-ptest += "make perl bash"
 SRCREV = "a90f2c1e10b759782653a81815625e9d1bbb75ca"
 PV = "2.7.1+git${SRCPV}"
 
-PYTHON_OPTION = "am_cv_python_pyexecdir='${libdir}/python${PYTHON_BASEVERSION}/site-packages' \
-                 am_cv_python_pythondir='${libdir}/python${PYTHON_BASEVERSION}/site-packages' \
+PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \
+                 am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \
                  PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \
 "
 PACKAGECONFIG ??= "lttng-ust"
@@ -39,9 +39,9 @@ USERADD_PACKAGES = "${PN}"
 GROUPADD_PARAM_${PN} = "tracing"
 
 FILES_${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \
-                ${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
-FILES_${PN}-staticdev += "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.a"
-FILES_${PN}-dev += "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.la"
+                ${PYTHON_SITEPACKAGES_DIR}/*"
+FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
+FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la"
 
 # Since files are installed into ${libdir}/lttng/libexec we match 
 # the libexec insane test so skip it.
index 1e84a2231b825f1700a3f4e2b3ae6051285f1b46..d4855488aeb00fa05003a5c40986abfe7b1d061c 100644 (file)
@@ -217,7 +217,7 @@ RSUGGESTS_${PN} += "${PN}-archive ${PN}-tests ${RSUGGESTS_SCRIPTING}"
 FILES_${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core ${libdir}/traceevent"
 FILES_${PN}-archive = "${libdir}/perf/perf-core/perf-archive"
 FILES_${PN}-tests = "${libdir}/perf/perf-core/tests ${libexecdir}/perf-core/tests"
-FILES_${PN}-python = "${libdir}/python*/site-packages ${libdir}/perf/perf-core/scripts/python"
+FILES_${PN}-python = "${libdir}/perf/perf-core/scripts/python ${PYTHON_SITEPACKAGES_DIR}"
 FILES_${PN}-python += "${libexecdir}/perf-core/scripts/python/*"
 FILES_${PN}-perl = "${libdir}/perf/perf-core/scripts/perl"