public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] Implement host dependencies and targetroot USE flag
@ 2012-09-24  1:38 Ambroz Bizjak
  2012-09-24  1:38 ` Ambroz Bizjak
  0 siblings, 1 reply; 7+ messages in thread
From: Ambroz Bizjak @ 2012-09-24  1:38 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Ambroz Bizjak

This patch implements host dependencies (HDEPEND) and dependencies only in affect when ROOT != / (targetroot USE flag).

See: https://bugs.gentoo.org/show_bug.cgi?id=317337
See: http://thread.gmane.org/gmane.linux.gentoo.devel/80315

This fuctionality is only enabled for EAPI=5-hdepend and should not affect other EAPIs. Changes:

1. HDEPEND dependencies. These are build-time dependencies which have to be installed on the build machine (host, ROOT=/).

2. DEPEND dependencies now always refer to packages in ROOT (target); destination of DEPEND is no longer determined by --root-deps.

3. targetroot USE flag. This is a special USE flag which is automatically enabled when the ROOT for a package is different than /. The primary use case for this is to make a package depend on itself in order to cross-compile. The dependency needs to be conditional otherwise the package may not be installable for ROOT=/.

The flag still needs to be added to IUSE to work. Example:

EAPI=5-hdepend
IUSE="... targetroot ..."
HDEPEND="....
         targetroot? ( ~${CATEGORY}/${P} )"

Also, the flag is implemented such that it is not considered by --newuse, which makes sure that emerge from within the target system will not attempt to rebuild every cross-compiled package.

I've tested this patch with packages in my cross-compile overlay which contains some packages using the new support:
http://code.google.com/p/ambro-cross-overlay/


 bin/ebuild.sh                        | 30 +++++++++++++++-----
 pym/_emerge/depgraph.py              | 55 +++++++++++++++++++++---------------
 pym/_emerge/main.py                  |  1 -
 pym/portage/__init__.py              |  4 +--
 pym/portage/dbapi/bintree.py         |  6 ++--
 pym/portage/dbapi/porttree.py        |  2 +-
 pym/portage/dbapi/vartree.py         |  1 +
 pym/portage/eapi.py                  |  3 +-
 pym/portage/package/ebuild/config.py | 11 +++++++-
 9 files changed, 76 insertions(+), 37 deletions(-)


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [gentoo-portage-dev] [PATCH] Implement host dependencies and targetroot USE flag
@ 2012-09-24  2:06 Ambroz Bizjak
  0 siblings, 0 replies; 7+ messages in thread
From: Ambroz Bizjak @ 2012-09-24  2:06 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Ambroz Bizjak

Update: added eapi_has_hdepend() and eapi_has_targetroot() to pym/portage/eapi.py to reduce the number of times "5-hdepend" appears in the code.

 bin/ebuild.sh                        | 30 ++++++++++++++-----
 pym/_emerge/depgraph.py              | 57 +++++++++++++++++++++---------------
 pym/_emerge/main.py                  |  1 -
 pym/portage/__init__.py              |  4 +--
 pym/portage/dbapi/bintree.py         |  6 ++--
 pym/portage/dbapi/porttree.py        |  2 +-
 pym/portage/dbapi/vartree.py         |  1 +
 pym/portage/eapi.py                  |  9 +++++-
 pym/portage/package/ebuild/config.py | 14 +++++++--
 9 files changed, 85 insertions(+), 39 deletions(-)



^ permalink raw reply	[flat|nested] 7+ messages in thread
* [gentoo-portage-dev] [PATCH] Implement host dependencies and targetroot USE flag
@ 2012-09-24 10:11 Ambroz Bizjak
  2012-09-24 10:11 ` Ambroz Bizjak
  2012-09-24 17:01 ` Mike Frysinger
  0 siblings, 2 replies; 7+ messages in thread
From: Ambroz Bizjak @ 2012-09-24 10:11 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Ambroz Bizjak

> case ${EAPI} in
But then, there are two other places in ebuild.sh using "case EAPI" and they both look exactly like mine. Updated patch changes all of them.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-09-24 21:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-24  1:38 [gentoo-portage-dev] [PATCH] Implement host dependencies and targetroot USE flag Ambroz Bizjak
2012-09-24  1:38 ` Ambroz Bizjak
  -- strict thread matches above, loose matches on Subject: below --
2012-09-24  2:06 Ambroz Bizjak
2012-09-24 10:11 Ambroz Bizjak
2012-09-24 10:11 ` Ambroz Bizjak
2012-09-24 20:18   ` Zac Medico
2012-09-24 17:01 ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox