Skip to contentSkip to conversation

fix buildpaths QA issue

PATCH Superseded Hongxu Jia 2 participants 22 messages Mar 10, 2016

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

v2 cover fix buildpaths QA issue

Changed in V2:
- As Ross suggested, improve waf.bbclass and use it for python-pycairo, and use ${bindir}/python rather than \which python\ for python-pygobject.

- As Richard suggested, drop 'buildpaths QA ignore pattern', always try to fix them rather than ignore them.

- For openssl fix, remove build path rather than use TOPDIR to replace.

- Add new build path fixes

//Hongxu

Introduce buildpaths QA issue

1. Exist in ELF files DWARF (debugging information) gcc compiled with '-g' option.

Solutions:
Add option '-fdebug-prefix-map' to translate build path to target path. Make sure use option ${DEBUG_FLAGS} to compile

2. Exist in ELF files section .rodata (Read-only data) '__FILE__' is used in C/C++ source/header files.

1) If '__FILE__' exists in source file, use relative path to compile. gcc /absolute_dir/test.c -o test --> gcc ../relative_dir/test.c -o test

Solutions:
- Use relative path to run configure.

- Improve python distutils module to use relative path to compile C/C++ source file

- Improve cmake-native which generate Makefile to use relative path to compile C/C++ source file

2) TODO: If '__FILE__' exists in header file. No way?(Need to improve gcc?)

3) If $CFLAGS, $CC which has build paths exists in source file, fix them before compiling

3. Exist in ANSII Text files (Makefile/Configure) Solution:
- Process the text files to translate build path to target path

- Directly remove build path without side effect.
Such as removing --sysroot and -fdebug-prefix-map in Makefile is no harm.

4. Exist in python compiled file (Python bytecode, .pyc/.pyo) Invoke python with absolute dir.
python -m py_compile /absolute_dir/test.py

Solution:
- Improve distutils, get the "--root" directory supplied to the "install" command, and use it as a prefix to strip off the purported filename encoded in bytecode files.

- Manually update specific bytecode file by invoking py_compile module. py_compile.compile(file, cfile=None, dfile=None, doraise=False), use target path for 'dfile'

Apply these patches and build a world, there are still 56 recipes in oe-core that has buildpaths QA issue. And most of them could be fixed by above solutions.

//Hongxu

The following changes since commit d53413d3a8444c38a83ea37867c8af7754d8e702:

bitbake: server/process: Try connecting 4 times before giving up (2016-03-09 22:47:29 +0000)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib hongxu/fix-buildpath
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=hongxu/fix-buildpath

Hongxu Jia (18):
fix_buildpaths.bbclass: add bbclass to fix build path python2/3: fix buildpath QA issue
bbclass distutils/distutils3: fix .pyc/.pyo buildpath bbclass distutils/distutils3/setuptools/setuptools3: clean up
DISTUTILS_INSTALL_ARGS
python-setuptools/python3-setuptools: use old-style install
python3-pip: use old-style install
python-pygobject: fix buildpath QA issue
python-numpy: fix buildpaths QA issue
waf.bbclass: support do patch on extracted files
python-pycairo: fix buildpath QA issue
valgrind: fix buildpath QA issue
dtc.inc: fix buildpaths QA issue
epiphany: fix buildpaths QA issue
gconf: fix buildpaths QA issue
icu: fix buildpaths QA issue
tcl: fix buildpath QA issue
openssl: fix buildpath QA issue cmake-native:convert source file to relative path

 meta/classes/distutils.bbclass                     |   8 +-
 meta/classes/distutils3.bbclass                    |   8 +-
 meta/classes/fix_buildpaths.bbclass                |  44 +++++++
 meta/classes/setuptools.bbclass                    |   5 -
 meta/classes/setuptools3.bbclass                   |   5 -
 meta/classes/waf.bbclass                           |  11 +-
 .../openssl/remove-build-path-in-source-code.patch |  44 +++++++
 .../recipes-connectivity/openssl/openssl_1.0.2g.bb |   7 ++
 meta/recipes-devtools/cmake/cmake-native_3.4.3.bb  |   1 +
 .../convert-source-file-to-relative-path.patch     | 128 +++++++++++++++++++++
 .../remove-build-path-in-comments.patch            |  30 +++++
 .../recipes-devtools/python/python-numpy_1.10.4.bb |   1 +
 ...trip-off-build-path-in-purported-filename.patch |  62 ++++++++++
 .../python/python-pycairo_1.10.0.bb                |  25 +---
 .../python/python-pygobject_2.28.3.bb              |   5 +
 .../python/python-setuptools_19.4.bb               |   2 -
 .../use-relative-path-to-compile-source-file.patch |  31 +++++
 meta/recipes-devtools/python/python3-pip_8.0.0.bb  |  12 --
 .../python/python3-setuptools_19.4.bb              |   8 +-
 .../use-relative-path-to-compile-source-file.patch |  31 +++++
 meta/recipes-devtools/python/python3_3.5.1.bb      |  21 +++-
 meta/recipes-devtools/python/python_2.7.11.bb      |  28 ++++-
 .../tcltk/tcl/use-relative-path-to-compile.patch   |  52 +++++++++
 meta/recipes-devtools/tcltk/tcl_8.6.4.bb           |  10 +-
 meta/recipes-devtools/valgrind/valgrind_3.11.0.bb  |   5 +-
 meta/recipes-gnome/epiphany/epiphany_3.18.4.bb     |   8 +-
 .../files/use-relative-path-for-build-dir.patch    |  57 +++++++++
 meta/recipes-gnome/gnome/gconf/gconf.path          |   6 +
 .../gnome/gconf/use-target-path-for-debug.patch    |  31 +++++
 meta/recipes-gnome/gnome/gconf_3.2.6.bb            |  12 ++
 meta/recipes-kernel/dtc/dtc.inc                    |   3 +-
 .../dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch       |  30 +++++
 .../icu/icu/add-variable-U_CC-and-U_CXX.patch      |  61 ++++++++++
 meta/recipes-support/icu/icu_56.1.bb               |  12 ++
 34 files changed, 732 insertions(+), 72 deletions(-)
 create mode 100644 meta/classes/fix_buildpaths.bbclass
 create mode 100644 meta/recipes-connectivity/openssl/openssl/remove-build-path-in-source-code.patch
 create mode 100644 meta/recipes-devtools/cmake/cmake/convert-source-file-to-relative-path.patch
 create mode 100644 meta/recipes-devtools/python/python-numpy/remove-build-path-in-comments.patch
 create mode 100644 meta/recipes-devtools/python/python-pycairo/strip-off-build-path-in-purported-filename.patch
 create mode 100644 meta/recipes-devtools/python/python/use-relative-path-to-compile-source-file.patch
 create mode 100644 meta/recipes-devtools/python/python3/use-relative-path-to-compile-source-file.patch
 create mode 100644 meta/recipes-devtools/tcltk/tcl/use-relative-path-to-compile.patch
 create mode 100644 meta/recipes-gnome/epiphany/files/use-relative-path-for-build-dir.patch
 create mode 100644 meta/recipes-gnome/gnome/gconf/gconf.path
 create mode 100644 meta/recipes-gnome/gnome/gconf/use-target-path-for-debug.patch
 create mode 100644 meta/recipes-kernel/dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch
 create mode 100644 meta/recipes-support/icu/icu/add-variable-U_CC-and-U_CXX.patch
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v2 1/18 fix_buildpaths.bbclass: add bbclass to fix build path

Define variable PACKAGE_BUILDPATH_TEXT_FILES to list files that have build paths and remove these paths at do_package time.

Define variable PACKAGE_BUILDPATH_TEXT_PATTERNS to list build path patterns, which used by sed, it removes --sysroot and -fdebug-prefix-map in text files by default.

Define python function to remove build path in variable.

Define python function to remove build path in python compiled code.

