Gentoo Archives: gentoo-commits

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: eclass/
Date: Fri, 22 Jun 2018 13:16:12
Message-Id: 1529673241.6f2711db74877064b9be3c3ef6b5555515f720c2.haubi@gentoo
1 commit: 6f2711db74877064b9be3c3ef6b5555515f720c2
2 Author: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jun 22 13:14:01 2018 +0000
4 Commit: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 22 13:14:01 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=6f2711db
7
8 toolchain.eclass: support EAPI 7 paths, update cygwin patching
9
10 eclass/toolchain.eclass | 58 ++++++++++++++++++++++++++++---------------------
11 1 file changed, 33 insertions(+), 25 deletions(-)
12
13 diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
14 index 097cf772ed..560fe96139 100644
15 --- a/eclass/toolchain.eclass
16 +++ b/eclass/toolchain.eclass
17 @@ -312,6 +312,14 @@ gentoo_urls() {
18 # ten Brugge's bounds-checking patches. If you want to use a patch
19 # for an older gcc version with a new gcc, make sure you set
20 # HTB_GCC_VER to that version of gcc.
21 +#
22 +# CYGWINPORTS_GITREV
23 +# If set, this variable signals that we should apply additional patches
24 +# maintained by upstream Cygwin developers at github/cygwinports/gcc,
25 +# using the specified git commit id there. The list of patches to
26 +# apply is extracted from gcc.cygport, maintained there as well.
27 +# This is done for compilers running on Cygwin, not for cross compilers
28 +# with a Cygwin target.
29 get_gcc_src_uri() {
30 export PATCH_GCC_VER=${PATCH_GCC_VER:-${GCC_RELEASE_VER}}
31 export UCLIBC_GCC_VER=${UCLIBC_GCC_VER:-${PATCH_GCC_VER}}
32 @@ -380,7 +388,8 @@ get_gcc_src_uri() {
33
34 # Cygwin patches from https://github.com/cygwinports/gcc
35 [[ -n ${CYGWINPORTS_GITREV} ]] && \
36 - GCC_SRC_URI+=" elibc_Cygwin? ( https://github.com/cygwinports/gcc/archive/${CYGWINPORTS_GITREV}.zip )"
37 + GCC_SRC_URI+=" elibc_Cygwin? ( https://github.com/cygwinports/gcc/archive/${CYGWINPORTS_GITREV}.tar.gz
38 + -> gcc-cygwinports-${CYGWINPORTS_GITREV}.tar.gz )"
39
40 echo "${GCC_SRC_URI}"
41 }
42 @@ -497,7 +506,7 @@ gcc_quick_unpack() {
43
44 use_if_iuse boundschecking && unpack "bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch.bz2"
45
46 - [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin && unpack "${CYGWINPORTS_GITREV}.zip"
47 + [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin && unpack "gcc-cygwinports-${CYGWINPORTS_GITREV}.tar.gz"
48
49 popd > /dev/null
50 }
51 @@ -682,11 +691,10 @@ do_gcc_CYGWINPORTS_patches() {
52 [[ -n ${CYGWINPORTS_GITREV} ]] || return 0
53 use elibc_Cygwin || return 0
54
55 + local -a patches
56 local p d="${WORKDIR}/gcc-${CYGWINPORTS_GITREV}"
57 - for p in $(
58 - eval "$(sed -ne '/PATCH_URI="/,/"/p' < "${d}"/gcc.cygport)"
59 - echo ${PATCH_URI}
60 - ); do
61 + readarray -t patches < <(sed -e '1,/PATCH_URI="/d;/"/,$d' < "${d}"/gcc.cygport)
62 + for p in ${patches[*]}; do
63 epatch "${d}/${p}"
64 done
65 }
66 @@ -1864,13 +1872,13 @@ toolchain_src_install() {
67
68 cd "${S}"
69 if is_crosscompile; then
70 - rm -rf "${ED}"usr/share/{man,info}
71 + rm -rf "${ED}"/usr/share/{man,info}
72 rm -rf "${D}"${DATAPATH}/{man,info}
73 else
74 if tc_version_is_at_least 3.0 ; then
75 local cxx_mandir=$(find "${WORKDIR}/build/${CTARGET}/libstdc++-v3" -name man)
76 if [[ -d ${cxx_mandir} ]] ; then
77 - cp -r "${cxx_mandir}"/man? "${D}/${DATAPATH}"/man/
78 + cp -r "${cxx_mandir}"/man? "${D}${DATAPATH}"/man/
79 fi
80 fi
81 has noinfo ${FEATURES} \
82 @@ -1921,7 +1929,7 @@ toolchain_src_install() {
83 # libvtv.la: gcc itself handles linkage correctly.
84 # lib*san.la: Sanitizer linkage is handled internally by gcc, and they
85 # do not support static linking. #487550 #546700
86 - find "${D}/${LIBPATH}" \
87 + find "${D}${LIBPATH}" \
88 '(' \
89 -name libstdc++.la -o \
90 -name libstdc++fs.la -o \
91 @@ -1943,7 +1951,7 @@ toolchain_src_install() {
92 # Use gid of 0 because some stupid ports don't have
93 # the group 'root' set to gid 0. Send to /dev/null
94 # for people who are testing as non-root.
95 - chown -R ${PORTAGE_INST_UID:-0}:${PORTAGE_INST_GID:-0} "${ED}"${LIBPATH} 2>/dev/null
96 + chown -R ${PORTAGE_INST_UID:-0}:${PORTAGE_INST_GID:-0} "${D}${LIBPATH}" 2>/dev/null
97
98 # Move pretty-printers to gdb datadir to shut ldconfig up
99 local py gdbdir=/usr/share/gdb/auto-load${LIBPATH/\/lib\//\/$(get_libdir)\/}
100 @@ -1987,7 +1995,7 @@ gcc_movelibs() {
101 # code to run on the target.
102 if tc_version_is_at_least 5 && is_crosscompile ; then
103 dodir "${HOSTLIBPATH#${EPREFIX}}"
104 - mv "${ED}"usr/$(get_libdir)/libcc1* "${D}${HOSTLIBPATH}" || die
105 + mv "${ED}"/usr/$(get_libdir)/libcc1* "${D}${HOSTLIBPATH}" || die
106 fi
107
108 # For all the libs that are built for CTARGET, move them into the
109 @@ -2184,7 +2192,7 @@ gcc_slot_java() {
110
111 toolchain_pkg_postinst() {
112 do_gcc_config
113 - if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
114 + if [[ ! ${ROOT%/} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
115 eselect compiler-shadow update all
116 fi
117
118 @@ -2199,17 +2207,17 @@ toolchain_pkg_postinst() {
119 echo
120
121 # Clean up old paths
122 - rm -f "${EROOT}"*/rcscripts/awk/fixlafiles.awk "${EROOT}"sbin/fix_libtool_files.sh
123 - rmdir "${EROOT}"*/rcscripts{/awk,} 2>/dev/null
124 + rm -f "${EROOT%/}"/*/rcscripts/awk/fixlafiles.awk "${EROOT%/}"/sbin/fix_libtool_files.sh
125 + rmdir "${EROOT%/}"/*/rcscripts{/awk,} 2>/dev/null
126
127 - mkdir -p "${EROOT}"usr/{share/gcc-data,sbin,bin}
128 + mkdir -p "${EROOT%/}"/usr/{share/gcc-data,sbin,bin}
129 # DATAPATH has EPREFIX already, use ROOT with it
130 - cp "${ROOT}${DATAPATH}"/fixlafiles.awk "${EROOT}"usr/share/gcc-data/ || die
131 - cp "${ROOT}${DATAPATH}"/fix_libtool_files.sh "${EROOT}"usr/sbin/ || die
132 + cp "${ROOT%/}${DATAPATH}"/fixlafiles.awk "${EROOT%/}"/usr/share/gcc-data/ || die
133 + cp "${ROOT%/}${DATAPATH}"/fix_libtool_files.sh "${EROOT%/}"/usr/sbin/ || die
134
135 # Since these aren't critical files and portage sucks with
136 # handling of binpkgs, don't require these to be found
137 - cp "${ROOT}${DATAPATH}"/c{89,99} "${EROOT}"usr/bin/ 2>/dev/null
138 + cp "${ROOT%/}${DATAPATH}"/c{89,99} "${EROOT%/}"/usr/bin/ 2>/dev/null
139 fi
140
141 if use regression-test ; then
142 @@ -2225,7 +2233,7 @@ toolchain_pkg_postinst() {
143 }
144
145 toolchain_pkg_postrm() {
146 - if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
147 + if [[ ! ${ROOT%/} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
148 eselect compiler-shadow clean all
149 fi
150
151 @@ -2236,16 +2244,16 @@ toolchain_pkg_postrm() {
152
153 # clean up the cruft left behind by cross-compilers
154 if is_crosscompile ; then
155 - if [[ -z $(ls "${EROOT}"etc/env.d/gcc/${CTARGET}* 2>/dev/null) ]] ; then
156 - rm -f "${EROOT}"etc/env.d/gcc/config-${CTARGET}
157 - rm -f "${EROOT}"etc/env.d/??gcc-${CTARGET}
158 - rm -f "${EROOT}"usr/bin/${CTARGET}-{gcc,{g,c}++}{,32,64}
159 + if [[ -z $(ls "${EROOT%/}"/etc/env.d/gcc/${CTARGET}* 2>/dev/null) ]] ; then
160 + rm -f "${EROOT%/}"/etc/env.d/gcc/config-${CTARGET}
161 + rm -f "${EROOT%/}"/etc/env.d/??gcc-${CTARGET}
162 + rm -f "${EROOT%/}"/usr/bin/${CTARGET}-{gcc,{g,c}++}{,32,64}
163 fi
164 return 0
165 fi
166
167 # ROOT isnt handled by the script
168 - [[ ${ROOT} != "/" ]] && return 0
169 + [[ ${ROOT%/} ]] && return 0
170
171 if [[ ! -e ${LIBPATH}/libstdc++.so ]] ; then
172 # make sure the profile is sane during same-slot upgrade #289403
173 @@ -2278,7 +2286,7 @@ do_gcc_config() {
174 [[ -n ${current_specs} ]] && use_specs=-${current_specs}
175
176 if [[ -n ${use_specs} ]] && \
177 - [[ ! -e ${ROOT}/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}${use_specs} ]]
178 + [[ ! -e ${EROOT%/}/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}${use_specs} ]]
179 then
180 ewarn "The currently selected specs-specific gcc config,"
181 ewarn "${current_specs}, doesn't exist anymore. This is usually"