All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hongxu Jia <hongxu.jia@windriver.com>
To: <ross.burton@intel.com>, <richard.purdie@linuxfoundation.org>,
	<raj.khem@gmail.com>
Cc: openembedded-core@lists.openembedded.org
Subject: [PATCH 15/18] python-pycairo: fix buildpath QA issue
Date: Fri, 18 Mar 2016 05:01:57 -0400	[thread overview]
Message-ID: <8e6587b7d2ca0401879a3cb54b0928a178c53a48.1458282563.git.hongxu.jia@windriver.com> (raw)
In-Reply-To: <cover.1458282563.git.hongxu.jia@windriver.com>

- 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]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 ...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

diff --git a/meta/recipes-devtools/python/python-pycairo/strip-off-build-path-in-purported-filename.patch b/meta/recipes-devtools/python/python-pycairo/strip-off-build-path-in-purported-filename.patch
new file mode 100644
index 0000000..647c4be
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pycairo/strip-off-build-path-in-purported-filename.patch
@@ -0,0 +1,62 @@
+From 86faf604fc8a7f17320db48734cda464119da387 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+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 <hongxu.jia@windriver.com>
+---
+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
+
diff --git a/meta/recipes-devtools/python/python-pycairo_1.10.0.bb b/meta/recipes-devtools/python/python-pycairo_1.10.0.bb
index 70fe25c..2fbd033 100644
--- a/meta/recipes-devtools/python/python-pycairo_1.10.0.bb
+++ b/meta/recipes-devtools/python/python-pycairo_1.10.0.bb
@@ -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}"
-- 
1.9.1



  parent reply	other threads:[~2016-03-18  9:02 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18  9:01 [PATCH V3 00/18] fix buildpaths QA issue Hongxu Jia
2016-03-18  9:01 ` [PATCH 01/18] gcc-5.3/gcc-4.9:replace build path with target path in __FILE__ Hongxu Jia
2016-03-18  9:01 ` [PATCH 02/18] gcc-5.3/gcc-4.9:Reuse -fdebug-prefix-map to replace -ffile-prefix-map Hongxu Jia
2016-03-18  9:01 ` [PATCH 03/18] kernel.bbclass: fix buildpath QA issue Hongxu Jia
2016-03-18  9:01 ` [PATCH 04/18] valgrind: " Hongxu Jia
2016-03-18  9:01 ` [PATCH 05/18] dtc.inc: fix buildpaths " Hongxu Jia
2016-03-18 12:01   ` Jussi Kukkonen
2016-03-18 13:04     ` Hongxu Jia
2016-03-18  9:01 ` [PATCH 06/18] fix_buildpaths.bbclass: add bbclass to fix build path Hongxu Jia
2016-03-18  9:01 ` [PATCH 07/18] icu: fix buildpaths QA issue Hongxu Jia
2016-03-18  9:01 ` [PATCH 08/18] tcl: fix buildpath " Hongxu Jia
2016-03-18  9:01 ` [PATCH 09/18] python2/3: " Hongxu Jia
2016-03-18  9:01 ` [PATCH 10/18] bbclass distutils/distutils3: fix .pyc/.pyo buildpath Hongxu Jia
2016-03-18  9:01 ` [PATCH 11/18] bbclass distutils/distutils3/setuptools/setuptools3: clean up DISTUTILS_INSTALL_ARGS Hongxu Jia
2016-03-18  9:01 ` [PATCH 12/18] python-setuptools/python3-setuptools: use old-style install Hongxu Jia
2016-03-18  9:01 ` [PATCH 13/18] python3-pip: " Hongxu Jia
2016-03-18  9:01 ` [PATCH 14/18] waf.bbclass: support do patch on extracted files Hongxu Jia
2016-03-18  9:01 ` Hongxu Jia [this message]
2016-03-18  9:01 ` [PATCH 16/18] openssl: fix buildpath QA issue Hongxu Jia
2016-03-18  9:01 ` [PATCH 17/18] gconf: fix buildpaths " Hongxu Jia
2016-03-18 16:28   ` Burton, Ross
2016-03-19  9:09     ` Hongxu Jia
2016-03-18  9:02 ` [PATCH 18/18] epiphany: " Hongxu Jia
2016-03-19 14:56 ` [PATCH V4 00/18] " Hongxu Jia
2016-03-19 14:56   ` [PATCH 06/18] fix_buildpaths.bbclass: add bbclass to fix build path Hongxu Jia
2016-03-19 14:56   ` [PATCH 07/18] icu: fix buildpaths QA issue Hongxu Jia
2016-03-19 14:56   ` [PATCH 09/18] python2/3: fix buildpath " Hongxu Jia
2016-03-19 14:56   ` [PATCH 16/18] openssl: " Hongxu Jia
2016-03-19 14:56   ` [PATCH 18/18] gconf: fix buildpaths " Hongxu Jia
2016-03-21 14:47     ` Burton, Ross
2016-03-22  1:16       ` Hongxu Jia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e6587b7d2ca0401879a3cb54b0928a178c53a48.1458282563.git.hongxu.jia@windriver.com \
    --to=hongxu.jia@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=raj.khem@gmail.com \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=ross.burton@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.