Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Stefan Agner <stefan@agner.ch>
To: liu.ming50@gmail.com
Cc: stefan.agner@toradex.com, luka.pivk@toradex.com,
	openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] gdk-pixbuf: export XDG_DATA_DIRS in wrappers
Date: Sun, 03 Mar 2019 11:31:06 +0100	[thread overview]
Message-ID: <bccc6a89cd75d13dfe3fc76e9eb673b6@agner.ch> (raw)
In-Reply-To: <1551604121-5034-1-git-send-email-liu.ming50@gmail.com>

On 03.03.2019 10:08, liu.ming50@gmail.com wrote:
> From: Ming Liu <liu.ming50@gmail.com>
> 
> We need export XDG_DATA_DIRS to be ${STAGING_DATADIR} for gdk-pixbuf*
> wrappers or else they will try to load mime from /usr/share/mime of the
> host machine.

This fixes a build issue I have seen on a Ubuntu 18.04 machine when
building psplash with a custom png splash screen.

ERROR: psplash-0.1+gitAUTOINC+2015f7073e-r15 do_compile: Error executing
a python function in exec_python_func() autogenerated:                  
                                                                 
                                                                        
                                                                        
                                                                 
The stack trace of python calls that resulted in this exception/failure
was:                                                                    
                                                                  
File: 'exec_python_func() autogenerated', lineno: 2, function: <module> 
                                                                        
                                                                 
     0001:                                                              
                                                                        
                                                                 
 *** 0002:do_compile(d)                                                 
                                                                        
                                                                 
     0003:                                                              
                                                                        
                                                                 
File:
'/workdir/oe/build/conf/../../layers/meta-toradex-torizon/recipes-core/psplash/psplash_git.bbappend',
lineno: 34, function: do_compile                                        
                              
     0030:    for localfile, outputfile in zip(localfiles, outputfiles):
                                                                        
                                                                 
     0031:        if localfile.endswith(".png"):                        
                                                                        
                                                                 
     0032:            subprocess.call([ convertscript,
os.path.join(workdir, localfile), 'POKY' ], cwd=workdir)                
                                                                        
          
     0033:            fbase = os.path.splitext(localfile)[0]            
                                                                        
                                                                 
 *** 0034:            shutil.copyfile(os.path.join(workdir, "%s-img.h" %
fbase), destfile)                                                       
                                                                 
     0035:        else:                                                 
                                                                        
                                                                 
     0036:            shutil.copyfile(os.path.join(workdir, localfile),
destfile)                                                               
                                                                  
     0037:        # For some reason just updating the header is not
enough, we have to touch the .c                                         
                                                                      
     0038:        # file in order to get it to rebuild                  
                                                                        
                                                                 
File: '/usr/lib/python3.6/shutil.py', lineno: 120, function: copyfile   
                                                                        
                                                                 
     0116:                                                              
                                                                        
                                                                 
     0117:    if not follow_symlinks and os.path.islink(src):           
                                                                        
                                                                 
     0118:        os.symlink(os.readlink(src), dst)                     
                                                                        
                                                                 
     0119:    else:                                                     
                                                                        
                                                                 
 *** 0120:        with open(src, 'rb') as fsrc:                         
                                                                        
                                                                 
     0121:            with open(dst, 'wb') as fdst:                     
                                                                        
                                                                 
     0122:                copyfileobj(fsrc, fdst)                       
                                                                        
                                                                 
     0123:    return dst                                                
                                                                        
                                                                 
     0124:                                                              
                                                                        
                                                                 
Exception: FileNotFoundError: [Errno 2] No such file or directory:
'/workdir/oe/tmp/work/cortexa7t2hf-neon-torizon-linux-gnueabi/psplash/0.1+gitAUTOINC+2015f7073e-r15/torizon-blue-img.h'


Note that the error is somewhat misleading since the real problem
happened in the convert script, where the header did not get created due
to gdk-pixbuf-csource not recognizing the png file (Couldn't recognize
the image file format for file ..). This patch fixes the problem!

Tested-by: Stefan Agner <stefan.agner@toradex.com>

Thanks Ming for looking into this!

--
Stefan

> 
> Signed-off-by: Ming Liu <liu.ming50@gmail.com>
> ---
>  meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.38.0.bb | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.38.0.bb
> b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.38.0.bb
> index 3a544bd..a5bd7c6 100644
> --- a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.38.0.bb
> +++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.38.0.bb
> @@ -112,19 +112,24 @@ do_install_append_class-native() {
>  	find ${D}${libdir} -name "libpixbufloader-*.la" -exec rm \{\} \;
>  
>  	create_wrapper ${D}/${bindir}/gdk-pixbuf-csource \
> +		XDG_DATA_DIRS=${STAGING_DATADIR} \
>
> 		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
>  
>  	create_wrapper ${D}/${bindir}/gdk-pixbuf-pixdata \
> +		XDG_DATA_DIRS=${STAGING_DATADIR} \
>
> 		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
>  
>  	create_wrapper ${D}/${bindir}/gdk-pixbuf-print-mime-types \
> +		XDG_DATA_DIRS=${STAGING_DATADIR} \
>
> 		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
>  
>  	create_wrapper ${D}/${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
> +		XDG_DATA_DIRS=${STAGING_DATADIR} \
>
> 		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
> \
>  		GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
>  
>  	create_wrapper ${D}/${bindir}/gdk-pixbuf-query-loaders \
> +		XDG_DATA_DIRS=${STAGING_DATADIR} \
>
> 		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
> \
>  		GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
>  }
> -- 
> 2.7.4


      reply	other threads:[~2019-03-03 10:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-03  9:08 [PATCH] gdk-pixbuf: export XDG_DATA_DIRS in wrappers liu.ming50
2019-03-03 10:31 ` Stefan Agner [this message]

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=bccc6a89cd75d13dfe3fc76e9eb673b6@agner.ch \
    --to=stefan@agner.ch \
    --cc=liu.ming50@gmail.com \
    --cc=luka.pivk@toradex.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=stefan.agner@toradex.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox