Gentoo Archives: gentoo-commits

From: Benda XU <heroxbd@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/heroxbd:master commit in: scripts/
Date: Thu, 31 Oct 2013 04:56:51
Message-Id: 1383195374.1c8d580e785e9f60b1d2ff54ccc9ec3858f09296.heroxbd@gentoo
1 commit: 1c8d580e785e9f60b1d2ff54ccc9ec3858f09296
2 Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 31 04:56:14 2013 +0000
4 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 31 04:56:14 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/heroxbd.git;a=commit;h=1c8d580e
7
8 revert bootstrap script from schoopy, before fully reviewed.
9
10 ---
11 scripts/bootstrap-rap.sh | 190 +++--------------------------------------------
12 1 file changed, 11 insertions(+), 179 deletions(-)
13
14 diff --git a/scripts/bootstrap-rap.sh b/scripts/bootstrap-rap.sh
15 old mode 100644
16 new mode 100755
17 index add2f41..30823d8
18 --- a/scripts/bootstrap-rap.sh
19 +++ b/scripts/bootstrap-rap.sh
20 @@ -367,11 +367,6 @@ bootstrap_tree() {
21 # this is ugly, we have to put the temperory rap overlay somewhere
22 PORTDIR="${PORTDIR_RAP}" \
23 do_tree http://dev.gentoo.org/~heroxbd rap-overlay.tar.bz2
24 -
25 - # Add corrected ebuilds to rap-overlay: perl, portage, openrc
26 - bzip2 -dc "${ROOT}/../rap-overlay-perl.tar.bz2" | $TAR -xf - -C ${PORTDIR_RAP%portage}
27 - bzip2 -dc "${ROOT}/../rap-overlay-openrc.tar.bz2" | $TAR -xf - -C ${PORTDIR_RAP%portage}
28 - bzip2 -dc "${ROOT}/../rap-overlay-portage.tar.bz2" | $TAR -xf - -C ${PORTDIR_RAP%portage}
29 }
30
31 bootstrap_latest_tree() {
32 @@ -591,12 +586,8 @@ bootstrap_gnu() {
33 [[ ${PN} == "coreutils" ]] && \
34 myconf="${myconf} --disable-acl --without-gmp"
35
36 - if [[ ${PN} == "gcc" ]] ; then
37 - myconf="${myconf} --disable-bootstrap --enable-languages=c\
38 - --disable-multilib --with-sysroot=/usr/local/x86_64-linux-gnu/x86_64-linux-gnu/sys-root\
39 - --disable-libssp --disable-libgomp --disable-libquadmath --disable-decimal-float --disable-threads\
40 - --without-ppl --without-cloog "
41 - fi
42 + [[ ${PN} == "gcc" ]] && myconf="${myconf} --disable-bootstrap --enable-languages=c\
43 + --disable-multilib"
44
45 if [[ ${PN} == "coreutils" && ${CHOST} == *-interix* ]] ; then
46 # Interix doesn't have filesystem listing stuff, but that means all
47 @@ -623,11 +614,7 @@ bootstrap_gnu() {
48 if [[ ${PN} == "make" && $(type -t $MAKE) != "file" ]]; then
49 ./build.sh || return 1
50 else
51 - if [[ ${PN} == "gcc" ]] ; then
52 - $MAKE ${MAKEOPTS} gcc_cv_libc_provides_ssp=yes || return 1
53 - else
54 $MAKE ${MAKEOPTS} || return 1
55 - fi
56 fi
57
58 einfo "Installing ${PN}"
59 @@ -945,11 +932,7 @@ bootstrap_stage1() {
60 [[ $(uniq --version 2>&1) == *"(GNU coreutils) "[6789]* ]] \
61 || (bootstrap_coreutils) || return 1
62 [[ $(find --version 2>&1) == *GNU* ]] || (bootstrap_findutils) || return 1
63 -# Synology gives a tar from busybox which does not handle all required options
64 -# [[ $(tar --version 2>&1) == *GNU* ]] ||
65 - (bootstrap_tar) || return 1
66 -# Synology also gives gzip through busybox which does not handle all required options
67 - (bootstrap_gzip) || return 1
68 + [[ $(tar --version 2>&1) == *GNU* ]] || (bootstrap_tar) || return 1
69 [[ $(patch --version 2>&1) == *"GNU patch 2."7* ]] || (bootstrap_patch) || return 1
70 [[ $(grep --version 2>&1) == *GNU* ]] || (bootstrap_grep) || return 1
71 [[ $(awk --version < /dev/null 2>&1) == *GNU* ]] || bootstrap_gawk || return 1
72 @@ -1069,13 +1052,9 @@ bootstrap_stage3() {
73
74 set_profile 1
75 # --oneshot --nodeps
76 - # synology toolchain is still using only sys-root, hence add some to the make.defaults
77 - echo "CFLAGS=-I${ROOT}/usr/include" >> "${PORTDIR_RAP}"/profiles/bootstrap/glibc/make.defaults
78 - echo "LDFLAGS=\"-L${ROOT}/usr/lib64 -Wl,-rpath=${ROOT}/usr/lib64\"" >> "${PORTDIR_RAP}"/profiles/bootstrap/glibc/make.defaults
79 - # export LD_LIBRARY_PATH=${ROOT}/usr/lib64
80 local pkgs=(
81 sys-apps/sed
82 - "<app-shells/bash-4.2_p20" # higher versions requires readline
83 + "<app-shells/bash-4.2_p20" # higher versions require readline
84 app-arch/xz-utils
85 sys-apps/baselayout-prefix
86 sys-devel/m4
87 @@ -1093,11 +1072,6 @@ bootstrap_stage3() {
88
89 emerge_pkgs --nodeps "${pkgs[@]}" || return 1
90
91 - gcc-config -l
92 -
93 - # undo make.defaults change made above
94 - set_profile 1
95 -
96 echo 'int main() {}' > test-rpath.c
97 gcc -o test-rpath test-rpath.c
98 if readelf -d test-rpath | grep -q rpath; then
99 @@ -1120,16 +1094,9 @@ EOF
100 fi
101 fi
102
103 - # inject a link to gcc to /usr/bin/cc
104 - if [[ ! -x "${ROOT}"/usr/bin/cc ]]; then
105 - ln -s $(which gcc) "${ROOT}"/usr/bin/cc
106 - fi
107 -
108 pkgs=( sys-libs/glibc )
109 emerge_pkgs --nodeps "${pkgs[@]}" || return 1
110
111 -# unset LD_LIBRARY_PATH
112 -
113 # in gcc bootstrap stage 1, xgcc/cc1 and friends may be linked against libgcc_s.so of
114 # the old gcc, which cannot be found on new RAP. Append that directory to ld.so.conf
115 # so that our RAP dynamic linker can find it. This will be overwritten by env-update
116 @@ -1168,21 +1135,9 @@ EOF
117 )
118 emerge_pkgs --nodeps "${pkgs[@]}" || return 1
119
120 - # Synology does not have /usr/include
121 - # Python will not be able to build if /usr/include/[sys,netinet] are not found, make a temporary link
122 - if [ ! -d /usr/include ]; then
123 - cat << EOF
124 -Python will not be able to build if /usr/include/[sys,netinet,and others] are not found as well
125 -Make a link from ${ROOT}/usr/include to /usr/include and renew the bootstrap-rap.sh command
126 -to continue from here on.
127 -
128 -EOF
129 - return 1
130 - fi
131 -
132 - # --oneshot
133 + # --oneshot
134 local pkgs=(
135 - "<net-misc/wget-1.14" # otherwise pulls in util-linux which links to perl using gdbm and berkdb that are missing
136 + net-misc/wget
137 sys-apps/acl
138 )
139 emerge_pkgs "" "${pkgs[@]}" || return 1
140 @@ -1197,11 +1152,6 @@ EOF
141 # the -I directions set by the profile
142 export CPPFLAGS="${CPPFLAGS} -DNO_LARGEFILE_SOURCE"
143
144 - # Synology or not ? : you may however encounter error due to missing fetched file python-gentoo-patches-3.2.3-0.tar.bz2
145 - # in such case manually download at http://mirror.meleeweb.net/pub/linux/gentoo/distfiles/python-gentoo-patches-3.2.3-0.tar.bz2
146 - # the same happened for python-gentoo-patches-3.3.2-1.tar.xz, hence we do not ask for it
147 - echo ">=dev-lang/python-3.3" >> "${ROOT}/etc/portage/package.mask"
148 - sed -i -e "1i PYTHON_TARGETS=\"python2_7 python3_2\"" "${ROOT}/etc/portage/make.conf"
149 # disable collision-protect to overwrite the bootstrapped portage
150 FEATURES="-collision-protect" emerge_pkgs "" "sys-apps/portage" || return 1
151
152 @@ -1213,143 +1163,25 @@ EOF
153 fi
154
155 set_profile 2
156 - # Portage should figure out itself what it needs to do, if anything
157 -
158 - ##########################################################################################
159 - # Problem here as the lib directory is not always a symlink. #
160 - # You need to manually move files and create a symlink lib to the correct lib64 or lib32 #
161 - ##########################################################################################
162 -
163 - # Taking off some packages that may either not build correctly or have nothing to do in prefix, even if rap.
164 - cat << __END__ >> "${ROOT}/usr/local/portage/profiles/features/rap/packages"
165 -
166 -# Here we remove packages that default/linux/packages pulls in and have no
167 -# business being in Gentoo Prefix
168 --*sys-apps/busybox
169 -# we keep that one as wget may use it. TS
170 -#-*sys-apps/util-linux
171 -
172 -# This file removes everything from the base profile which is not
173 -# necessary/desired in a prefix environment.
174 --*>=sys-apps/baselayout-2
175 --*net-misc/iputils
176 --*sys-apps/kbd
177 --*sys-process/procps
178 --*sys-process/psmisc
179 --*sys-fs/e2fsprogs
180 --*virtual/dev-manager
181 --*virtual/modutils
182 --*virtual/shadow
183 -
184 -# add back prefix baselayout
185 -*sys-apps/baselayout-prefix
186 -
187 -__END__
188
189 -
190 - # For some obscure reason gettext is required but not installed (msgfmt missing)
191 - USE=-git emerge -u gettext || return 1
192 -
193 - einfo "Emerging system..."
194 - sed -i -e "1i USE=-ssl" "${EPREFIX}"/etc/portage/make.conf
195 + # Portage should figure out itself what it needs to do, if anything
196 USE=-git emerge -u system || return 1
197
198 - # remove anything that we don't need (compilers most likely)
199 - emerge --depclean
200 -
201 - #
202 - #if [[ ! -f ${EPREFIX}/etc/portage/make.conf ]] ; then
203 + if [[ ! -f ${EPREFIX}/etc/portage/make.conf ]] ; then
204 {
205 - echo 'USE="unicode nls -ssl"'
206 + echo 'USE="unicode nls"'
207 echo 'CFLAGS="${CFLAGS} -O2 -pipe"'
208 echo 'CXXFLAGS="${CFLAGS}"'
209 echo "MAKEOPTS=\"${MAKEOPTS}\""
210 - echo "PYTHON_TARGETS=\"python2_7 python3_2\""
211 echo "# be careful with this one, don't just remove it!"
212 echo "PREFIX_DISABLE_GEN_USR_LDSCRIPT=yes"
213 } > "${EPREFIX}"/etc/portage/make.conf
214 - #
215 + fi
216
217 einfo "stage3 successfully finished"
218 }
219
220 bootstrap_interactive() {
221 - # immediately die on platforms that we know are impossible due to
222 - # brain-deadness (Debian/Ubuntu) or extremely hard dependency chains
223 - # (TODO NetBSD/OpenBSD)
224 - case ${CHOST} in
225 - *-linux-gnu)
226 - local toolchain_impossible=
227 - # Figure out if this is Ubuntu...
228 - if [[ $(lsb_release -is 2>/dev/null) == "Ubuntu" ]] ; then
229 - case "$(lsb_release -sr)" in
230 - [456789].*|10.*)
231 - : # good versions
232 - ;;
233 - *)
234 - # Debian/Ubuntu have seriously fscked up their
235 - # toolchain to support their multi-arch crap
236 - # since Natty (11.04) that noone really wants,
237 - # and certainly not upstream. Some details:
238 - # https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/738098
239 - toolchain_impossible="Ubuntu >= 11.04 (Natty)"
240 - ;;
241 - esac
242 - fi
243 - # Figure out if this is Debian
244 - if [[ -e /etc/debian_release ]] ; then
245 - case "$(< /etc/debian_release)" in
246 - hamm/*|slink/*|potato/*|woody/*|sarge/*|etch/*|lenny/*|squeeze/*)
247 - : # good versions
248 - ;;
249 - *)
250 - # Debian introduced their big crap since Wheezy
251 - # (7.0), like for Ubuntu, see above
252 - toolchain_impossible="Debian >= 7.0 (Wheezy)"
253 - ;;
254 - esac
255 - fi
256 - if [[ -n ${toolchain_impossible} ]] ; then
257 - # In short, it's impossible for us to compile a
258 - # compiler, since 1) gcc picks up our ld, which doesn't
259 - # support sysroot (can work around with a wrapper
260 - # script), 2) headers and libs aren't found (symlink
261 - # them to Prefix), 3) stuff like crtX.i isn't found
262 - # during bootstrap, since the bootstrap compiler doesn't
263 - # get any of our flags and doesn't know where to find
264 - # them (even if we copied them). So we cannot do this,
265 - # unless we use the Ubuntu patches in our ebuilds, which
266 - # is a NO-GO area.
267 - cat << EOF
268 -Oh My! ${toolchain_impossible}! AAAAAAAAAAAAAAAAAAAAARGH! HELL comes over me!
269 -
270 -EOF
271 - echo -n "..."
272 - sleep 1
273 - echo -n "."
274 - sleep 1
275 - echo -n "."
276 - sleep 1
277 - echo -n "."
278 - sleep 1
279 - echo
280 - echo
281 - cat << EOF
282 -and over you. You're on the worst Linux distribution from a developer's
283 -(and so Gentoo Prefix) perspective since http://wiki.debian.org/Multiarch/.
284 -Due to this multi-arch idea, it is IMPOSSIBLE for Gentoo Prefix to
285 -bootstrap a compiler without using Debuntu patches, which is an absolute
286 -NO-GO area! GCC and binutils upstreams didn't just reject those patches
287 -for fun.
288 -
289 -I really can't help you, and won't waste any of your time either. The
290 -story simply ends here. Sorry.
291 -EOF
292 - exit 1
293 - fi
294 - ;;
295 - esac
296 -
297 cat <<"EOF"
298
299
300 @@ -1865,7 +1697,7 @@ EOF
301
302 # Don't confuse Portage with a possibly slightly differing CHOST
303 unset CHOST
304 -
305 +
306 if ! emerge -e system ; then
307 # emerge -e system fail
308 cat << EOF