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>, <mark.hatle@windriver.com>
Cc: openembedded-core@lists.openembedded.org
Subject: [PATCH 13/16] python-pycairo: fix buildpath QA issue
Date: Tue, 22 Mar 2016 08:12:41 -0400	[thread overview]
Message-ID: <d261fd8e069d0cad6d72556fddd1daaaf3daa5fe.1458638728.git.hongxu.jia@windriver.com> (raw)
In-Reply-To: <cover.1458638728.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-22 12:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-22 12:12 [PATCH V5 00/16] fix buildpaths QA issue Hongxu Jia
2016-03-22 12:12 ` [PATCH 01/16] conf/bitbake.conf package.bbclass: fix dbg package not contain sources while -fdebug-prefix-map used Hongxu Jia
2016-03-22 17:01   ` Mark Hatle
2016-03-23  1:11     ` Hongxu Jia
2016-03-22 12:12 ` [PATCH 02/16] kernel.bbclass: fix buildpath QA issue Hongxu Jia
2016-03-22 12:21   ` Bruce Ashfield
2016-03-22 16:18     ` Mark Hatle
2016-03-22 16:49       ` Bruce Ashfield
2016-03-22 16:57         ` Mark Hatle
2016-03-23  1:29         ` Hongxu Jia
2016-03-23 14:28           ` Bruce Ashfield
2016-03-23 15:50             ` Hongxu Jia
2016-03-22 12:12 ` [PATCH 03/16] dtc.inc: fix buildpaths " Hongxu Jia
2016-03-22 12:12 ` [PATCH 04/16] fix_buildpaths.bbclass: add bbclass to fix build path Hongxu Jia
2016-03-22 12:12 ` [PATCH 05/16] icu: fix buildpaths QA issue Hongxu Jia
2016-03-22 12:12 ` [PATCH 06/16] tcl: fix buildpath " Hongxu Jia
2016-03-22 12:12 ` [PATCH 07/16] python2/3: " Hongxu Jia
2016-03-22 12:12 ` [PATCH 08/16] bbclass distutils/distutils3: fix .pyc/.pyo buildpath Hongxu Jia
2016-03-22 12:12 ` [PATCH 09/16] bbclass distutils/distutils3/setuptools/setuptools3: clean up DISTUTILS_INSTALL_ARGS Hongxu Jia
2016-03-22 12:12 ` [PATCH 10/16] python-setuptools/python3-setuptools: use old-style install Hongxu Jia
2016-03-22 12:12 ` [PATCH 11/16] python3-pip: " Hongxu Jia
2016-03-22 12:12 ` [PATCH 12/16] waf.bbclass: support do patch on extracted files Hongxu Jia
2016-03-22 12:12 ` Hongxu Jia [this message]
2016-03-22 12:12 ` [PATCH 14/16] openssl: fix buildpath QA issue Hongxu Jia
2016-03-22 12:12 ` [PATCH 15/16] epiphany: fix buildpaths " Hongxu Jia
2016-03-22 12:12 ` [PATCH 16/16] gconf: " Hongxu Jia
2016-03-23  6:15 ` [PATCH V6 00/15] " Hongxu Jia
2016-03-23  6:15   ` [PATCH V2 01/15] conf/bitbake.conf package.bbclass: fix dbg package not contain sources while -fdebug-prefix-map used Hongxu Jia
2016-03-23 13:40     ` Mark Hatle
2016-03-23 14:15       ` Hongxu Jia
2016-03-23  6:15   ` [PATCH 03/15] fix_buildpaths.bbclass: add bbclass to fix build path 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=d261fd8e069d0cad6d72556fddd1daaaf3daa5fe.1458638728.git.hongxu.jia@windriver.com \
    --to=hongxu.jia@windriver.com \
    --cc=mark.hatle@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.