Gentoo Archives: gentoo-commits

From: "Jauhien Piatlicki (jauhien)" <jauhien@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/rust/files: rust-9999-libdir.patch rust-0.11.0-libdir.patch rust-0.12.0-no-ldconfig.patch 50rust-mode-gentoo.el
Date: Fri, 29 Aug 2014 14:12:32
Message-Id: 20140829141227.74E0142D5@oystercatcher.gentoo.org
1 jauhien 14/08/29 14:12:27
2
3 Modified: rust-0.12.0-no-ldconfig.patch 50rust-mode-gentoo.el
4 Added: rust-9999-libdir.patch rust-0.11.0-libdir.patch
5 Log:
6 Add slotting to rust ebuilds
7
8 Add these slots:
9 (major.minor) rust release
10 (nightly) nightly version
11 (git) git master branch
12
13 Remove old unslotted versions
14
15 (Portage version: 2.2.12/cvs/Linux x86_64, signed Manifest commit with key 0xB2EFA1D4)
16
17 Revision Changes Path
18 1.2 dev-lang/rust/files/rust-0.12.0-no-ldconfig.patch
19
20 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/rust/files/rust-0.12.0-no-ldconfig.patch?rev=1.2&view=markup
21 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/rust/files/rust-0.12.0-no-ldconfig.patch?rev=1.2&content-type=text/plain
22 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/rust/files/rust-0.12.0-no-ldconfig.patch?r1=1.1&r2=1.2
23
24 Index: rust-0.12.0-no-ldconfig.patch
25 ===================================================================
26 RCS file: /var/cvsroot/gentoo-x86/dev-lang/rust/files/rust-0.12.0-no-ldconfig.patch,v
27 retrieving revision 1.1
28 retrieving revision 1.2
29 diff -u -r1.1 -r1.2
30 --- rust-0.12.0-no-ldconfig.patch 31 Jul 2014 14:29:09 -0000 1.1
31 +++ rust-0.12.0-no-ldconfig.patch 29 Aug 2014 14:12:27 -0000 1.2
32 @@ -1,8 +1,6 @@
33 Remove ldconfig(1) execution to prevent the installation script from accessing
34 outside of a sandbox.
35
36 -Author: Heather Cynede
37 -
38 diff --git a/src/etc/install.sh b/src/etc/install.sh
39 index c949743..7c3daa5 100644
40 --- a/src/etc/install.sh
41
42
43
44 1.2 dev-lang/rust/files/50rust-mode-gentoo.el
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/rust/files/50rust-mode-gentoo.el?rev=1.2&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/rust/files/50rust-mode-gentoo.el?rev=1.2&content-type=text/plain
48 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/rust/files/50rust-mode-gentoo.el?r1=1.1&r2=1.2
49
50 Index: 50rust-mode-gentoo.el
51 ===================================================================
52 RCS file: /var/cvsroot/gentoo-x86/dev-lang/rust/files/50rust-mode-gentoo.el,v
53 retrieving revision 1.1
54 retrieving revision 1.2
55 diff -u -r1.1 -r1.2
56 --- 50rust-mode-gentoo.el 18 May 2014 23:46:09 -0000 1.1
57 +++ 50rust-mode-gentoo.el 29 Aug 2014 14:12:27 -0000 1.2
58 @@ -1,2 +1,5 @@
59 +
60 +;;; rust-mode site-lisp configuration
61 +
62 (add-to-list 'load-path "@SITELISP@")
63 (require 'rust-mode)
64
65
66
67 1.1 dev-lang/rust/files/rust-9999-libdir.patch
68
69 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/rust/files/rust-9999-libdir.patch?rev=1.1&view=markup
70 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/rust/files/rust-9999-libdir.patch?rev=1.1&content-type=text/plain
71
72 Index: rust-9999-libdir.patch
73 ===================================================================
74 This patch adds proper support for --libdir configure option
75 See https://github.com/rust-lang/rust/issues/11671 and
76 https://github.com/rust-lang/rust/pull/16552
77
78 diff --git a/configure b/configure
79 index 636d502..fff67b6 100755
80 --- a/configure
81 +++ b/configure
82 @@ -459,6 +459,14 @@ fi
83
84 valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries"
85
86 +case "$CFG_LIBDIR" in
87 + "$CFG_PREFIX"/*) CAT_INC=2;;
88 + "$CFG_PREFIX"*) CAT_INC=1;;
89 + *)
90 + err "libdir must begin with the prefix. Use --prefix to set it accordingly.";;
91 +esac
92 +CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-`
93 +
94 if [ $HELP -eq 1 ]
95 then
96 echo
97 @@ -855,6 +863,15 @@ for h in $CFG_HOST
98 do
99 for t in $CFG_TARGET
100 do
101 + # host lib dir stage0
102 + make_dir $h/stage0/lib
103 +
104 + # target bin dir stage0
105 + make_dir $h/stage0/lib/rustlib/$t/bin
106 +
107 + # target lib dir stage0
108 + make_dir $h/stage0/lib/rustlib/$t/lib
109 +
110 for i in 0 1 2 3
111 do
112 # host bin dir
113 diff --git a/mk/main.mk b/mk/main.mk
114 index 2bdfc1b..bca5b3b 100644
115 --- a/mk/main.mk
116 +++ b/mk/main.mk
117 @@ -311,7 +311,11 @@ define SREQ
118 # Destinations of artifacts for the host compiler
119 HROOT$(1)_H_$(3) = $(3)/stage$(1)
120 HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
121 +ifeq ($(1),0)
122 +HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib
123 +else
124 HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE)
125 +endif
126
127 # Destinations of artifacts for target architectures
128 TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2)
129 diff --git a/src/etc/install.sh b/src/etc/install.sh
130 index c949743..1a472c6 100644
131 --- a/src/etc/install.sh
132 +++ b/src/etc/install.sh
133 @@ -301,9 +301,16 @@ fi
134 flag uninstall "only uninstall from the installation prefix"
135 opt verify 1 "verify that the installed binaries run correctly"
136 valopt prefix "/usr/local" "set installation prefix"
137 -# NB This isn't quite the same definition as in `configure`.
138 -# just using 'lib' instead of CFG_LIBDIR_RELATIVE
139 +# NB This is exactly the same definition as in `configure`.
140 valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries"
141 +case "$CFG_LIBDIR" in
142 + "$CFG_PREFIX"/*) CAT_INC=2;;
143 + "$CFG_PREFIX"*) CAT_INC=1;;
144 + *)
145 + err "libdir must begin with the prefix. Use --prefix to set it accordingly.";;
146 +esac
147 +CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-`
148 +
149 valopt mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
150
151 if [ $HELP -eq 1 ]
152 @@ -428,9 +435,9 @@ while read p; do
153 # Decide the destination of the file
154 FILE_INSTALL_PATH="${CFG_PREFIX}/$p"
155
156 - if echo "$p" | grep "^lib/" > /dev/null
157 + if echo "$p" | grep "^${CFG_LIBDIR_RELATIVE}/" > /dev/null
158 then
159 - pp=`echo $p | sed 's/^lib\///'`
160 + pp=`echo $p | sed "s%^${CFG_LIBDIR_RELATIVE}/%%"`
161 FILE_INSTALL_PATH="${CFG_LIBDIR}/$pp"
162 fi
163
164 diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs
165 index 99b98b6..f3e37ff 100644
166 --- a/src/librustc/metadata/filesearch.rs
167 +++ b/src/librustc/metadata/filesearch.rs
168 @@ -243,10 +243,14 @@ fn find_libdir(sysroot: &Path) -> String {
169 // of the directory where librustc is located, rather than where the rustc
170 // binary is.
171
172 - if sysroot.join(primary_libdir_name()).join(rustlibdir()).exists() {
173 - return primary_libdir_name();
174 - } else {
175 - return secondary_libdir_name();
176 + match option_env!("CFG_LIBDIR_RELATIVE") {
177 + None => if sysroot.join(primary_libdir_name()).join(rustlibdir()).exists() {
178 + return primary_libdir_name();
179 + } else {
180 + return secondary_libdir_name();
181 + },
182 +
183 + Some(libdir) => return libdir.to_string()
184 }
185
186 #[cfg(target_word_size = "64")]
187
188
189
190 1.1 dev-lang/rust/files/rust-0.11.0-libdir.patch
191
192 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/rust/files/rust-0.11.0-libdir.patch?rev=1.1&view=markup
193 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/rust/files/rust-0.11.0-libdir.patch?rev=1.1&content-type=text/plain
194
195 Index: rust-0.11.0-libdir.patch
196 ===================================================================
197 This patch adds proper support for --libdir configure option
198 See https://github.com/rust-lang/rust/issues/11671 and
199 https://github.com/rust-lang/rust/pull/16552
200
201 diff -r -u rust-0.11.0.orig/configure rust-0.11.0/configure
202 --- rust-0.11.0.orig/configure
203 +++ rust-0.11.0/configure
204 @@ -453,6 +453,14 @@
205
206 valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries"
207
208 +case "$CFG_LIBDIR" in
209 + "$CFG_PREFIX"/*) CAT_INC=2;;
210 + "$CFG_PREFIX"*) CAT_INC=1;;
211 + *)
212 + err "libdir must begin with the prefix. Use --prefix to set it accordingly.";;
213 +esac
214 +CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-`
215 +
216 if [ $HELP -eq 1 ]
217 then
218 echo
219 @@ -838,6 +846,15 @@
220 do
221 for t in $CFG_TARGET
222 do
223 + # host lib dir stage0
224 + make_dir $h/stage0/lib
225 +
226 + # target bin dir stage0
227 + make_dir $h/stage0/lib/rustlib/$t/bin
228 +
229 + # target lib dir stage0
230 + make_dir $h/stage0/lib/rustlib/$t/lib
231 +
232 for i in 0 1 2 3
233 do
234 # host bin dir
235 diff -r -u rust-0.11.0.orig/mk/main.mk rust-0.11.0/mk/main.mk
236 --- rust-0.11.0.orig/mk/main.mk
237 +++ rust-0.11.0/mk/main.mk
238 @@ -304,7 +304,11 @@
239 # Destinations of artifacts for the host compiler
240 HROOT$(1)_H_$(3) = $(3)/stage$(1)
241 HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
242 +ifeq ($(1),0)
243 +HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib
244 +else
245 HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE)
246 +endif
247
248 # Destinations of artifacts for target architectures
249 TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2)
250 diff -r -u rust-0.11.0.orig/src/etc/install.sh rust-0.11.0/src/etc/install.sh
251 --- rust-0.11.0.orig/src/etc/install.sh
252 +++ rust-0.11.0/src/etc/install.sh
253 @@ -35,6 +35,13 @@
254 fi
255 }
256
257 +need_cmd() {
258 + if command -v $1 >/dev/null 2>&1
259 + then msg "found $1"
260 + else err "need $1"
261 + fi
262 +}
263 +
264 putvar() {
265 local T
266 eval T=\$$1
267 @@ -198,7 +205,16 @@
268 ABSOLUTIFIED="${FILE_PATH}"
269 }
270
271 -CFG_SRC_DIR="$(cd $(dirname $0) && pwd)/"
272 +msg "looking for install programs"
273 +need_cmd mkdir
274 +need_cmd printf
275 +need_cmd cut
276 +need_cmd grep
277 +need_cmd uname
278 +need_cmd tr
279 +need_cmd sed
280 +
281 +CFG_SRC_DIR="$(cd $(dirname $0) && pwd)"
282 CFG_SELF="$0"
283 CFG_ARGS="$@"
284
285 @@ -216,16 +232,85 @@
286 step_msg "processing $CFG_SELF args"
287 fi
288
289 +# Check for mingw or cygwin in order to special case $CFG_LIBDIR_RELATIVE.
290 +# This logic is duplicated from configure in order to get the correct libdir
291 +# for Windows installs.
292 +CFG_OSTYPE=$(uname -s)
293 +
294 +case $CFG_OSTYPE in
295 +
296 + MINGW32*)
297 + CFG_OSTYPE=pc-mingw32
298 + ;;
299 +
300 + MINGW64*)
301 + # msys2, MSYSTEM=MINGW64
302 + CFG_OSTYPE=w64-mingw32
303 + ;;
304 +
305 +# Thad's Cygwin identifers below
306 +
307 +# Vista 32 bit
308 + CYGWIN_NT-6.0)
309 + CFG_OSTYPE=pc-mingw32
310 + ;;
311 +
312 +# Vista 64 bit
313 + CYGWIN_NT-6.0-WOW64)
314 + CFG_OSTYPE=w64-mingw32
315 + ;;
316 +
317 +# Win 7 32 bit
318 + CYGWIN_NT-6.1)
319 + CFG_OSTYPE=pc-mingw32
320 + ;;
321 +
322 +# Win 7 64 bit
323 + CYGWIN_NT-6.1-WOW64)
324 + CFG_OSTYPE=w64-mingw32
325 + ;;
326 +esac
327 +
328 OPTIONS=""
329 BOOL_OPTIONS=""
330 VAL_OPTIONS=""
331
332 +# On windows we just store the libraries in the bin directory because
333 +# there's no rpath. This is where the build system itself puts libraries;
334 +# --libdir is used to configure the installation directory.
335 +# FIXME: Thise needs to parameterized over target triples. Do it in platform.mk
336 +CFG_LIBDIR_RELATIVE=lib
337 +if [ "$CFG_OSTYPE" = "pc-mingw32" ] || [ "$CFG_OSTYPE" = "w64-mingw32" ]
338 +then
339 + CFG_LIBDIR_RELATIVE=bin
340 +fi
341 +
342 +if [ "$CFG_OSTYPE" = "pc-mingw32" ] || [ "$CFG_OSTYPE" = "w64-mingw32" ]
343 +then
344 + CFG_LD_PATH_VAR=PATH
345 + CFG_OLD_LD_PATH_VAR=$PATH
346 +elif [ "$CFG_OSTYPE" = "Darwin" ]
347 +then
348 + CFG_LD_PATH_VAR=DYLD_LIBRARY_PATH
349 + CFG_OLD_LD_PATH_VAR=$DYLD_LIBRARY_PATH
350 +else
351 + CFG_LD_PATH_VAR=LD_LIBRARY_PATH
352 + CFG_OLD_LD_PATH_VAR=$LD_LIBRARY_PATH
353 +fi
354 +
355 flag uninstall "only uninstall from the installation prefix"
356 opt verify 1 "verify that the installed binaries run correctly"
357 valopt prefix "/usr/local" "set installation prefix"
358 -# NB This isn't quite the same definition as in `configure`.
359 -# just using 'lib' instead of CFG_LIBDIR_RELATIVE
360 -valopt libdir "${CFG_PREFIX}/lib" "install libraries"
361 +# NB This is exactly the same definition as in `configure`.
362 +valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries"
363 +case "$CFG_LIBDIR" in
364 + "$CFG_PREFIX"/*) CAT_INC=2;;
365 + "$CFG_PREFIX"*) CAT_INC=1;;
366 + *)
367 + err "libdir must begin with the prefix. Use --prefix to set it accordingly.";;
368 +esac
369 +CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-`
370 +
371 valopt mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
372
373 if [ $HELP -eq 1 ]
374 @@ -247,11 +332,13 @@
375 if [ -z "${CFG_UNINSTALL}" ]
376 then
377 msg "verifying platform can run binaries"
378 + export $CFG_LD_PATH_VAR="${CFG_SRC_DIR}/lib":$CFG_OLD_LD_PATH_VAR
379 "${CFG_SRC_DIR}/bin/rustc" --version > /dev/null
380 if [ $? -ne 0 ]
381 then
382 err "can't execute rustc binary on this platform"
383 fi
384 + export $CFG_LD_PATH_VAR=$CFG_OLD_LD_PATH_VAR
385 fi
386 fi
387
388 @@ -348,9 +435,9 @@
389 # Decide the destination of the file
390 FILE_INSTALL_PATH="${CFG_PREFIX}/$p"
391
392 - if echo "$p" | grep "^lib/" > /dev/null
393 + if echo "$p" | grep "^${CFG_LIBDIR_RELATIVE}/" > /dev/null
394 then
395 - pp=`echo $p | sed 's/^lib\///'`
396 + pp=`echo $p | sed "s%^${CFG_LIBDIR_RELATIVE}/%%"`
397 FILE_INSTALL_PATH="${CFG_LIBDIR}/$pp"
398 fi
399
400 @@ -384,24 +471,36 @@
401 need_ok "failed to update manifest"
402
403 # The manifest lists all files to install
404 -done < "${CFG_SRC_DIR}/lib/rustlib/manifest.in"
405 +done < "${CFG_SRC_DIR}/${CFG_LIBDIR_RELATIVE}/rustlib/manifest.in"
406
407 # Sanity check: can we run the installed binaries?
408 +#
409 +# As with the verification above, make sure the right LD_LIBRARY_PATH-equivalent
410 +# is in place. Try first without this variable, and if that fails try again with
411 +# the variable. If the second time tries, print a hopefully helpful message to
412 +# add something to the appropriate environment variable.
413 if [ -z "${CFG_DISABLE_VERIFY}" ]
414 then
415 msg "verifying installed binaries are executable"
416 - "${CFG_PREFIX}/bin/rustc" --version > /dev/null
417 + "${CFG_PREFIX}/bin/rustc" --version 2> /dev/null 1> /dev/null
418 if [ $? -ne 0 ]
419 then
420 - ERR="can't execute installed rustc binary. "
421 - ERR="${ERR}installation may be broken. "
422 - ERR="${ERR}if this is expected then rerun install.sh with \`--disable-verify\` "
423 - ERR="${ERR}or \`make install\` with \`--disable-verify-install\`"
424 - err "${ERR}"
425 + export $CFG_LD_PATH_VAR="${CFG_PREFIX}/lib":$CFG_OLD_LD_PATH_VAR
426 + "${CFG_PREFIX}/bin/rustc" --version > /dev/null
427 + if [ $? -ne 0 ]
428 + then
429 + ERR="can't execute installed rustc binary. "
430 + ERR="${ERR}installation may be broken. "
431 + ERR="${ERR}if this is expected then rerun install.sh with \`--disable-verify\` "
432 + ERR="${ERR}or \`make install\` with \`--disable-verify-install\`"
433 + err "${ERR}"
434 + else
435 + echo
436 + echo " Note: please ensure '${CFG_PREFIX}/lib' is added to ${CFG_LD_PATH_VAR}"
437 + fi
438 fi
439 fi
440
441 -
442 echo
443 echo " Rust is ready to roll."
444 echo
445 diff -r -u rust-0.11.0.orig/src/librustc/metadata/filesearch.rs rust-0.11.0/src/librustc/metadata/filesearch.rs
446 --- rust-0.11.0.orig/src/librustc/metadata/filesearch.rs
447 +++ rust-0.11.0/src/librustc/metadata/filesearch.rs
448 @@ -243,10 +243,14 @@
449 // of the directory where librustc is located, rather than where the rustc
450 // binary is.
451
452 - if sysroot.join(primary_libdir_name()).join(rustlibdir()).exists() {
453 - return primary_libdir_name();
454 - } else {
455 - return secondary_libdir_name();
456 + match option_env!("CFG_LIBDIR_RELATIVE") {
457 + None => if sysroot.join(primary_libdir_name()).join(rustlibdir()).exists() {
458 + return primary_libdir_name();
459 + } else {
460 + return secondary_libdir_name();
461 + },
462 +
463 + Some(libdir) => return libdir.to_string()
464 }
465
466 #[cfg(target_word_size = "64")]