Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 472224

Summary: x11-libs/libxcb: use python-any-r1 eclass instead of python-single-r1
Product: Gentoo Linux Reporter: Maxim Koltsov (RETIRED) <maksbotan>
Component: Current packagesAssignee: Gentoo X packagers <x11>
Status: RESOLVED FIXED    
Severity: enhancement CC: chewi, dschridde+gentoobugs, gentoobugs, NightNord, nikoli, python
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 500368    
Attachments: Proposed updated ebuild
libxcb-cross-compile.patch

Description Maxim Koltsov (RETIRED) gentoo-dev 2013-06-03 21:06:42 UTC
libxcb uses python only during build-time, so proper eclass for this case is python-any-r1. Please consider my updated ebuild.

Reproducible: Always
Comment 1 Maxim Koltsov (RETIRED) gentoo-dev 2013-06-03 21:09:07 UTC
Created attachment 350012 [details]
Proposed updated ebuild

Please note, that this ebuild has incomplete deps on xcb-proto. As mgorny pointed out, there should be thing like:

> || ( ( python:2.7 libfoo[python_targets_python2_7] ) ... )

I hope a function will be created in python-any-r1.eclass to generate deps of this kind, then I will update the ebuild and it can be commited.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-10 18:43:53 UTC
This has been fixed in libxcb-9999::x11.
Comment 3 David Heidelberg (okias) 2014-01-03 21:41:57 UTC
this should block #496800
Comment 4 James Le Cuirot gentoo-dev 2014-01-14 23:28:32 UTC
I see that mgorny has applied this to libxcb-1.9.3-r1.ebuild but it's not quite right. It's missing ${PYTHON_DEPS} from DEPEND.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-01-15 09:57:18 UTC
(In reply to James Le Cuirot from comment #4)
> I see that mgorny has applied this to libxcb-1.9.3-r1.ebuild but it's not
> quite right. It's missing ${PYTHON_DEPS} from DEPEND.

$(python_gen_any_dep) provides those.
Comment 6 James Le Cuirot gentoo-dev 2014-01-15 10:12:26 UTC
Ah yes, my mistake.
Comment 7 James Le Cuirot gentoo-dev 2014-01-18 20:29:47 UTC
Created attachment 368114 [details, diff]
libxcb-cross-compile.patch

I'll attempt a more helpful contribution this time. I'm trying to make libxcb cross-buildable because it gets pulled into @system if you have the pam and consolekit flags enabled. I believe --host-root should be added to the has_version call. Here's why...

I've been working on some EAPI 5-hdepend ebuilds recently. Ebuilds that depend on x11-proto packages are prime candidates for this. This particular one is slightly less straightforward because of the Python aspect.

As is usually the case with 5-hdepend ebuilds, atoms in RDEPEND that are also in DEPEND stay where they are. libxslt is only used at build time for xsltproc so that's clearly a HDEPEND.

That leaves xcb-proto. I believe it should be split with the MULTILIB_USEDEP flags applying to DEPEND and the PYTHON_USEDEP flags applying to HDEPEND. This is because the headers need to be in ROOT but Python is executed at build time from /. Hence the has_version call should look at / and not ROOT.

If it weren't for the fact that Python is an RDEPEND of xcb-proto, it would not be necessary to have any Python stuff in ROOT at all.

Unfortunately 5-hdepend ebuilds can't go into the tree yet, not least because a whole string of ebuilds don't support it. I'm attaching a patch anyway for anyone who's interested. In the meantime, I work around the x11-proto issue in my own scripts by creating a pkg-config wrapper like this.

# If a package is missing then it's probably because it's a build-only
# dependency so check /. This is not ideal but works in most cases.
"/usr/bin/${0##*/}" "${@}" || PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 /usr/bin/pkg-config "${@}"

This still requires --host-root to be added to libxcb though. It makes sense in either EAPI, especially since the _python_EPYTHON_supported function checks for Python itself in / so could it please could this flag be added?
Comment 8 Chí-Thanh Christopher Nguyễn gentoo-dev 2014-02-11 12:40:07 UTC
This is fixed in 1.9.3-r1 and 1.10

About the cross compilation issue, please open a new bug report.