[YOCTO #9169]

---
 meta/classes/fix_buildpaths.bbclass | 44 +++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 meta/classes/fix_buildpaths.bbclass
meta/classes/fix_buildpaths.bbclass new file +44 -0
new file mode 100644
index 0000000..49dbf11
@@ -0,0 +1,44 @@
+PACKAGE_PREPROCESS_FUNCS += "${@base_conditional('PACKAGE_BUILDPATH_TEXT_FILES','', '', 'remove_buildpath_package_preprocess', d)}"
+remove_buildpath_package_preprocess () {
+	# Remove build paths in text files
+	for file in ${PACKAGE_BUILDPATH_TEXT_FILES};do
+		sed -i ${PACKAGE_BUILDPATH_TEXT_PATTERNS} ${PKGD}$file
+	done
+}
+
+# List build path patterns, which used by sed, it removes
+# --sysroot and -fdebug-prefix-map by default.
+PACKAGE_BUILDPATH_TEXT_PATTERNS = " \
+    -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \
+    -e 's:-fdebug-prefix-map=${B}=/usr/src/${BPN}::g' \
+    -e 's:-fdebug-prefix-map=${S}=/usr/src/${BPN}::g' \
+    -e 's:-fdebug-prefix-map=${STAGING_DIR_NATIVE}=::g' \
+    -e 's:-fdebug-prefix-map=${STAGING_DIR_HOST}=::g' \
+"
+
+# List files which have build paths, and remove these paths.
+PACKAGE_BUILDPATH_TEXT_FILES ??= ""
+
+# Remove build path in variable
+def remove_buildpath_variable(d, var):
+    val = d.getVar(var, True) or ''
+
+    toolchain_opts = d.getVar('TOOLCHAIN_OPTIONS', True)
+    val = val.replace(toolchain_opts, '')
+
+    debug_flags = d.getVar('DEBUG_FLAGS', True).split()
+    for opt in debug_flags:
+        if '-fdebug-prefix-map=' in opt:
+            val = val.replace(opt, '')
+
+    return val
+
+# Remove build path in python compiled code which
+# located in root_path
+def remove_buildpath_bytecode(root_path, byte_code):
+    import py_compile
+
+    file = root_path + byte_code[0:-1]
+    dfile = byte_code[0:-1]
+    py_compile.compile(file, dfile=dfile)
+
Signature · 1 line
1.9.1
author
#2 lore raw

PATCH v2 2/18 python2/3: fix buildpath QA issue

In reply to Hongxu Jia

- use relative path to compile source file

- Remove build paths in target file

- Since _sysconfigdata.py was modified at do_package, so update _sysconfigdata.pyc manually (Python2 only).

[YOCTO #8446]
[YOCTO #9169]

---
 .../use-relative-path-to-compile-source-file.patch | 31 ++++++++++++++++++++++
 .../use-relative-path-to-compile-source-file.patch | 31 ++++++++++++++++++++++
 meta/recipes-devtools/python/python3_3.5.1.bb      | 21 ++++++++++++---
 meta/recipes-devtools/python/python_2.7.11.bb      | 28 +++++++++++++++----
 4 files changed, 102 insertions(+), 9 deletions(-)
 create mode 100644 meta/recipes-devtools/python/python/use-relative-path-to-compile-source-file.patch
 create mode 100644 meta/recipes-devtools/python/python3/use-relative-path-to-compile-source-file.patch
meta/recipes-devtools/python/python/use-relative-path-to-compile-source-file.patch new file +31 -0
new file mode 100644
index 0000000..d68ca0c
@@ -0,0 +1,31 @@
+From 048a7fef98cb4b8323c0b144c0cc1cdff91c603c Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Tue, 23 Feb 2016 21:14:45 -0500
+Subject: [PATCH] use relative path to compile source file
+
+Use relative path rather than absolute path to compile source file.
+This could avoid build path issues.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ Lib/distutils/ccompiler.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py
+index 82fd7d5..eb86158 100644
+--- a/Lib/distutils/ccompiler.py
++++ b/Lib/distutils/ccompiler.py
+@@ -342,7 +342,7 @@ class CCompiler:
+ 
+         build = {}
+         for i in range(len(sources)):
+-            src = sources[i]
++            src = os.path.relpath(sources[i], '.')
+             obj = objects[i]
+             ext = os.path.splitext(src)[1]
+             self.mkpath(os.path.dirname(obj))
+-- 
+1.9.1
+
meta/recipes-devtools/python/python3/use-relative-path-to-compile-source-file.patch new file +31 -0
new file mode 100644
index 0000000..d68ca0c
@@ -0,0 +1,31 @@
+From 048a7fef98cb4b8323c0b144c0cc1cdff91c603c Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Tue, 23 Feb 2016 21:14:45 -0500
+Subject: [PATCH] use relative path to compile source file
+
+Use relative path rather than absolute path to compile source file.
+This could avoid build path issues.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ Lib/distutils/ccompiler.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py
+index 82fd7d5..eb86158 100644
+--- a/Lib/distutils/ccompiler.py
++++ b/Lib/distutils/ccompiler.py
+@@ -342,7 +342,7 @@ class CCompiler:
+ 
+         build = {}
+         for i in range(len(sources)):
+-            src = sources[i]
++            src = os.path.relpath(sources[i], '.')
+             obj = objects[i]
+             ext = os.path.splitext(src)[1]
+             self.mkpath(os.path.dirname(obj))
+-- 
+1.9.1
+
meta/recipes-devtools/python/python3_3.5.1.bb +17 -4
index 11f959b..e7e654d 100644
@@ -37,6 +37,7 @@ SRC_URI += "\
             file://setup.py-find-libraries-in-staging-dirs.patch \
             file://use_packed_importlib.patch \
             file://configure.ac-fix-LIBPL.patch \
+            file://use-relative-path-to-compile-source-file.patch \
            "
 SRC_URI[md5sum] = "e9ea6f2623fffcdd871b7b19113fde80"
 SRC_URI[sha256sum] = "c6d57c0c366d9060ab6c0cdf889ebf3d92711d466cc0119c441dbf2746f725c9"
@@ -185,12 +186,24 @@ PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
 py_package_preprocess () {
 	# copy back the old Makefile to fix target package
 	install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
-	# Remove references to buildmachine paths in target Makefile and _sysconfigdata
-	sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
-		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
-		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
 }
 
+# Remove references to buildmachine paths in target
+inherit fix_buildpaths
+PACKAGE_BUILDPATH_TEXT_FILES ?= " \
+    ${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+    ${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_BINABI}/Makefile \
+    ${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py \
+    ${bindir}/python${PYTHON_BINABI}-config \
+"
+PACKAGE_BUILDPATH_TEXT_PATTERNS += " \
+    -e 's:--with-libtool-sysroot=${STAGING_DIR_TARGET}::g' \
+    -e 's:${STAGING_DIR}/${MACHINE}${datadir}/pkgconfig:${datadir}/pkgconfig:g' \
+    -e 's:${STAGING_DIR_HOST}::g' \
+    -e 's:${STAGING_DIR_NATIVE}::g' \
+    -e 's:${WORKDIR}::g' \
+"
+
 require python-${PYTHON_MAJMIN}-manifest.inc
 
 # manual dependency additions
meta/recipes-devtools/python/python_2.7.11.bb +23 -5
index 0c00d6e..69bcba7 100644
@@ -27,6 +27,7 @@ SRC_URI += "\
   file://use_sysroot_ncurses_instead_of_host.patch \
   file://avoid_parallel_make_races_on_pgen.patch \
   file://add-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \
+  file://use-relative-path-to-compile-source-file.patch \
 "
 
 S = "${WORKDIR}/Python-${PV}"
@@ -128,15 +129,32 @@ do_install_append_class-nativesdk () {
 
 SSTATE_SCAN_FILES += "Makefile"
 PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
-
 py_package_preprocess () {
 	# copy back the old Makefile to fix target package
 	install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+}
+
+# Remove references to buildmachine paths in target
+inherit fix_buildpaths
+PACKAGE_BUILDPATH_TEXT_FILES ?= " \
+    ${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+    ${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py \
+    ${PTEST_PATH}/Makefile \
+"
+PACKAGE_BUILDPATH_TEXT_PATTERNS += " \
+    -e 's:--with-libtool-sysroot=${STAGING_DIR_TARGET}::g' \
+    -e 's:${STAGING_DIR}/${MACHINE}${datadir}/pkgconfig:${datadir}/pkgconfig:g' \
+    -e 's:${STAGING_DIR_HOST}::g' \
+    -e 's:${STAGING_DIR_NATIVE}::g' \
+    -e 's:${WORKDIR}::g' \
+"
 
-	# Remove references to buildmachine paths in target Makefile and _sysconfigdata
-	sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
-		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
-		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
+PACKAGE_PREPROCESS_FUNCS += "update_pyc_package_preprocess"
+python update_pyc_package_preprocess () {
+    # Update _sysconfigdata.pyc
+    root_path = d.expand("${PKGD}")
+    byte_code = d.expand("${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.pyc")
+    remove_buildpath_bytecode(root_path, byte_code)
 }
 
 require python-${PYTHON_MAJMIN}-manifest.inc
Signature · 1 line
1.9.1
author
#3 lore raw

PATCH v2 3/18 bbclass distutils/distutils3: fix .pyc/.pyo buildpath

In reply to Hongxu Jia

Get the "--root" directory supplied to the "install" command, and use it as a prefix to strip off the purported filename encoded in bytecode files.

Since --root added, we need to tweak --install-data, --prefix and --install-lib to use relative path.

[YOCTO #8446]

---
 meta/classes/distutils.bbclass  | 6 +++---
 meta/classes/distutils3.bbclass | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
meta/classes/distutils.bbclass +3 -3
index cd06713..f054006 100644
@@ -4,8 +4,8 @@ DISTUTILS_BUILD_ARGS ?= ""
 DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
 DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
     --install-data=${STAGING_DATADIR}"
-DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \
-    --install-data=${D}/${datadir}"
+DISTUTILS_INSTALL_ARGS ?= "--prefix=${prefix} \
+    --install-data=${datadir}"
 
 distutils_do_compile() {
          STAGING_INCDIR=${STAGING_INCDIR} \
@@ -38,7 +38,7 @@ distutils_do_install() {
         STAGING_LIBDIR=${STAGING_LIBDIR} \
         PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
         BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
-        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --root=${D} --install-lib=${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
         bbfatal "${PYTHON_PN} setup.py install execution failed."
 
         # support filenames with *spaces*
meta/classes/distutils3.bbclass +3 -3
index 443bf3a..7962d40 100644
@@ -5,8 +5,8 @@ DISTUTILS_BUILD_EXT_ARGS ?= ""
 DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
 DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
     --install-data=${STAGING_DATADIR}"
-DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \
-    --install-data=${D}/${datadir}"
+DISTUTILS_INSTALL_ARGS ?= "--prefix=${prefix} \
+    --install-data=${datadir}"
 
 distutils3_do_compile() {
         if [ ${BUILD_SYS} != ${HOST_SYS} ]; then
@@ -63,7 +63,7 @@ distutils3_do_install() {
         STAGING_LIBDIR=${STAGING_LIBDIR} \
         PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
         BUILD_SYS=${BUILD_SYS} HOST_SYS=${SYS} \
-        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --root=${D} --install-lib=${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
         bbfatal "${PYTHON_PN} setup.py install execution failed."
 
         # support filenames with *spaces*
Signature · 1 line
1.9.1
author
#4 lore raw

PATCH v2 4/18 bbclass distutils/distutils3/setuptools/setuptools3: clean up DISTUTILS_INSTALL_ARGS

In reply to Hongxu Jia

Since fix .pyc/.pyo buildpaths issue, we have the same DISTUTILS_INSTALL_ARGS in these bbclass files, so clean up the duplicate.

[YOCTO #8446]

---
 meta/classes/distutils.bbclass   | 4 +++-
 meta/classes/distutils3.bbclass  | 4 +++-
 meta/classes/setuptools.bbclass  | 5 -----
 meta/classes/setuptools3.bbclass | 5 -----
 4 files changed, 6 insertions(+), 12 deletions(-)
meta/classes/distutils.bbclass +3 -1
index f054006..18cfb17 100644
@@ -5,6 +5,8 @@ DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
 DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
     --install-data=${STAGING_DATADIR}"
 DISTUTILS_INSTALL_ARGS ?= "--prefix=${prefix} \
+    --root=${D} \
+    --install-lib=${PYTHON_SITEPACKAGES_DIR} \
     --install-data=${datadir}"
 
 distutils_do_compile() {
@@ -38,7 +40,7 @@ distutils_do_install() {
         STAGING_LIBDIR=${STAGING_LIBDIR} \
         PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
         BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
-        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --root=${D} --install-lib=${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS} || \
         bbfatal "${PYTHON_PN} setup.py install execution failed."
 
         # support filenames with *spaces*
meta/classes/distutils3.bbclass +3 -1
index 7962d40..1e2924a 100644
@@ -6,6 +6,8 @@ DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
 DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
     --install-data=${STAGING_DATADIR}"
 DISTUTILS_INSTALL_ARGS ?= "--prefix=${prefix} \
+    --root=${D} \
+    --install-lib=${PYTHON_SITEPACKAGES_DIR} \
     --install-data=${datadir}"
 
 distutils3_do_compile() {
@@ -63,7 +65,7 @@ distutils3_do_install() {
         STAGING_LIBDIR=${STAGING_LIBDIR} \
         PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
         BUILD_SYS=${BUILD_SYS} HOST_SYS=${SYS} \
-        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --root=${D} --install-lib=${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_INSTALL_ARGS} || \
         bbfatal "${PYTHON_PN} setup.py install execution failed."
 
         # support filenames with *spaces*
meta/classes/setuptools.bbclass +0 -5
index 56343b1..0a3f0f9 100644
@@ -1,8 +1,3 @@
 inherit distutils
 
 DEPENDS += "python-distribute-native"
-
-DISTUTILS_INSTALL_ARGS = "--root=${D} \
-    --prefix=${prefix} \
-    --install-lib=${PYTHON_SITEPACKAGES_DIR} \
-    --install-data=${datadir}"
meta/classes/setuptools3.bbclass +0 -5
index de6dd94..38e175a 100644
@@ -1,8 +1,3 @@
 inherit distutils3
 
 DEPENDS += "python3-setuptools-native"
-
-DISTUTILS_INSTALL_ARGS = "--root=${D} \
-    --prefix=${prefix} \
-    --install-lib=${PYTHON_SITEPACKAGES_DIR} \
-    --install-data=${datadir}"
Signature · 1 line
1.9.1
author
#5 lore raw

PATCH v2 5/18 python-setuptools/python3-setuptools: use old-style install

In reply to Hongxu Jia

Since '--root' is added to 'setup.py install' to fix .pyc/.pyo buildpaths issue. For python setuptools, the '--root' option means explicit request for old-style install. There will be no egg generated. And it do not need setuptools.pth any more.

Rename easy_install to easy_install3.

Ubuntu or Debian did the same thing like us:
https://packages.debian.org/sid/all/python3-setuptools/filelist

[YOCTO #8446]
[YOCTO #9162]

---
 meta/recipes-devtools/python/python-setuptools_19.4.bb  | 2 --
 meta/recipes-devtools/python/python3-setuptools_19.4.bb | 8 ++------
 2 files changed, 2 insertions(+), 8 deletions(-)
meta/recipes-devtools/python/python-setuptools_19.4.bb +0 -2
index c172039..01763d4 100644
@@ -7,8 +7,6 @@ DEPENDS_class-native += "python-native"
 
 inherit distutils
 
-DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
-
 RDEPENDS_${PN} = "\
   python-stringold \
   python-email \
meta/recipes-devtools/python/python3-setuptools_19.4.bb +2 -6
index fb2931c..12b0d93 100644
@@ -5,13 +5,9 @@ DEPENDS_class-native += "python3-native"
 
 inherit distutils3
 
-DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
-
-# The installer puts the wrong path in the setuptools.pth file.  Correct it.
+# Rename easy_install to avoid confliction with python2's setuptools
 do_install_append() {
-    rm ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth
-    mv ${D}${bindir}/easy_install ${D}${bindir}/easy3_install
-    echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth
+    mv ${D}${bindir}/easy_install ${D}${bindir}/easy_install3
 }
 
 RDEPENDS_${PN} = "\
Signature · 1 line
1.9.1
author
#6 lore raw

PATCH v2 6/18 python3-pip: use old-style install

In reply to Hongxu Jia

Since '--root' is added to 'setup.py install' to fix .pyc/.pyo buildpaths issue. For python3-pip, the '--root' option means there will be no eggs generated.

Ubuntu or Debian did the same thing like us:
https://packages.debian.org/sid/all/python3-pip/filelist

[YOCTO #8446]

---
 meta/recipes-devtools/python/python3-pip_8.0.0.bb | 12 ------------
 1 file changed, 12 deletions(-)
meta/recipes-devtools/python/python3-pip_8.0.0.bb +0 -12
index 834ecda..b45aeea 100644
@@ -19,22 +19,10 @@ S = "${WORKDIR}/${SRCNAME}-${PV}"
 
 inherit distutils3
 
-DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
-
-do_install_prepend() {
-    install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages
-}
-
 # 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
-
     # Install as pip3 and leave pip2 as default
     rm ${D}/${bindir}/pip
-
-    # Installed eggs need to be passed directly to the interpreter via a pth file
-    echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}-${PV}.pth
 }
 
 RDEPENDS_${PN} = "\
Signature · 1 line
1.9.1
author
#7 lore raw

PATCH v2 7/18 python-pygobject: fix buildpath QA issue

In reply to Hongxu Jia

The variable PYTHON is assigned with native python. But for target, it caused pygobject-codegen has build path.

vim ${S}/codegen/pygobject-codegen-2.0.in
[snip]...
exec @PYTHON@ $codegendir/codegen.py "$@"
[snip]...

So use "${bindir}/python" to replace.

[YOCTO #7058]
---
 meta/recipes-devtools/python/python-pygobject_2.28.3.bb | 5 +++++
 1 file changed, 5 insertions(+)
meta/recipes-devtools/python/python-pygobject_2.28.3.bb +5 -0
index 81d37b4..c6a9446 100644
@@ -51,3 +51,8 @@ FILES_${PN}-lib = "${libdir}/lib*.so.*"
 FILES_${PN}-dev += "${bindir} ${datadir}"
 
 BBCLASSEXTEND = "native"
+
+do_install_append_class-target() {
+	sed -i -e "s:${PYTHON}:${bindir}/python:g" \
+	    ${D}${bindir}/pygobject-codegen-2.0
+}
Signature · 1 line
1.9.1
author
#8 lore raw

PATCH v2 8/18 python-numpy: fix buildpaths QA issue

In reply to Hongxu Jia

Remove build path in comments:

Without the fix:
...
|This file is generated by /buildarea/raid0/hjia/build-20160225-yocto- buildpath/tmp/work/core2-64-poky-linux/python-numpy/1.10.4-r0/numpy -1.10.4/setup.py
...

With the fix:
...
|This file is generated by /numpy-1.10.4/setup.py
...

[YOCTO #7058]

---
 .../remove-build-path-in-comments.patch            | 30 ++++++++++++++++++++++
 .../recipes-devtools/python/python-numpy_1.10.4.bb |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python-numpy/remove-build-path-in-comments.patch
meta/recipes-devtools/python/python-numpy/remove-build-path-in-comments.patch new file +30 -0
new file mode 100644
index 0000000..eb8a71a
@@ -0,0 +1,30 @@
+From c560abff71f98a39a7401f08c2c13dad9ae7f15f Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Thu, 25 Feb 2016 01:23:32 -0500
+Subject: [PATCH] remove build path in comments
+
+It has build path in comments, so remove it.
+
+Upstream-Status: Inappropriate [openembedded specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ numpy/distutils/misc_util.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py
+index 345e60f..dafb068 100644
+--- a/numpy/distutils/misc_util.py
++++ b/numpy/distutils/misc_util.py
+@@ -2254,7 +2254,7 @@ def generate_config_py(target):
+     from distutils.dir_util import mkpath
+     mkpath(os.path.dirname(target))
+     f = open(target, 'w')
+-    f.write('# This file is generated by %s\n' % (os.path.abspath(sys.argv[0])))
++    f.write('# This file is generated by %s\n' % (os.path.abspath(sys.argv[0]).replace(os.path.abspath('../'),'')))
+     f.write('# It contains system_info results at the time of building this package.\n')
+     f.write('__all__ = ["get_info","show"]\n\n')
+     for k, i in system_info.saved_results.items():
+-- 
+1.9.1
+
meta/recipes-devtools/python/python-numpy_1.10.4.bb +1 -0
index 01bf9fb..fa651cb 100644
@@ -5,6 +5,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=9f4e88b5748e8313caaf33d081ce65a3"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/numpy/numpy-${PV}.tar.gz \
            file://0001-Don-t-search-usr-and-so-on-for-libraries-by-default-.patch \
+           file://remove-build-path-in-comments.patch \
            ${CONFIGFILESURI} "
 
 CONFIGFILESURI ?= ""
Signature · 1 line
1.9.1
author
#9 lore raw

PATCH v2 9/18 waf.bbclass: support do patch on extracted files

In reply to Hongxu Jia

Along with do_unpack, run './waf --help' to do the self extract, so we could do patch on the extracted files later.

---
 meta/classes/waf.bbclass | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
meta/classes/waf.bbclass +10 -1
index 5e55833..a36bdd4 100644
@@ -23,8 +23,17 @@ def get_waf_parallel_make(d):
 
     return ""
 
+do_unpack[postfuncs] += "unpack_waf"
+do_unpack[vardeps] += "unpack_waf"
+unpack_waf() {
+	# Just self extract tarball embedded in waf, do not care help message.
+	# Do not generate bytecode, becuase we may need to patch python file
+        # later
+	PYTHONDONTWRITEBYTECODE=True ./waf --help >/dev/null
+}
+
 waf_do_configure() {
-	${S}/waf configure --prefix=${prefix} ${EXTRA_OECONF}
+	${CACHED_CONFIGUREVARS} ${S}/waf configure --prefix=${prefix} ${EXTRA_OECONF}
 }
 
 waf_do_compile()  {
Signature · 1 line
1.9.1
author
#10 lore raw

PATCH v2 10/18 python-pycairo: fix buildpath QA issue

In reply to Hongxu Jia

- Inherit waf.bbclass, remove duplicate tasks

- Get "--destdir" directory supplied to the "install" command, and use it as a prefix to strip off the purported filename encoded in bytecode files.

- Do not need to generate pycairo.pc manually

[YOCTO #8446]

---
 ...trip-off-build-path-in-purported-filename.patch | 62 ++++++++++++++++++++++
 .../python/python-pycairo_1.10.0.bb                | 25 +++------
 2 files changed, 68 insertions(+), 19 deletions(-)
 create mode 100644 meta/recipes-devtools/python/python-pycairo/strip-off-build-path-in-purported-filename.patch
meta/recipes-devtools/python/python-pycairo/strip-off-build-path-in-purported-filename.patch new file +62 -0
new file mode 100644
index 0000000..647c4be
@@ -0,0 +1,62 @@
+From 86faf604fc8a7f17320db48734cda464119da387 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Thu, 25 Feb 2016 04:22:07 -0500
+Subject: [PATCH] strip off build path in purported filename
+
+Get the "--destdir" directory supplied to the "install" command,
+and use it as a prefix to strip off the purported filename
+encoded in bytecode files.
+
+Upstream-Status: Inappropriate [openembedded specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+diff --git a/.waf-1.6.3-3c3129a3ec8fb4a5bbc7ba3161463b22/waflib/Tools/python.py b/.waf-1.6.3-3c3129a3ec8fb4a5bbc7ba3161463b22/waflib/Tools/python.py
+--- a/.waf-1.6.3-3c3129a3ec8fb4a5bbc7ba3161463b22/waflib/Tools/python.py
++++ b/.waf-1.6.3-3c3129a3ec8fb4a5bbc7ba3161463b22/waflib/Tools/python.py
+@@ -26,7 +26,7 @@ int main()
+ INST='''
+ import sys, py_compile
+ for pyfile in sys.argv[1:]:
+-	py_compile.compile(pyfile, pyfile + %r)
++	py_compile.compile(pyfile, pyfile + %r, %r)
+ '''
+ def process_py(self,node):
+ 	try:
+@@ -39,6 +39,16 @@ def process_py(self,node):
+ 	def inst_py(ctx):
+ 		install_pyfile(self,node)
+ 	self.bld.add_post_fun(inst_py)
++
++def get_dfile(dfile):
++	if getattr(Options.options,'destdir'):
++		destdir = Options.options.destdir
++		if dfile[:len(destdir)] != destdir:
++			raise Errors.WafError("invalid destdir: filename %r doesn't start with %r" % ((dfile, destdir)))
++		dfile = dfile[len(destdir):]
++
++	return dfile
++
+ def install_pyfile(self,node):
+ 	tsk=self.bld.install_files(self.install_path,[node],postpone=False)
+ 	path=os.path.join(tsk.get_install_path(),node.name)
+@@ -53,12 +63,14 @@ def install_pyfile(self,node):
+ 		if self.env['PYC']or self.env['PYO']:
+ 			info("+ byte compiling %r"%path)
+ 		if self.env['PYC']:
+-			argv=self.env['PYTHON']+['-c',INST%'c',path]
++			dfile = get_dfile(path+'c')
++			argv=self.env['PYTHON']+['-c',INST%('c',dfile),path]
+ 			ret=Utils.subprocess.Popen(argv).wait()
+ 			if ret:
+ 				raise Errors.WafError('pyc compilation failed %r'%path)
+ 		if self.env['PYO']:
+-			argv=self.env['PYTHON']+[self.env['PYFLAGS_OPT'],'-c',INST%'o',path]
++			dfile = get_dfile(path+'o')
++			argv=self.env['PYTHON']+[self.env['PYFLAGS_OPT'],'-c',INST%('o',dfile),path]
+ 			ret=Utils.subprocess.Popen(argv).wait()
+ 			if ret:
+ 				raise Errors.WafError('pyo compilation failed %r'%path)
+-- 
+1.9.1
+
meta/recipes-devtools/python/python-pycairo_1.10.0.bb +6 -19
index 70fe25c..2fbd033 100644
@@ -11,31 +11,18 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=f2e071ab72978431b294a0d696327421 \
 DEPENDS = "cairo"
 PR = "r2"
 
-SRC_URI = "http://cairographics.org/releases/py2cairo-${PV}.tar.bz2"
+SRC_URI = "http://cairographics.org/releases/py2cairo-${PV}.tar.bz2 \
+           file://strip-off-build-path-in-purported-filename.patch \
+"
 
 SRC_URI[md5sum] = "20337132c4ab06c1146ad384d55372c5"
 SRC_URI[sha256sum] = "d30439f06c2ec1a39e27464c6c828b6eface3b22ee17b2de05dc409e429a7431"
 
 S = "${WORKDIR}/py2cairo-${PV}"
 
-inherit distutils pkgconfig
+inherit distutils pkgconfig waf
 
 BBCLASSEXTEND = "native"
 
-do_configure() {
-	BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} ./waf configure --prefix=${D}${prefix} --libdir=${D}${libdir}
-}
-
-do_compile() {
-	./waf build ${PARALLEL_MAKE}
-}
-
-do_install() {
-	./waf install
-	sed \
-		-e 's:@prefix@:${prefix}:' \
-		-e 's:@VERSION@:${PV}:' \
-		-e 's:@includedir@:${includedir}:' \
-		pycairo.pc.in > pycairo.pc
-	install -m 0644 pycairo.pc ${D}${libdir}/pkgconfig/
-}
+CACHED_CONFIGUREVARS = "BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS}"
+EXTRA_OECONF += "--libdir=${libdir}"
Signature · 1 line
1.9.1
author
#11 lore raw

PATCH v2 11/18 valgrind: fix buildpath QA issue

In reply to Hongxu Jia

- Pass DEBUG_FLAGS to SELECTED_OPTIMIZATION which fixes build path issue in DWARF.

- It is hard to remove build path in ${PTEST_PATH}/drd/tests/ boost_thread. The reason is assert which has macro '__FILE__' has been invoked in include file.(boost/thread/pthread/pthread_ mutex_scoped_lock.hpp)

[YOCTO #8457]

---
 meta/recipes-devtools/valgrind/valgrind_3.11.0.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-devtools/valgrind/valgrind_3.11.0.bb +3 -2
index 7e23240..0afe014 100644
@@ -49,8 +49,9 @@ EXTRA_OEMAKE = "-w"
 
 # valgrind likes to control its own optimisation flags. It generally defaults
 # to -O2 but uses -O0 for some specific test apps etc. Passing our own flags
-# (via CFLAGS) means we interfere with that.
-SELECTED_OPTIMIZATION = ""
+# (via CFLAGS) means we interfere with that. Only pass DEBUG_FLAGS to it
+# which fixes build path issue in DWARF.
+SELECTED_OPTIMIZATION = "${DEBUG_FLAGS}"
 
 CFLAGS_append_libc-uclibc = " -D__UCLIBC__ "
 
Signature · 1 line
1.9.1
author
#12 lore raw

PATCH v2 12/18 dtc.inc: fix buildpaths QA issue

In reply to Hongxu Jia

Previous Makefile define its own CFLAGS, pass DEBUG_FLAGS to it could fix build path issue in DWARF.

[YOCTO #8457]

---
 meta/recipes-kernel/dtc/dtc.inc                    |  3 ++-
 .../dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch       | 30 ++++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-kernel/dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch
meta/recipes-kernel/dtc/dtc.inc +2 -1
index 0c409b0..ea44877 100644
@@ -6,9 +6,10 @@ DEPENDS = "flex-native bison-native"
 
 SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git \
            file://make_install.patch \
+           file://pass-DEBUG_FLAGS-to-CFLAGS.patch \
 	  "
 
-EXTRA_OEMAKE='PREFIX="${prefix}" LIBDIR="${libdir}" DESTDIR="${D}"'
+EXTRA_OEMAKE='PREFIX="${prefix}" LIBDIR="${libdir}" DESTDIR="${D}" DEBUG_FLAGS="${DEBUG_FLAGS}"'
 
 S = "${WORKDIR}/git"
 
meta/recipes-kernel/dtc/dtc/pass-DEBUG_FLAGS-to-CFLAGS.patch new file +30 -0
new file mode 100644
index 0000000..3f17ee9
@@ -0,0 +1,30 @@
+From 4019e29b0c1ec441fa43d9969197c24ad73f3b1a Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Fri, 26 Feb 2016 03:28:15 -0500
+Subject: [PATCH] Makefile: pass DEBUG_FLAGS to CFLAGS
+
+It fixes buildpaths issue while compiling.
+
+Upstream-Status: Inappropriate [openembedded specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 18838cc..4954f32 100644
+--- a/Makefile
++++ b/Makefile
+@@ -18,7 +18,7 @@ CONFIG_LOCALVERSION =
+ CPPFLAGS = -I libfdt -I .
+ WARNINGS = -Werror -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \
+ 	-Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wshadow
+-CFLAGS = -g -Os -fPIC -Werror $(WARNINGS)
++CFLAGS = $(DEBUG_FLAGS) -Os -fPIC -Werror $(WARNINGS)
+ 
+ BISON = bison
+ LEX = flex
+-- 
+1.9.1
+
Signature · 1 line
1.9.1
author
#13 lore raw

PATCH v2 13/18 epiphany: fix buildpaths QA issue

In reply to Hongxu Jia

In order to fix build path issue, we reverts the following commit in https://github.com/GNOME/epiphany.git
...
commit 54a3122d8626f78338033a704d5849738f6dd2e6

Author: Xan Lopez <[email protected]>
Date:   Wed May 16 18:21:21 2012 +0900

ephy-profile-utils: use absolute path for build dir

That way we can run the tests from any directory in debug mode.
...
It did not consider cross-compile situation which we do not need to run tests in host build.

BTW, the tests suits were compiled but not installed to ${D}, so we explicitly disable it.

[YOCTO #7058]

---
 meta/recipes-gnome/epiphany/epiphany_3.18.4.bb     |  8 ++-
 .../files/use-relative-path-for-build-dir.patch    | 57 ++++++++++++++++++++++
 2 files changed, 63 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-gnome/epiphany/files/use-relative-path-for-build-dir.patch
meta/recipes-gnome/epiphany/epiphany_3.18.4.bb +6 -2
index 12d3b07..0b8335b 100644
@@ -9,11 +9,15 @@ inherit gnomebase gsettings distro_features_check upstream-version-is-even
 # libwnck3 is x11 only
 REQUIRED_DISTRO_FEATURES = "x11"
 
-SRC_URI += "file://0001-yelp.m4-drop-the-check-for-itstool.patch"
+SRC_URI += "file://0001-yelp.m4-drop-the-check-for-itstool.patch \
+            file://use-relative-path-for-build-dir.patch \
+"
 SRC_URI[archive.md5sum] = "172b78256100e8d3c629764abd0e1495"
 SRC_URI[archive.sha256sum] = "be699d484371111abae754e669187215df73e21533f461e513b79537d7a1c1c1"
 
-EXTRA_OECONF += " --disable-nss --with-distributor-name=${DISTRO}"
+EXTRA_OECONF += " --disable-nss --with-distributor-name=${DISTRO} \
+                  --disable-tests \
+"
 
 do_configure_prepend() {
     touch ${S}/gnome-doc-utils.make
meta/recipes-gnome/epiphany/files/use-relative-path-for-build-dir.patch new file +57 -0

57 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#14 lore raw

PATCH v2 14/18 gconf: fix buildpaths QA issue

In reply to Hongxu Jia

In ${S}/gconf/gconfd.c, we have:
...
/* -- Debug only */

  if (addresses == NULL)
    {
      gconf_log(GCL_DEBUG, _("gconfd compiled with debugging; trying to load gconf.path from the source directory"));
      conffile = g_strconcat(GCONF_SRCDIR, "/gconf/gconf.path", NULL);
      addresses = gconf_load_source_path(conffile, NULL);
      g_free(conffile);
    }

/* -- End of Debug Only */
...

- While --enable-debug=yes, the above works, but the released tarball did not have gconf.path, so get a copy from git://git.gnome.org/gconf

- Use target path rather than build path to configure above variable GCONF_SRCDIR, by setting absolute_top_srcdir in configure.ac.

[YOCTO #7058]

---
 meta/recipes-gnome/gnome/gconf/gconf.path          |  6 +++++
 .../gnome/gconf/use-target-path-for-debug.patch    | 31 ++++++++++++++++++++++
 meta/recipes-gnome/gnome/gconf_3.2.6.bb            | 12 +++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 meta/recipes-gnome/gnome/gconf/gconf.path
 create mode 100644 meta/recipes-gnome/gnome/gconf/use-target-path-for-debug.patch
meta/recipes-gnome/gnome/gconf/gconf.path new file +6 -0
new file mode 100644
index 0000000..4e2a7cf
@@ -0,0 +1,6 @@
+# This file stores the addresses of config sources for GConf
+# When a value is stored or requested, the sources are scanned from top to 
+# bottom, and the first one to have a value for the key (or the first one 
+# to be writeable) is used to load/store the data.
+# You can also use include statements
+xml:readwrite:$(DEFAULTUSERSOURCE)
meta/recipes-gnome/gnome/gconf/use-target-path-for-debug.patch new file +31 -0
new file mode 100644
index 0000000..0698831
@@ -0,0 +1,31 @@
+From 7d03ad64b6a8fd2897b07a92c66a15e871f2efe9 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Wed, 2 Mar 2016 03:19:50 -0500
+Subject: [PATCH] use target path for debugging
+
+The variable absolute_top_srcdir is used for
+debugging purposes, use target path rather
+than build path for cross complication.
+
+Upstream-Status: Inappropriate [openembedded specific]
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 69a57e6..1b0739f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -365,7 +365,7 @@ AC_SUBST(CPPFLAGS)
+ AC_SUBST(LDFLAGS)
+ 
+ ## Just for debugging purposes
+-absolute_top_srcdir=`pwd`
++absolute_top_srcdir="/usr/src/${S##*/}"
+ AC_SUBST(absolute_top_srcdir)
+ 
+ AC_CONFIG_FILES([
+-- 
+1.9.1
+
meta/recipes-gnome/gnome/gconf_3.2.6.bb +12 -0
index e50d077..ac7272f 100644
@@ -10,6 +10,8 @@ inherit gnomebase gtk-doc gettext
 SRC_URI = "${GNOME_MIRROR}/GConf/${@gnome_verdir("${PV}")}/GConf-${PV}.tar.xz;name=archive \
            file://remove_plus_from_invalid_characters_list.patch \
            file://unable-connect-dbus.patch \
+           file://use-target-path-for-debug.patch \
+           file://gconf.path \
 "
 
 SRC_URI[archive.md5sum] = "2b16996d0e4b112856ee5c59130e822c"
@@ -17,6 +19,7 @@ SRC_URI[archive.sha256sum] = "1912b91803ab09a5eed34d364bf09fe3a2a9c96751fde03a4e
 
 S = "${WORKDIR}/GConf-${PV}"
 
+CACHED_CONFIGUREVARS += "S=${S}"
 EXTRA_OECONF = "--enable-shared --disable-static --enable-debug=yes \
                 --disable-introspection --disable-orbit --with-openldap=no --disable-gtk"
 
@@ -28,6 +31,15 @@ PACKAGECONFIG_libc-uclibc = ""
 
 PACKAGECONFIG[policykit] = "--enable-defaults-service,--disable-defaults-service,polkit"
 
+do_unpack[postfuncs] += "unpack_gconf_debug"
+do_unpack[vardeps] += "unpack_gconf_debug"
+unpack_gconf_debug() {
+	# A copy from git://git.gnome.org/gconf for debug
+	if [ ! -e ${S}/gconf/gconf.path ]; then
+		install -m 0664 ${WORKDIR}/gconf.path ${S}/gconf/
+	fi
+}
+
 do_install_append() {
 	# this directory need to be created to avoid an Error 256 at gdm launch
 	install -d ${D}${sysconfdir}/gconf/gconf.xml.system
Signature · 1 line
1.9.1
author
#15 lore raw

PATCH v2 15/18 icu: fix buildpaths QA issue

In reply to Hongxu Jia

- Define new variable U_CC and U_CXX which do not have build path. The output of icuinfo will not have build path in it:
...

  root@qemux86-64:~# icuinfo
   <icuSystemParams type="icu4c">
      [snip]
      <param name="build.cc">x86_64-poky-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse
      <param name="build.cxx">x86_64-poky-linux-g++ -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse
      [snip]
   </icuSystemParams>
  ...

- Remove build paths in pkgdata.inc, Makefile.inc and icu-config.

[YOCTO #7058]

---
 .../icu/icu/add-variable-U_CC-and-U_CXX.patch      | 61 ++++++++++++++++++++++
 meta/recipes-support/icu/icu_56.1.bb               | 12 +++++
 2 files changed, 73 insertions(+)
 create mode 100644 meta/recipes-support/icu/icu/add-variable-U_CC-and-U_CXX.patch
meta/recipes-support/icu/icu/add-variable-U_CC-and-U_CXX.patch new file +61 -0
new file mode 100644
index 0000000..826d934
@@ -0,0 +1,61 @@
+From 3221b108a18edeff5424bc5c66589eb20148d9b2 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Wed, 2 Mar 2016 21:18:34 -0500
+Subject: [PATCH] add variable U_CC and U_CXX
+
+Define new variable U_CC and U_CXX which do not have build path.
+The output of icuinfo will not have build path in it:
+...
+root@qemux86-64:~# icuinfo
+ <icuSystemParams type="icu4c">
+    [snip]
+    <param name="build.cc">x86_64-poky-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse
+    <param name="build.cxx">x86_64-poky-linux-g++ -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse
+    [snip]
+ </icuSystemParams>
+...
+
+Upstream-Status: Inappropriate [openembedded specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ configure.ac               | 9 +++++++++
+ tools/toolutil/Makefile.in | 2 +-
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 595bd12..ec05c19 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -673,6 +673,15 @@ AC_SUBST(GENCCODE_ASSEMBLY)
+ 
+ AC_MSG_RESULT($GENCCODE_ASSEMBLY)
+ 
++# U_CC and U_CXX are used for icuinfo which remove
++# --sysroot for cross-compilation
++U_CC=${U_CC}
++AC_SUBST(U_CC)
++AC_MSG_RESULT(U_CC)
++U_CXX=${U_CXX}
++AC_SUBST(U_CXX)
++AC_MSG_RESULT(U_CXX)
++
+ # Checks for header files
+ AC_CHECK_HEADERS(inttypes.h)
+ if test $ac_cv_header_inttypes_h = no; then
+diff --git a/tools/toolutil/Makefile.in b/tools/toolutil/Makefile.in
+index 1fb42ed..a083522 100644
+--- a/tools/toolutil/Makefile.in
++++ b/tools/toolutil/Makefile.in
+@@ -46,7 +46,7 @@ CXXFLAGS += $(LIBCXXFLAGS)
+ CPPFLAGS += -I$(top_srcdir)/common -I$(top_srcdir)/i18n $(LIBCPPFLAGS)
+ 
+ # from icuinfo
+-CPPFLAGS+=  "-DU_BUILD=\"@build@\"" "-DU_HOST=\"@host@\"" "-DU_CC=\"@CC@\"" "-DU_CXX=\"@CXX@\""
++CPPFLAGS+=  "-DU_BUILD=\"@build@\"" "-DU_HOST=\"@host@\"" "-DU_CC=\"@U_CC@\"" "-DU_CXX=\"@U_CXX@\""
+ CPPFLAGS += -DUNISTR_FROM_CHAR_EXPLICIT=explicit -DUNISTR_FROM_STRING_EXPLICIT=explicit
+ 
+ DEFS += -DU_TOOLUTIL_IMPLEMENTATION
+-- 
+1.9.1
+
meta/recipes-support/icu/icu_56.1.bb +12 -0
index db0de10..7375170 100644
@@ -17,6 +17,7 @@ SRC_URI = "${BASE_SRC_URI} \
            file://icu-pkgdata-large-cmd.patch \
            file://fix-install-manx.patch \
            file://icu-release-56-1-flagparser-fix.patch \
+           file://add-variable-U_CC-and-U_CXX.patch \
           "
 
 SRC_URI_append_class-target = "\
@@ -27,3 +28,14 @@ SRC_URI[sha256sum] = "3a64e9105c734dcf631c0b3ed60404531bce6c0f5a64bfe1a6402a4cc2
 
 UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)/"
 UPSTREAM_CHECK_URI = "http://download.icu-project.org/files/icu4c/"
+
+inherit fix_buildpaths
+CACHED_CONFIGUREVARS += "U_CC="${@remove_buildpath_variable(d, 'CC')}" \
+                         U_CXX="${@remove_buildpath_variable(d, 'CXX')}" \
+"
+PACKAGE_BUILDPATH_TEXT_FILES ?= " \
+    ${libdir}/${BPN}/${PV}/pkgdata.inc \
+    ${libdir}/${BPN}/${PV}/Makefile.inc \
+    ${bindir}/icu-config \
+"
+
Signature · 1 line
1.9.1
author
#16 lore raw

PATCH v2 16/18 tcl: fix buildpath QA issue

In reply to Hongxu Jia

- Use relative path rather than absolute path to compile

- Remove build path in tclConfig.sh

- Tweak sed expression at tclConfig.sh to strict the pattern

[YOCTO #8457]

---
 .../tcltk/tcl/use-relative-path-to-compile.patch   | 52 ++++++++++++++++++++++
 meta/recipes-devtools/tcltk/tcl_8.6.4.bb           | 10 ++++-
 2 files changed, 60 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/tcltk/tcl/use-relative-path-to-compile.patch
meta/recipes-devtools/tcltk/tcl/use-relative-path-to-compile.patch new file +52 -0
new file mode 100644
index 0000000..8086eb5
@@ -0,0 +1,52 @@
+From 1d288139c184f33586de5f0013adff7b3a9d4b7c Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Tue, 1 Mar 2016 03:52:34 -0500
+Subject: [PATCH] use relative path to compile
+
+Use relative path rather than absolute path to compile
+which fix build path issue.
+
+Upstream-Status: Inappropriate [embedded specific]
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ Makefile.in | 4 ++--
+ configure   | 1 -
+ 2 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index ef4f786..072e196 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -224,7 +224,7 @@ AR			= @AR@
+ RANLIB			= @RANLIB@
+ DTRACE			= @DTRACE@
+ SRC_DIR			= @srcdir@
+-TOP_DIR			= @TCL_SRC_DIR@
++TOP_DIR			= @srcdir@/..
+ BUILD_DIR		= @builddir@
+ GENERIC_DIR		= $(TOP_DIR)/generic
+ TOMMATH_DIR		= $(TOP_DIR)/libtommath
+@@ -737,7 +737,7 @@ ro-test: ${TCLTEST_EXE}
+ # directory after a successful build.
+ 
+ dltest.marker: ${STUB_LIB_FILE}
+-	cd dltest ; $(MAKE)
++	cd dltest ; $(MAKE) SRC_DIR=../$(SRC_DIR)/dltest
+ 
+ #--------------------------------------------------------------------------
+ # Rules for running a shell before installation
+diff --git a/configure b/configure
+index 0d7eece..97275be 100755
+--- a/configure
++++ b/configure
+@@ -1374,7 +1374,6 @@ if test "${exec_prefix}" = "NONE"; then
+     exec_prefix=$prefix
+ fi
+ # Make sure srcdir is fully qualified!
+-srcdir="`cd "$srcdir" ; pwd`"
+ TCL_SRC_DIR="`cd "$srcdir"/..; pwd`"
+ 
+ #------------------------------------------------------------------------
+-- 
+1.9.1
+
meta/recipes-devtools/tcltk/tcl_8.6.4.bb +8 -2
index 8e92b3e..1966148 100644
@@ -22,6 +22,7 @@ SRC_URI = "${BASE_SRC_URI} \
            file://no_packages.patch \
            file://tcl-remove-hardcoded-install-path.patch \
            file://alter-includedir.patch \
+           file://use-relative-path-to-compile.patch \
            file://run-ptest \
 "
 SRC_URI[md5sum] = "d7cbb91f1ded1919370a30edd1534304"
@@ -54,8 +55,8 @@ do_install() {
 	autotools_do_install install-private-headers
 	ln -sf ./tclsh${VER} ${D}${bindir}/tclsh
 	ln -sf tclsh8.6 ${D}${bindir}/tclsh${VER}
-	sed -i "s+-L${B}+-L${STAGING_LIBDIR}+g" tclConfig.sh
-	sed -i "s+${WORKDIR}+${STAGING_INCDIR}+g" tclConfig.sh
+	sed -i "s,-L${B},-L${STAGING_LIBDIR},g" tclConfig.sh
+	sed -i "s,='${WORKDIR},='${STAGING_INCDIR},g" tclConfig.sh
 	sed -i "s,-L${libdir},-L=${libdir},g" tclConfig.sh
 	sed -i "s,-I${includedir},-I=${includedir},g" tclConfig.sh
 	install -d ${D}${bindir_crossscripts}
@@ -73,6 +74,11 @@ tcl_sysroot_preprocess () {
 	sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
 }
 
+inherit fix_buildpaths
+PACKAGE_BUILDPATH_TEXT_FILES ?= "${bindir_crossscripts}/tclConfig.sh \
+                                 ${libdir}/tclConfig.sh \
+"
+
 PACKAGES =+ "tcl-lib"
 FILES_tcl-lib = "${libdir}/libtcl8.6.so.*"
 FILES_${PN} += "${libdir}/tcl${VER} ${libdir}/tcl8.6 ${libdir}/tcl8"
Signature · 1 line
1.9.1
author
#17 lore raw

PATCH v2 17/18 openssl: fix buildpath QA issue

In reply to Hongxu Jia

- The openssl records $CC and $CFLAGS in source code which caused buildpaths QA issue:
In crypto/cversion.c
...

      if (t == SSLEAY_CFLAGS) {
          return (CFLAGS);
          return ("compiler: information not available");
      }

...
We should remove build path in the above source code.

- Remove build paths in ${PTEST_PATH}/Makefile and ${PTEST_PATH}/Configure

[YOCTO #7058]

---
 .../openssl/remove-build-path-in-source-code.patch | 44 ++++++++++++++++++++++
 .../recipes-connectivity/openssl/openssl_1.0.2g.bb |  7 ++++
 2 files changed, 51 insertions(+)
 create mode 100644 meta/recipes-connectivity/openssl/openssl/remove-build-path-in-source-code.patch
meta/recipes-connectivity/openssl/openssl/remove-build-path-in-source-code.patch new file +44 -0
new file mode 100644
index 0000000..fd5531b
@@ -0,0 +1,44 @@
+From b937d7581a1793cdebbf5829bdaea787ed4128db Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Mon, 7 Mar 2016 01:11:42 -0500
+Subject: [PATCH] crypto/Makefile: remove build path in source code
+
+Openssl records $CC and $CFLAGS in source code which
+caused buildpaths QA issue:
+In crypto/cversion.c
+...
+    if (t == SSLEAY_CFLAGS) {
+        return (CFLAGS);
+        return ("compiler: information not available");
+    }
+...
+
+We should remove build path in the above source code.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ crypto/Makefile | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/crypto/Makefile b/crypto/Makefile
+index 17a87f8..ee630e8 100644
+--- a/crypto/Makefile
++++ b/crypto/Makefile
+@@ -54,8 +54,11 @@ top:
+ 
+ all: shared
+ 
++NO_BUILDPATH_CCFLAGS=`echo "$(CC) $(CFLAGS)" | \
++         sed -e 's:--sysroot=[^ ]*::g' \
++             -e 's:-fdebug-prefix-map=[^ ]*::g'`
+ buildinf.h: ../Makefile
+-	$(PERL) $(TOP)/util/mkbuildinf.pl "$(CC) $(CFLAGS)" "$(PLATFORM)" >buildinf.h
++	$(PERL) $(TOP)/util/mkbuildinf.pl "$(NO_BUILDPATH_CCFLAGS)" "$(PLATFORM)" >buildinf.h
+ 
+ x86cpuid.s:	x86cpuid.pl perlasm/x86asm.pl
+ 	$(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+-- 
+1.9.1
+
meta/recipes-connectivity/openssl/openssl_1.0.2g.bb +7 -0
index 290f129..7b27b47 100644
@@ -39,6 +39,7 @@ SRC_URI += "file://find.pl;subdir=${BP}/util/ \
             file://ptest_makefile_deps.patch  \
             file://configure-musl-target.patch \
             file://parallel.patch \
+            file://remove-build-path-in-source-code.patch \
            "
 
 SRC_URI[md5sum] = "f3c710c045cdee5fd114feb69feba7aa"
@@ -47,6 +48,12 @@ SRC_URI[sha256sum] = "b784b1b3907ce39abf4098702dade6365522a253ad1552e267a9a0e895
 PACKAGES =+ "${PN}-engines"
 FILES_${PN}-engines = "${libdir}/ssl/engines/*.so ${libdir}/engines"
 
+inherit fix_buildpaths
+PACKAGE_BUILDPATH_TEXT_FILES ?= " \
+        ${PTEST_PATH}/Makefile \
+        ${PTEST_PATH}/Configure \
+"
+
 # The crypto_use_bigint patch means that perl's bignum module needs to be
 # installed, but some distributions (for example Fedora 23) don't ship it by
 # default.  As the resulting error is very misleading check for bignum before
Signature · 1 line
1.9.1
author
#18 lore raw

PATCH v2 18/18 cmake-native:convert source file to relative path

In reply to Hongxu Jia

While '__FILE__' is used in C/C++ source file, we need to compile with relative path to avoid build path issue.

If a recipe(such as waffle) inherit cmake, it invoke native cmake to generate Makefile:
Without the fix:
vim ./build.make
| cd /Build/tmp/work/core2-64-poky-linux/waffle/1.5.2-r0/
build/src/waffle && /Build/tmp/sysroots/x86_64-linux/usr/bin/ x86_64-poky-linux/x86_64-poky-linux-gcc $(C_DEFINES) $(C_INCLUDES)
$(C_FLAGS) -o glx/glx_context.c.o -c /Build/tmp/work/core2-64-poky-linux/
waffle/1.5.2-r0/waffle-1.5.2/src/waffle/glx/glx_context.c

With the fix:
vim ./build.make
| cd /Build/tmp/work/core2-64-poky-linux/waffle/1.5.2-r0/
build/src/waffle && /Build/tmp/sysroots/x86_64-linux/usr/bin/ x86_64-poky-linux/x86_64-poky-linux-gcc $(C_DEFINES) $(C_INCLUDES)
$(C_FLAGS) -o glx/glx_context.c.o -c ../../../waffle-1.5.2/src/waffle/glx/glx_context.c

[YOCTO #7058]

---
 meta/recipes-devtools/cmake/cmake-native_3.4.3.bb  |   1 +
 .../convert-source-file-to-relative-path.patch     | 128 +++++++++++++++++++++
 2 files changed, 129 insertions(+)
 create mode 100644 meta/recipes-devtools/cmake/cmake/convert-source-file-to-relative-path.patch
meta/recipes-devtools/cmake/cmake-native_3.4.3.bb +1 -0
index cb4e749..2939512 100644
@@ -6,6 +6,7 @@ DEPENDS += "bzip2-native zlib-native"
 
 SRC_URI += "\
     file://cmlibarchive-disable-ext2fs.patch \
+    file://convert-source-file-to-relative-path.patch \
 "
 
 # Disable ccmake since we don't depend on ncurses
meta/recipes-devtools/cmake/cmake/convert-source-file-to-relative-path.patch new file +128 -0

128 lines not on this page · raw message

Signature · 1 line
1.9.1
#19 lore raw

Re: [PATCH 18/18] cmake-native:convert source file to relative path

We should submit these kind of changes upstream first and get an opinion before forking like this

Quoted 200 lines · Hongxu Jia

While '__FILE__' is used in C/C++ source file, we need to compile with relative path to avoid build path issue.

If a recipe(such as waffle) inherit cmake, it invoke native cmake to generate Makefile:
Without the fix:
vim ./build.make
| cd /Build/tmp/work/core2-64-poky-linux/waffle/1.5.2-r0/
build/src/waffle && /Build/tmp/sysroots/x86_64-linux/usr/bin/ x86_64-poky-linux/x86_64-poky-linux-gcc $(C_DEFINES) $(C_INCLUDES)
$(C_FLAGS) -o glx/glx_context.c.o -c /Build/tmp/work/core2-64-poky-linux/
waffle/1.5.2-r0/waffle-1.5.2/src/waffle/glx/glx_context.c

With the fix:
vim ./build.make
| cd /Build/tmp/work/core2-64-poky-linux/waffle/1.5.2-r0/
build/src/waffle && /Build/tmp/sysroots/x86_64-linux/usr/bin/ x86_64-poky-linux/x86_64-poky-linux-gcc $(C_DEFINES) $(C_INCLUDES)
$(C_FLAGS) -o glx/glx_context.c.o -c
../../../waffle-1.5.2/src/waffle/glx/glx_context.c

[YOCTO #7058]

---
 meta/recipes-devtools/cmake/cmake-native_3.4.3.bb  |   1 +
 .../convert-source-file-to-relative-path.patch     | 128
+++++++++++++++++++++
 2 files changed, 129 insertions(+)
 create mode 100644

meta/recipes-devtools/cmake/cmake/convert-source-file-to-relative-path.patch

meta/recipes-devtools/cmake/cmake-native_3.4.3.bb +1 -0
index cb4e749..2939512 100644
@@ -6,6 +6,7 @@ DEPENDS += "bzip2-native zlib-native"
 
 SRC_URI += "\
     file://cmlibarchive-disable-ext2fs.patch \
+    file://convert-source-file-to-relative-path.patch \
 "
 
 # Disable ccmake since we don't depend on ncurses

diff --git a/meta/recipes-devtools/cmake/cmake/convert-source-file-to-relative-path.patch b/meta/recipes-devtools/cmake/cmake/convert-source-file-to-relative-path.patch new file mode 100644
index 0000000..77a5155
--- /dev/null
+++
b/meta/recipes-devtools/cmake/cmake/convert-source-file-to-relative-path.patch

meta/recipes-devtools/cmake/cmake-native_3.4.3.bb +35 -0
@@ -0,0 +1,128 @@
+From c272c82eaeed2ae4b72f40af2754e91f1450a705 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Thu, 3 Mar 2016 04:48:46 -0500
+Subject: [PATCH] convert source file to relative path
+
+Although there is CMAKE_USE_RELATIVE_PATHS, but upstream
+explicitly did not support relative path.
+In git://cmake.org/cmake.git
+...
+commit 1335992c8f4e8b96f1a21d5dcc7d65a9fbd84c11
+Author: Stephen Kelly <[email protected]>
+Date:   Mon Jun 1 19:56:46 2015 +0200
+
+    Remove CMAKE_USE_RELATIVE_PATHS variable.
+...
+The reason is in https://cmake.org/Wiki/CMake_FAQ
+(Why does CMake use full paths, or can I copy my build tree?)
+
+But oe-core need the source file path relative while compiling
+to avoid build path issue. The fix partly refer the above commit,
+but in order to minimize the influence, it only tweak gcc compiling
+rule in generated Makefile (With "Building ** object" message).
+
+Upstream-Status: Inappropriate [openembedded specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ Source/cmCommonTargetGenerator.cxx   |  7 +++++++
+ Source/cmCommonTargetGenerator.h     |  5 +++++
+ Source/cmMakefileTargetGenerator.cxx |  5 +++++
+ Source/cmOutputConverter.cxx         | 14 ++++++++++++++
+ Source/cmOutputConverter.h           |  5 +++++
+ 5 files changed, 36 insertions(+)
+
+diff --git a/Source/cmCommonTargetGenerator.cxx

b/Source/cmCommonTargetGenerator.cxx

meta/recipes-devtools/cmake/cmake-native_3.4.3.bb +15 -0
+index 252e231..f7d2d6b 100644
+--- a/Source/cmCommonTargetGenerator.cxx
++++ b/Source/cmCommonTargetGenerator.cxx
+@@ -54,6 +54,13 @@ std::string cmCommonTargetGenerator::Convert(
+   return this->LocalGenerator->Convert(source, relative, output);
+ }
+
++std::string cmCommonTargetGenerator::Convert(
++  std::string const& local,
++  std::string const& remote,
++  cmLocalGenerator::OutputFormat output)
++{
++  return this->LocalGenerator->Convert(local, remote, output);
++}
+

//----------------------------------------------------------------------------
+ const char* cmCommonTargetGenerator::GetFeature(const std::string& feature)
+ {
+diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h

meta/recipes-devtools/cmake/cmake-native_3.4.3.bb +16 -0
+index a4b2c10..6e6b724 100644
+--- a/Source/cmCommonTargetGenerator.h
++++ b/Source/cmCommonTargetGenerator.h
+@@ -72,6 +72,11 @@ protected:
+                       cmLocalGenerator::OutputFormat output =
+                       cmLocalGenerator::UNCHANGED);
+
++  std::string Convert(std::string const& local,
++                      std::string const& remote,
++                      cmLocalGenerator::OutputFormat output =
++                      cmLocalGenerator::UNCHANGED);
++
+   void AppendFortranFormatFlags(std::string& flags,
+                                 cmSourceFile const& source);
+
+diff --git a/Source/cmMakefileTargetGenerator.cxx

b/Source/cmMakefileTargetGenerator.cxx

meta/recipes-devtools/cmake/cmake-native_3.4.3.bb +6 -0
+index b278087..84a6ed7 100644
+--- a/Source/cmMakefileTargetGenerator.cxx
++++ b/Source/cmMakefileTargetGenerator.cxx
+@@ -530,6 +530,11 @@ cmMakefileTargetGenerator
+     this->LocalGenerator->AppendEcho
+       (commands, buildEcho.c_str(),

cmLocalUnixMakefileGenerator3::EchoBuild,
+ &progress);
++
++ //Convert sourceFile to relative path
++ sourceFile =
this->Convert(this->Makefile->GetCurrentBinaryDirectory(),
++ sourceFile,
++ cmLocalGenerator::SHELL);

meta/recipes-devtools/cmake/cmake-native_3.4.3.bb +8 -0
+     }
+
+   std::string targetOutPathReal;
+diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
+index 5acae2f..3d71739 100644
+--- a/Source/cmOutputConverter.cxx
++++ b/Source/cmOutputConverter.cxx
+@@ -94,6 +94,20 @@ const char*

cmOutputConverter::GetRelativeRootPath(RelativeRoot relroot) const

meta/recipes-devtools/cmake/cmake-native_3.4.3.bb +35 -0
+   return 0;
+ }
+
++std::string cmOutputConverter::Convert(const std::string& local,
++                                       const std::string& remote,
++                                       OutputFormat output) const
++{
++  // Convert the path to a relative path.
++  std::string result = remote;
++
++  std::vector<std::string> components;
++  cmSystemTools::SplitPath(local, components);
++  result = this->ConvertToRelativePath(components, result, true);
++
++  return this->ConvertToOutputFormat(result, output);
++}
++
+ std::string cmOutputConverter::Convert(const std::string& source,
+                                        RelativeRoot relative,
+                                        OutputFormat output) const
+diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
+index 852df5d..d887a99 100644
+--- a/Source/cmOutputConverter.h
++++ b/Source/cmOutputConverter.h
+@@ -45,6 +45,11 @@ public:
+   std::string Convert(RelativeRoot remote, const std::string& local,
+                       OutputFormat output = UNCHANGED,
+                       bool optional = false) const;
++
++  std::string Convert(const std::string& local,
++                      const std::string& remote,
++                      OutputFormat output = UNCHANGED) const;
++
+   std::string ConvertDirectorySeparatorsForShell(
+                                              const std::string& source)

const;

meta/recipes-devtools/cmake/cmake-native_3.4.3.bb +4 -1
+
+--
+1.9.1
+
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

author
#20 lore raw

Re: [PATCH 18/18] cmake-native:convert source file to relative path

Quoted 3 lines · Khem Raj

We should submit these kind of changes upstream first and get an opinion before forking like this

OK, I will have a try.

Quoted 15 lines

+Although there is CMAKE_USE_RELATIVE_PATHS, but upstream +explicitly did not support relative path.
+In git://cmake.org/cmake.git <http://cmake.org/cmake.git>
+...
+commit 1335992c8f4e8b96f1a21d5dcc7d65a9fbd84c11 +Author: Stephen Kelly <[email protected] <mailto:[email protected]>>
+Date: Mon Jun 1 19:56:46 2015 +0200
+
+ Remove CMAKE_USE_RELATIVE_PATHS variable.
+...
+The reason is in https://cmake.org/Wiki/CMake_FAQ
+(Why does CMake use full paths, or can I copy my build tree?)

Currently, The upstream explicitly do not support it.

//Hongxu

Quoted 6 lines

+
+But oe-core need the source file path relative while compiling +to avoid build path issue. The fix partly refer the above commit, +but in order to minimize the influence, it only tweak gcc compiling +rule in generated Makefile (With "Building ** object" message).

#21 lore raw

Re: [PATCH 18/18] cmake-native:convert source file to relative path

Quoted 7 lines · Hongxu Jia

On 03/10/2016 04:08 PM, Khem Raj wrote:

We should submit these kind of changes upstream first and get an opinion before forking like this

OK, I will have a try.

IMO this could be an improvement in all packages that you have modified, so submit them all

Quoted 28 lines
Quoted 4 lines
meta/recipes-devtools/cmake/cmake/convert-source-file-to-relative-path.patch new file +2 -0
+Although there is CMAKE_USE_RELATIVE_PATHS, but upstream
+explicitly did not support relative path.

meta/recipes-devtools/cmake/cmake/convert-source-file-to-relative-path.patch line 17

Quoted 10 lines
meta/recipes-devtools/cmake/cmake/convert-source-file-to-relative-path.patch new file +10 -0
+In git://cmake.org/cmake.git
+...
+commit 1335992c8f4e8b96f1a21d5dcc7d65a9fbd84c11
+Author: Stephen Kelly <[email protected]>
+Date:   Mon Jun 1 19:56:46 2015 +0200
+
+    Remove CMAKE_USE_RELATIVE_PATHS variable.
+...
+The reason is in https://cmake.org/Wiki/CMake_FAQ
+(Why does CMake use full paths, or can I copy my build tree?)

Currently, The upstream explicitly do not support it.

//Hongxu

Quoted 5 lines
meta/recipes-devtools/cmake/cmake/convert-source-file-to-relative-path.patch new file +5 -0
+
+But oe-core need the source file path relative while compiling
+to avoid build path issue. The fix partly refer the above commit,
+but in order to minimize the influence, it only tweak gcc compiling
+rule in generated Makefile (With "Building ** object" message).