Gentoo Archives: gentoo-portage-dev

From: Ambroz Bizjak <ambrop7@×××××.com>
To: gentoo-portage-dev@l.g.o
Cc: Ambroz Bizjak <ambrop7@×××××.com>
Subject: [gentoo-portage-dev] [PATCH] Implement host dependencies and targetroot USE flag
Date: Mon, 24 Sep 2012 03:17:05
Message-Id: 1348450713-20768-1-git-send-email-ambrop7@gmail.com
1 This patch implements host dependencies (HDEPEND) and dependencies only in affect when ROOT != / (targetroot USE flag).
2
3 See: https://bugs.gentoo.org/show_bug.cgi?id=317337
4 See: http://thread.gmane.org/gmane.linux.gentoo.devel/80315
5
6 This fuctionality is only enabled for EAPI=5-hdepend and should not affect other EAPIs. Changes:
7
8 1. HDEPEND dependencies. These are build-time dependencies which have to be installed on the build machine (host, ROOT=/).
9
10 2. DEPEND dependencies now always refer to packages in ROOT (target); destination of DEPEND is no longer determined by --root-deps.
11
12 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=/.
13
14 The flag still needs to be added to IUSE to work. Example:
15
16 EAPI=5-hdepend
17 IUSE="... targetroot ..."
18 HDEPEND="....
19 targetroot? ( ~${CATEGORY}/${P} )"
20
21 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.
22
23 I've tested this patch with packages in my cross-compile overlay which contains some packages using the new support:
24 http://code.google.com/p/ambro-cross-overlay/
25
26
27 bin/ebuild.sh | 30 +++++++++++++++-----
28 pym/_emerge/depgraph.py | 55 +++++++++++++++++++++---------------
29 pym/_emerge/main.py | 1 -
30 pym/portage/__init__.py | 4 +--
31 pym/portage/dbapi/bintree.py | 6 ++--
32 pym/portage/dbapi/porttree.py | 2 +-
33 pym/portage/dbapi/vartree.py | 1 +
34 pym/portage/eapi.py | 3 +-
35 pym/portage/package/ebuild/config.py | 11 +++++++-
36 9 files changed, 76 insertions(+), 37 deletions(-)

Replies

Subject Author
[gentoo-portage-dev] [PATCH] Implement host dependencies and targetroot USE flag Ambroz Bizjak <ambrop7@×××××.com>