Gentoo Archives: gentoo-dev

From: "Jorge Manuel B. S. Vicetto" <jmbsvicetto@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] FHS compliant KDE install and multi-version support
Date: Sun, 07 Sep 2008 02:05:21
Message-Id: 48C336D3.3030405@gentoo.org
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Hello.
5
6 Some members of the KDE team have been talking for some time about
7 having a FHS compliant install (define KDE prefix as /usr instead of
8 /usr/kde/<version>). The most important consequence of that option is
9 that it won't be possible to have 2 or more KDE versions installed at
10 the same time - it's important to note this restriction doesn't affect
11 kde-3.5 as it uses different eclasses that install it under /usr/kde/3.5
12 and the live version as everyone on the team seems to agree that it
13 should always be installed into /usr/kde/<live-version>.
14 We've been trying to find a way that will allow users to do an FHS
15 compliant install if they want it, while at the same time still allowing
16 those that are not interested in it to keep using the current scheme.
17 Our first attempt was to use a multislot use flag[1]. According to that
18 flag, we would set the SLOT and the PREFIX for the install. That has the
19 a very important problem - it breaks the invariancy of the SLOT and as
20 thus been put aside.
21 The next step was to use a kdeprefix use flag[2]. This flag no longer
22 touches the SLOT that is set to "4" for all kde-4.X versions. It only
23 determines if the package will be installed under the FHS compliant
24 location (/usr) or under the old location (/usr/kde/<version>). This
25 however means the users will no longer have the option to have more than
26 one kde-4.X version installed.
27 I've been thinking on a different method. With this method [3], we would
28 keep using the <major>.<minor> slots (4.1, 4.2, etc) so we also wouldn't
29 break the invariancy. We would allow users to select whether to have an
30 FHS compliant install or not (the way to allow that still needs to be
31 discussed) and we would set the prefix based on that. In case the user
32 wants an FHS compliant install, the eclasses would block all kde
33 packages on other slots - except 3.5 (uses other eclasses) and the live
34 versions (for the above reason that it will always be installed under
35 /usr/kde/<live-version>). One way to decide whether to install on an FHS
36 compliant location would be to add a use flag, but I don't think adding
37 that flag for 200+ ebuilds makes sense as it doesn't make sense to have
38 1 version of some packages and possibly 2 or more of other packages.
39
40 So, what am I after in this email? After having an internal discussion
41 and then opening it up to users in #gentoo-kde and a few other people on
42 #gentoo-portage, it was suggested I sent a mail here to open this
43 discussion to everyone and to present the case in a more clear manner.
44 So, can anyone suggest a good way to accomplish what were trying to do?
45 At least a better solution than the ones I've presented above? I would
46 also welcome suggestions on how to configure if the user wants an FHS
47 compliant install or not (I've thought about setting this var on /etc).
48 In case someone is thinking on suggesting it, ignoring FHS or not
49 allowing the install of multiple versions are not valid solutions to
50 this problem.
51
52
53 ~ [1] - The commit where it was added was
54 http://git.overlays.gentoo.org/gitweb/?p=proj/kde.git;a=commitdiff;h=e3a8156bd504e4a377d4eedee123252136da821d
55
56 It boiled down to the following:
57
58 # setting the slot dep
59 ~ if [[ "${KDEBASE}" == "kde-base" ]]; then
60 ~ case ${PV} in
61 ~ 3.9*) _kdedir="3.9" ;;
62 - - 4.0.8*| 4.0.9* | 4.1*) _kdedir="4.1"
63 - - _pv="-${PV}:4.1" ;;
64 + 4.0.8*| 4.0.9* | 4.1*)
65 + _kdedir="4.1"
66 + if use multislot; then
67 + _pv="-${PV}:4.1"
68 + else
69 + _pv="-${PV}:4"
70 + fi
71 + ;;
72
73 # setting the prefix
74 - - KDEDIR="/usr/kde/${_kdedir}"
75 - - KDEDIRS="/usr:/usr/local:${KDEDIR}"
76 + # If the multislot USE flag is set use multiple slots for minor
77 versions
78 + if use multislot; then
79 + KDEDIR="/usr/kde/${_kdedir}"
80 + KDEDIRS="/usr:/usr/local:${KDEDIR}"
81 + else
82 + KDEDIR="/usr"
83 + KDEDIRS="/usr:/usr/local"
84 + fi
85
86 # setting the slot
87 + # The svn versions always need their own slot
88 ~ if [[ -n ${KDEBASE} ]]; then
89 ~ if [[ ${NEED_KDE} = svn ]]; then
90 ~ SLOT="kde-svn"
91 ~ else
92 - - case ${PV} in
93 - - 4.0.8* | 4.0.9* | 4.1*) SLOT="4.1" ;;
94 - - *) SLOT="kde-4" ;;
95 - - esac
96 + # Assign the slot
97 + if use multislot; then
98 + case ${PV} in
99 + 4.0.8* | 4.0.9* | 4.1*)
100 + SLOT="4.1" ;;
101 + *) SLOT="kde-4" ;;
102 + esac
103 + else
104 + SLOT="4"
105 + fi
106 ~ fi
107 ~ fi
108
109
110 ~ [2] - The commit where it was added was
111 http://git.overlays.gentoo.org/gitweb/?p=proj/kde.git;a=commitdiff;h=e13fabc21a97634c3c9467e02380c99f07f7defe
112
113 It boiled down to the following:
114
115 # setting the slot dep
116 ~ 4.0.8*| 4.0.9* | 4.1*)
117 ~ _kdedir="4.1"
118 - - if use multislot; then
119 - - _pv="-${PV}:4.1"
120 - - else
121 - - _pv="-${PV}:4"
122 - - fi
123 + _pv="-${PV}:4"
124 ~ ;;
125
126 # setting the prefix
127 - - # If the multislot USE flag is set use multiple slots for minor
128 versions
129 - - if use multislot; then
130 + # If the kdeprefix USE flag is set use the /usr/kde/ prefix
131 + if use kdeprefix; then
132 ~ KDEDIR="/usr/kde/${_kdedir}"
133 - - KDEDIRS="/usr:/usr/local:${KDEDIR}"
134 + KDEDIRS=":${KDEDIR}:/usr:/usr/local"
135
136 # setting the slot
137 - - if use multislot; then
138 - - case ${PV} in
139 - - 4.0.8* | 4.0.9* | 4.1*)
140 - - SLOT="4.1" ;;
141 - - *) SLOT="kde-4" ;;
142 - - esac
143 - - else
144 - - SLOT="4"
145 - - fi
146 + case ${PV} in
147 + 4.0.8* | 4.0.9* | 4.1*) SLOT="4" ;;
148 + *) SLOT="kde-4" ;;
149 + esac
150
151 ~ [3] - I haven't commited this anywhere yet, so there's no diff to link to.
152
153 The basic idea is the following though:
154
155 # relevant vars
156 FHS_Install # If set to true the user wants to have KDE installed
157 under /usr and not /usr/kde/<version>
158 KDE_SLOTS # The SLOTS used by KDE (this won't include 3.5 as it
159 uses other eclasses and the live-ebuilds that will use the following
160 var. If there's no reason not to, it will include kde-5.X SLOTS when we
161 get there)
162 KDE_LIVE_SLOTS # The slots for live ebuilds (why a var for this? We
163 currently use kde-svn, but I think we should think on moving to live as
164 KDE is talking about switching to other SCMs, possibly GIT)
165
166 # setting the slot dep
167 ~ if [[ "${KDEBASE}" == "kde-base" ]]; then
168 ~ case ${PV} in
169 ~ 3.9*) _kdedir="3.9" ;;
170 ~ 4.0.8*| 4.0.9* | 4.1*)
171 ~ _kdedir="4.1"
172 ~ _pv="-${PV}:4.1"
173 ~ ;;
174
175 # setting the prefix
176 ~ # If the user wants a FHS compliant install
177 ~ if FHS_Install; then
178 ~ KDEDIR="/usr"
179 ~ KDEDIRS="/usr:/usr/local"
180 ~ else
181 ~ KDEDIR="/usr/kde/${_kdedir}"
182 ~ KDEDIRS="/usr:/usr/local:${KDEDIR}"
183 ~ fi
184
185 # setting the slot
186 ~ case ${PV} in
187 ~ 4.0.8* | 4.0.9* | 4.1*)
188 ~ SLOT="4.1" ;;
189 ~ *) SLOT="kde-4" ;;
190 ~ esac
191
192 # setting the slot vars
193 KDE_SLOTS=( "kde-4" "4.1" )
194 KDE_LIVE_SLOTS=( "kde-svn" )
195
196 # setting the blocks if FHS_Install is set
197 if [[ ${FHS_Install} == "true" ]]; then
198 ~ for KDE_SLOT in ${KDE_SLOTS[@]}; do
199 ~ # block other slots
200 ~ if [[ ${SLOT} != ${KDE_SLOT} ]]; then
201 ~ DEPEND="${DEPEND} !kde-base/*:${KDE_SLOT}"
202 ~ RDEPEND="${RDEPEND} !kde-base/*:${KDE_SLOT}"
203 ~ fi
204 ~ done
205 fi
206
207 - --
208 Regards,
209
210 Jorge Vicetto (jmbsvicetto) - jmbsvicetto at gentoo dot org
211 Gentoo- forums / Userrel / Devrel / SPARC / KDE
212 -----BEGIN PGP SIGNATURE-----
213 Version: GnuPG v2.0.9 (GNU/Linux)
214 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
215
216 iEYEARECAAYFAkjDNtMACgkQcAWygvVEyAJyMQCfYc0wwbiOXp5Bhj3g0m7ddId4
217 wxgAoItXCusO4crG0j8eNLLBqhPtP/u2
218 =C+B6
219 -----END PGP SIGNATURE-----

Replies