1 |
commit: 89a6524e68e3c8ab28aa57ab55b62f86f877cb45 |
2 |
Author: Michael Haubenwallner <haubi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Mar 27 12:56:46 2017 +0000 |
4 |
Commit: Michael Haubenwallner <haubi <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Mar 27 12:56:46 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=89a6524e |
7 |
|
8 |
sys-apps/baselayout-prefix: update prefix-chaining |
9 |
|
10 |
Package-Manager: portage-2.3.3 |
11 |
|
12 |
.../baselayout-prefix-2.2-r5.ebuild | 14 +++++ |
13 |
.../files/baselayout-2.2-prefix-chaining.patch | 61 ++++++++++++++++++++++ |
14 |
2 files changed, 75 insertions(+) |
15 |
|
16 |
diff --git a/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r5.ebuild b/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r5.ebuild |
17 |
index 91de672e773..c6f34fa6a9a 100644 |
18 |
--- a/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r5.ebuild |
19 |
+++ b/sys-apps/baselayout-prefix/baselayout-prefix-2.2-r5.ebuild |
20 |
@@ -13,6 +13,7 @@ SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 |
21 |
|
22 |
LICENSE="GPL-2" |
23 |
SLOT="0" |
24 |
+IUSE="prefix-chaining" |
25 |
KEYWORDS="~arm ~ppc-aix ~x64-cygwin ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt" |
26 |
|
27 |
RDEPEND="sys-apps/gentoo-functions" |
28 |
@@ -27,6 +28,19 @@ pkg_preinst() { |
29 |
rm -f "${EROOT}"/etc/._cfg????_gentoo-release |
30 |
} |
31 |
|
32 |
+src_prepare() { |
33 |
+ if use prefix-chaining; then |
34 |
+ epatch "${FILESDIR}"/baselayout-${PV}-prefix-chaining.patch |
35 |
+ |
36 |
+ # need to set the PKG_CONFIG_PATH globally for this prefix, when |
37 |
+ # chaining is enabled, since pkg-config may not be installed locally, |
38 |
+ # but still .pc files should be found for all RDEPENDable prefixes in |
39 |
+ # the chain. |
40 |
+ echo "PKG_CONFIG_PATH=\"/usr/lib/pkgconfig:/usr/share/pkgconfig\"" >> etc/env.d/00basic |
41 |
+ fi |
42 |
+ default |
43 |
+} |
44 |
+ |
45 |
src_install() { |
46 |
# make functions.sh available in /etc/init.d (from gentoo-functions) |
47 |
# Note: we cannot replace the symlink with a file here, or Portage will |
48 |
|
49 |
diff --git a/sys-apps/baselayout-prefix/files/baselayout-2.2-prefix-chaining.patch b/sys-apps/baselayout-prefix/files/baselayout-2.2-prefix-chaining.patch |
50 |
new file mode 100644 |
51 |
index 00000000000..b6b51b969a8 |
52 |
--- /dev/null |
53 |
+++ b/sys-apps/baselayout-prefix/files/baselayout-2.2-prefix-chaining.patch |
54 |
@@ -0,0 +1,61 @@ |
55 |
+--- baselayout-2.2/etc/profile.orig 2017-03-23 16:46:29.922123300 +0100 |
56 |
++++ baselayout-2.2/etc/profile 2017-03-23 16:58:43.578360900 +0100 |
57 |
+@@ -4,6 +4,40 @@ |
58 |
+ # environment for login shells. |
59 |
+ # |
60 |
+ |
61 |
++# |
62 |
++# for prefix-chaining, the very first thing to do is to load |
63 |
++# the profiles for all chained instances above. |
64 |
++# |
65 |
++# TODO: is it safe in any case to shell source make.conf? |
66 |
++# don't do any recursive expansion here. if the parent can |
67 |
++# use READONLY_EPREFIX's, it has to have the same profile as |
68 |
++# we have here, and thus it will source parents before |
69 |
++# evaluating anything from itself. |
70 |
++# |
71 |
++_ro_root=$(. /etc/make.conf && echo $READONLY_EPREFIX) |
72 |
++_ro_deps=${_ro_root#*:} |
73 |
++_ro_root=${_ro_root%:*} |
74 |
++if [ -n "${_ro_root}" -a -f "${_ro_root}/"etc/profile ]; then |
75 |
++ . "${_ro_root}/"etc/profile |
76 |
++fi |
77 |
++ |
78 |
++# |
79 |
++# With prefix-chaining we want another set of variables that |
80 |
++# should be retained for all prefixes. for example it is ok |
81 |
++# to retain PKG_CONFIG_PATH if the parent of the chain can |
82 |
++# be used to resolve RDEPEND... |
83 |
++# |
84 |
++if [[ -n "${_ro_root}" ]]; then |
85 |
++ _ro_chained_path_vars="PATH MANPATH" |
86 |
++ |
87 |
++ [[ ${_ro_deps} == *RDEPEND* ]] && |
88 |
++ _ro_chained_path_vars="${_ro_chained_path_vars} PKG_CONFIG_PATH" |
89 |
++ |
90 |
++ for var in ${_ro_chained_path_vars}; do |
91 |
++ eval "_ro_backupenv_paths_${var}=\${${var}}" |
92 |
++ done |
93 |
++fi |
94 |
++ |
95 |
+ # Load environment settings from profile.env, which is created by |
96 |
+ # env-update from the files in /etc/env.d |
97 |
+ if [ -e /etc/profile.env ] ; then |
98 |
+@@ -61,3 +95,17 @@ |
99 |
+ [ -r "$sh" ] && . "$sh" |
100 |
+ done |
101 |
+ unset sh |
102 |
++ |
103 |
++# |
104 |
++# finally chain the save variables for previous prefixes in the chain. |
105 |
++# |
106 |
++if [[ -n "${_ro_chained_path_vars}" ]]; then |
107 |
++ for var in ${_ro_chained_path_vars}; do |
108 |
++ eval "export ${var}=\${${var}}:\${_ro_backupenv_paths_${var}}" |
109 |
++ eval "unset _ro_backupenv_paths_${var}" |
110 |
++ done |
111 |
++fi |
112 |
++ |
113 |
++unset _ro_root |
114 |
++unset _ro_deps |
115 |
++unset _ro_chained_path_vars |