Gentoo Archives: gentoo-commits

From: "Göktürk Yüksek" <gokturk@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/devmanual:master commit in: general-concepts/virtuals/
Date: Tue, 13 Feb 2018 16:46:15
Message-Id: 1518540212.7266aee16fa73086a1d9553ab9129013d83a4761.gokturk@gentoo
1 commit: 7266aee16fa73086a1d9553ab9129013d83a4761
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 12 23:23:30 2018 +0000
4 Commit: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 13 16:43:32 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=7266aee1
7
8 general-concepts/virtuals: Tips on virtual and subslots
9
10 general-concepts/virtuals/text.xml | 80 ++++++++++++++++++++++++++++++++++++++
11 1 file changed, 80 insertions(+)
12
13 diff --git a/general-concepts/virtuals/text.xml b/general-concepts/virtuals/text.xml
14 index 4809394..ff4995a 100644
15 --- a/general-concepts/virtuals/text.xml
16 +++ b/general-concepts/virtuals/text.xml
17 @@ -70,5 +70,85 @@ RDEPEND="|| ( dev-libs/liblinux dev-libs/libbsd )"
18
19 </section>
20
21 +<section>
22 +<title>Virtuals and subslots</title>
23 +
24 +<body>
25 +<warning>
26 +This section is only applicable if virtual providers include versions that
27 +are ABI-compatible with one another (and use matching SONAMEs) and/or
28 +the incompatible providers are being obsoleted.
29 +</warning>
30 +
31 +<p>
32 +Like regular packages, virtuals can define subslots that can be used
33 +to trigger rebuilds of their reverse dependencies. For this to work, a new
34 +version of the virtual is created for each subslot of the providers,
35 +where each version contains dependencies on a specific subslot.
36 +</p>
37 +
38 +<p>
39 +For example, a virtual for different packages providing ABI-compatible
40 +<c>libfoo.so.1</c> libraries could look like the following:
41 +</p>
42 +
43 +<codesample lang="ebuild">
44 +EAPI=6
45 +
46 +DESCRIPTION="Virtual for libfoo.so.1"
47 +SLOT="0/1"
48 +
49 +RDEPEND="
50 + || (
51 + dev-libs/libfoo:0/1
52 + dev-libs/libfoo-alternate:0/1
53 + dev-libs/bigpack:0/libfoo-1+libbar-0
54 + dev-libs/bigpack:0/libfoo-1+libbar-1
55 + )
56 +"
57 +</codesample>
58 +
59 +<p>
60 +Virtuals can also be used when one of the providers is being obsoleted in favor
61 +of another that breaks ABI compatibility while remaining API-compatible. In this
62 +case, multiple versions of the virtual are created, each specifying a single
63 +provider and a unique subslot.
64 +</p>
65 +
66 +<p>
67 +For example, if <c>dev-libs/libfoo</c> (<c>libfoo.so.0</c>) is being replaced
68 +by <c>dev-libs/newfoo</c> (<c>libfoo.so.1</c>), <c>virtual/libfoo-0.ebuild</c>
69 +would contain:
70 +</p>
71 +
72 +<codesample lang="ebuild">
73 +EAPI=6
74 +
75 +DESCRIPTION="Virtual for libfoo.so.0"
76 +SLOT="0/0"
77 +RDEPEND="dev-libs/libfoo:0/0"
78 +</codesample>
79 +
80 +<p>
81 +while <c>virtual/libfoo-1.ebuild</c> would contain:
82 +</p>
83 +
84 +<codesample lang="ebuild">
85 +EAPI=6
86 +
87 +DESCRIPTION="Virtual for libfoo.so.1"
88 +SLOT="0/1"
89 +RDEPEND="dev-libs/newfoo:0/1"
90 +</codesample>
91 +
92 +<note>
93 +In this case, the package manager will naturally want to upgrade
94 +to <c>dev-libs/newfoo</c> whenever possible. Therefore, this solution
95 +is not viable if clean choice between the two providers is desired.
96 +</note>
97 +
98 +</body>
99 +</section>
100 +
101 </chapter>
102 </guide>