1 |
aballier 15/05/29 09:49:42 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: libcxx-3.6.1.ebuild |
5 |
Log: |
6 |
bump to keep in sync with llvm releases; code is identical |
7 |
|
8 |
Signed-off-by: Alexis Ballier <aballier@g.o> |
9 |
(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 160F534A) |
10 |
|
11 |
Revision Changes Path |
12 |
1.43 sys-libs/libcxx/ChangeLog |
13 |
|
14 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/libcxx/ChangeLog?rev=1.43&view=markup |
15 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/libcxx/ChangeLog?rev=1.43&content-type=text/plain |
16 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/libcxx/ChangeLog?r1=1.42&r2=1.43 |
17 |
|
18 |
Index: ChangeLog |
19 |
=================================================================== |
20 |
RCS file: /var/cvsroot/gentoo-x86/sys-libs/libcxx/ChangeLog,v |
21 |
retrieving revision 1.42 |
22 |
retrieving revision 1.43 |
23 |
diff -u -r1.42 -r1.43 |
24 |
--- ChangeLog 23 Apr 2015 08:45:26 -0000 1.42 |
25 |
+++ ChangeLog 29 May 2015 09:49:41 -0000 1.43 |
26 |
@@ -1,6 +1,11 @@ |
27 |
# ChangeLog for sys-libs/libcxx |
28 |
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 |
29 |
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcxx/ChangeLog,v 1.42 2015/04/23 08:45:26 aballier Exp $ |
30 |
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcxx/ChangeLog,v 1.43 2015/05/29 09:49:41 aballier Exp $ |
31 |
+ |
32 |
+*libcxx-3.6.1 (29 May 2015) |
33 |
+ |
34 |
+ 29 May 2015; Alexis Ballier <aballier@g.o> +libcxx-3.6.1.ebuild: |
35 |
+ bump to keep in sync with llvm releases; code is identical |
36 |
|
37 |
*libcxx-3.6.0 (23 Apr 2015) |
38 |
|
39 |
|
40 |
|
41 |
|
42 |
1.1 sys-libs/libcxx/libcxx-3.6.1.ebuild |
43 |
|
44 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/libcxx/libcxx-3.6.1.ebuild?rev=1.1&view=markup |
45 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/libcxx/libcxx-3.6.1.ebuild?rev=1.1&content-type=text/plain |
46 |
|
47 |
Index: libcxx-3.6.1.ebuild |
48 |
=================================================================== |
49 |
# Copyright 1999-2015 Gentoo Foundation |
50 |
# Distributed under the terms of the GNU General Public License v2 |
51 |
# $Header: /var/cvsroot/gentoo-x86/sys-libs/libcxx/libcxx-3.6.1.ebuild,v 1.1 2015/05/29 09:49:41 aballier Exp $ |
52 |
|
53 |
EAPI=5 |
54 |
|
55 |
ESVN_REPO_URI="http://llvm.org/svn/llvm-project/libcxx/trunk" |
56 |
|
57 |
[ "${PV%9999}" != "${PV}" ] && SCM="subversion" || SCM="" |
58 |
|
59 |
inherit ${SCM} flag-o-matic toolchain-funcs multilib multilib-minimal |
60 |
|
61 |
DESCRIPTION="New implementation of the C++ standard library, targeting C++11" |
62 |
HOMEPAGE="http://libcxx.llvm.org/" |
63 |
if [ "${PV%9999}" = "${PV}" ] ; then |
64 |
SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.xz" |
65 |
S="${WORKDIR}/${P}.src" |
66 |
else |
67 |
SRC_URI="" |
68 |
fi |
69 |
|
70 |
LICENSE="|| ( UoI-NCSA MIT )" |
71 |
SLOT="0" |
72 |
if [ "${PV%9999}" = "${PV}" ] ; then |
73 |
KEYWORDS="~amd64 ~mips ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux" |
74 |
else |
75 |
KEYWORDS="" |
76 |
fi |
77 |
IUSE="elibc_glibc +libcxxrt +static-libs test" |
78 |
|
79 |
RDEPEND="libcxxrt? ( >=sys-libs/libcxxrt-0.0_p20130725[static-libs?,${MULTILIB_USEDEP}] ) |
80 |
!libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] )" |
81 |
DEPEND="${RDEPEND} |
82 |
test? ( sys-devel/clang ) |
83 |
app-arch/xz-utils" |
84 |
|
85 |
DOCS=( CREDITS.TXT ) |
86 |
|
87 |
pkg_setup() { |
88 |
if ! use libcxxrt ; then |
89 |
ewarn "You have disabled USE=libcxxrt. This will build ${PN} against" |
90 |
ewarn "libsupc++. Please note that this is not well supported." |
91 |
ewarn "In particular, static linking will not work." |
92 |
fi |
93 |
if [[ $(gcc-version) < 4.7 ]] && [[ $(tc-getCXX) != *clang++* ]] ; then |
94 |
eerror "${PN} needs to be built with clang++ or gcc-4.7 or later." |
95 |
eerror "Please use gcc-config to switch to gcc-4.7 or later version." |
96 |
die |
97 |
fi |
98 |
} |
99 |
|
100 |
src_prepare() { |
101 |
cp -f "${FILESDIR}/Makefile" lib/ || die |
102 |
multilib_copy_sources |
103 |
} |
104 |
|
105 |
src_configure() { |
106 |
export LIBS="-lpthread -lrt -lc -lgcc_s" |
107 |
if use libcxxrt ; then |
108 |
append-cppflags -DLIBCXXRT "-I${EPREFIX}/usr/include/libcxxrt/" |
109 |
LIBS="-lcxxrt ${LIBS}" |
110 |
cp "${EPREFIX}/usr/include/libcxxrt/"*.h "${S}/include" |
111 |
else |
112 |
# Very hackish, see $HOMEPAGE |
113 |
# If someone has a clever idea, please share it! |
114 |
local includes="$(echo | ${CHOST}-g++ -Wp,-v -x c++ - -fsyntax-only 2>&1 | grep -C 2 '#include.*<...>' | tail -n 2 | sed -e 's/^ /-I/' | tr '\n' ' ')" |
115 |
local libcxx_gcc_dirs="$(echo | ${CHOST}-g++ -Wp,-v -x c++ - -fsyntax-only 2>&1 | grep -C 2 '#include.*<...>' | tail -n 2 | tr '\n' ' ')" |
116 |
append-cppflags -D__GLIBCXX__ ${includes} |
117 |
LIBS="-lsupc++ ${LIBS}" |
118 |
local libsupcxx_includes="cxxabi.h bits/c++config.h bits/os_defines.h bits/cpu_defines.h bits/cxxabi_tweaks.h bits/cxxabi_forced.h" |
119 |
for i in ${libsupcxx_includes} ; do |
120 |
local found="" |
121 |
[ -d "${S}/include/$(dirname ${i})/" ] || mkdir -p "${S}/include/$(dirname ${i})" |
122 |
for j in ${libcxx_gcc_dirs} ; do |
123 |
if [ -f "${j}/${i}" ] ; then |
124 |
cp "${j}/${i}" "${S}/include/$(dirname ${i})/" || die |
125 |
found=yes |
126 |
fi |
127 |
done |
128 |
[ -n "${found}" ] || die "Header not found: ${i}" |
129 |
done |
130 |
fi |
131 |
|
132 |
tc-export AR CC CXX |
133 |
|
134 |
append-ldflags "-Wl,-z,defs" # make sure we are not underlinked |
135 |
} |
136 |
|
137 |
multilib_src_compile() { |
138 |
cd "${BUILD_DIR}/lib" || die |
139 |
emake shared |
140 |
use static-libs && emake static |
141 |
} |
142 |
|
143 |
# Tests fail for now, if anybody is able to fix them, help is very welcome. |
144 |
multilib_src_test() { |
145 |
cd "${BUILD_DIR}/test" |
146 |
LD_LIBRARY_PATH="${BUILD_DIR}/lib:${LD_LIBRARY_PATH}" \ |
147 |
CC="clang++ $(get_abi_CFLAGS) ${CXXFLAGS}" \ |
148 |
HEADER_INCLUDE="-I${BUILD_DIR}/include" \ |
149 |
SOURCE_LIB="-L${BUILD_DIR}/lib" \ |
150 |
LIBS="-lm $(usex libcxxrt -lcxxrt "")" \ |
151 |
./testit || die |
152 |
# TODO: fix link against libsupc++ |
153 |
} |
154 |
|
155 |
# Usage: deps |
156 |
gen_ldscript() { |
157 |
local output_format |
158 |
output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') |
159 |
[[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" |
160 |
|
161 |
cat <<-END_LDSCRIPT |
162 |
/* GNU ld script |
163 |
Include missing dependencies |
164 |
*/ |
165 |
${output_format} |
166 |
GROUP ( $@ ) |
167 |
END_LDSCRIPT |
168 |
} |
169 |
|
170 |
gen_static_ldscript() { |
171 |
if use libcxxrt ; then |
172 |
# Move it first. |
173 |
mv "${ED}/usr/$(get_libdir)/libc++.a" "${ED}/usr/$(get_libdir)/libc++_static.a" || die |
174 |
|
175 |
# Generate libc++.a ldscript for inclusion of its dependencies so that |
176 |
# clang++ -stdlib=libc++ -static works out of the box. |
177 |
local deps="${EPREFIX}/usr/$(get_libdir)/libc++_static.a ${EPREFIX}/usr/$(get_libdir)/libcxxrt.a" |
178 |
# On Linux/glibc it does not link without libpthread or libdl. It is |
179 |
# fine on FreeBSD. |
180 |
use elibc_glibc && deps="${deps} ${EPREFIX}/usr/$(get_libdir)/libpthread.a ${EPREFIX}/usr/$(get_libdir)/libdl.a" |
181 |
|
182 |
gen_ldscript "${deps}" > "${ED}/usr/$(get_libdir)/libc++.a" |
183 |
fi |
184 |
# TODO: Generate a libc++.a ldscript when building against libsupc++ |
185 |
} |
186 |
|
187 |
gen_shared_ldscript() { |
188 |
if use libcxxrt ; then |
189 |
mv "${ED}/usr/$(get_libdir)/libc++.so" "${ED}/usr/$(get_libdir)/libc++_shared.so" || die |
190 |
local deps="${EPREFIX}/usr/$(get_libdir)/libc++_shared.so ${EPREFIX}/usr/$(get_libdir)/libcxxrt.so" |
191 |
gen_ldscript "${deps}" > "${ED}/usr/$(get_libdir)/libc++.so" |
192 |
fi |
193 |
# TODO: Generate the linker script for other confiurations too. |
194 |
} |
195 |
|
196 |
multilib_src_install() { |
197 |
cd "${BUILD_DIR}/lib" |
198 |
if use static-libs ; then |
199 |
dolib.a libc++.a |
200 |
gen_static_ldscript |
201 |
fi |
202 |
dolib.so libc++.so* |
203 |
gen_shared_ldscript |
204 |
} |
205 |
|
206 |
multilib_src_install_all() { |
207 |
einstalldocs |
208 |
insinto /usr/include/c++/v1 |
209 |
doins -r include/* |
210 |
} |
211 |
|
212 |
pkg_postinst() { |
213 |
elog "This package (${PN}) is mainly intended as a replacement for the C++" |
214 |
elog "standard library when using clang." |
215 |
elog "To use it, instead of libstdc++, use:" |
216 |
elog " clang++ -stdlib=libc++" |
217 |
elog "to compile your C++ programs." |
218 |
} |