1 |
kolmodin 10/01/26 19:54:10 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: ghc-6.12.1.ebuild |
5 |
Log: |
6 |
Version bump dev-lang/ghc-6.12.1, currently hard masked. |
7 |
(Portage version: 2.1.6.13/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.173 dev-lang/ghc/ChangeLog |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/ghc/ChangeLog?rev=1.173&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/ghc/ChangeLog?rev=1.173&content-type=text/plain |
14 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/ghc/ChangeLog?r1=1.172&r2=1.173 |
15 |
|
16 |
Index: ChangeLog |
17 |
=================================================================== |
18 |
RCS file: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v |
19 |
retrieving revision 1.172 |
20 |
retrieving revision 1.173 |
21 |
diff -u -r1.172 -r1.173 |
22 |
--- ChangeLog 5 Dec 2009 09:19:27 -0000 1.172 |
23 |
+++ ChangeLog 26 Jan 2010 19:54:10 -0000 1.173 |
24 |
@@ -1,6 +1,11 @@ |
25 |
# ChangeLog for dev-lang/ghc |
26 |
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 |
27 |
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.172 2009/12/05 09:19:27 kolmodin Exp $ |
28 |
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 |
29 |
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.173 2010/01/26 19:54:10 kolmodin Exp $ |
30 |
+ |
31 |
+*ghc-6.12.1 (26 Jan 2010) |
32 |
+ |
33 |
+ 26 Jan 2010; <kolmodin@g.o> +ghc-6.12.1.ebuild: |
34 |
+ Version bump, currently masked for testing. |
35 |
|
36 |
*ghc-6.10.4-r1 (05 Dec 2009) |
37 |
|
38 |
|
39 |
|
40 |
|
41 |
1.1 dev-lang/ghc/ghc-6.12.1.ebuild |
42 |
|
43 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/ghc/ghc-6.12.1.ebuild?rev=1.1&view=markup |
44 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/ghc/ghc-6.12.1.ebuild?rev=1.1&content-type=text/plain |
45 |
|
46 |
Index: ghc-6.12.1.ebuild |
47 |
=================================================================== |
48 |
# Copyright 1999-2010 Gentoo Foundation |
49 |
# Distributed under the terms of the GNU General Public License v2 |
50 |
# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-6.12.1.ebuild,v 1.1 2010/01/26 19:54:10 kolmodin Exp $ |
51 |
|
52 |
# Brief explanation of the bootstrap logic: |
53 |
# |
54 |
# Previous ghc ebuilds have been split into two: ghc and ghc-bin, |
55 |
# where ghc-bin was primarily used for bootstrapping purposes. |
56 |
# From now on, these two ebuilds have been combined, with the |
57 |
# binary USE flag used to determine whether or not the pre-built |
58 |
# binary package should be emerged or whether ghc should be compiled |
59 |
# from source. If the latter, then the relevant ghc-bin for the |
60 |
# arch in question will be used in the working directory to compile |
61 |
# ghc from source. |
62 |
# |
63 |
# This solution has the advantage of allowing us to retain the one |
64 |
# ebuild for both packages, and thus phase out virtual/ghc. |
65 |
|
66 |
# Note to users of hardened gcc-3.x: |
67 |
# |
68 |
# If you emerge ghc with hardened gcc it should work fine (because we |
69 |
# turn off the hardened features that would otherwise break ghc). |
70 |
# However, emerging ghc while using a vanilla gcc and then switching to |
71 |
# hardened gcc (using gcc-config) will leave you with a broken ghc. To |
72 |
# fix it you would need to either switch back to vanilla gcc or re-emerge |
73 |
# ghc (or ghc-bin). Note that also if you are using hardened gcc-3.x and |
74 |
# you switch to gcc-4.x that this will also break ghc and you'll need to |
75 |
# re-emerge ghc (or ghc-bin). People using vanilla gcc can switch between |
76 |
# gcc-3.x and 4.x with no problems. |
77 |
|
78 |
inherit base autotools bash-completion eutils flag-o-matic toolchain-funcs ghc-package versionator |
79 |
|
80 |
DESCRIPTION="The Glasgow Haskell Compiler" |
81 |
HOMEPAGE="http://www.haskell.org/ghc/" |
82 |
|
83 |
# discover if this is a snapshot release |
84 |
IS_SNAPSHOT="$(get_version_component_range 4)" # non-empty if snapshot |
85 |
EXTRA_SRC_URI="${PV}" |
86 |
[[ "${IS_SNAPSHOT}" ]] && EXTRA_SRC_URI="stable/dist" |
87 |
|
88 |
arch_binaries="" |
89 |
|
90 |
arch_binaries="$arch_binaries x86? ( http://code.haskell.org/~ivanm/ghc-bin-${PV}-x86.tbz2 )" |
91 |
arch_binaries="$arch_binaries amd64? ( http://haskell.org/~kolmodin/ghc-bin-${PV}-amd64.tbz2 )" |
92 |
arch_binaries="$arch_binaries sparc? ( http://haskell.org/~duncan/ghc/ghc-bin-${PV}-sparc.tbz2 )" |
93 |
arch_binaries="$arch_binaries ppc64? ( http://code.haskell.org/~slyfox/ghc-ppc64/ghc-bin-${PV}-ppc64.tbz2 )" |
94 |
|
95 |
#arch_binaries="$arch_binaries alpha? ( mirror://gentoo/ghc-bin-${PV}-alpha.tbz2 )" |
96 |
#arch_binaries="$arch_binaries amd64? ( mirror://gentoo/ghc-bin-${PV}-amd64.tbz2 )" |
97 |
#arch_binaries="$arch_binaries hppa? ( mirror://gentoo/ghc-bin-${PV}-hppa.tbz2 )" |
98 |
#arch_binaries="$arch_binaries ia64? ( mirror://gentoo/ghc-bin-${PV}-ia64.tbz2 )" |
99 |
#arch_binaries="$arch_binaries sparc? ( mirror://gentoo/ghc-bin-${PV}-sparc.tbz2 )" |
100 |
#arch_binaries="$arch_binaries x86? ( mirror://gentoo/ghc-bin-${PV}-x86.tbz2 )" |
101 |
|
102 |
SRC_URI="!binary? ( http://haskell.org/ghc/dist/${EXTRA_SRC_URI}/${P}-src.tar.bz2 ) |
103 |
!ghcbootstrap? ( $arch_binaries )" |
104 |
LICENSE="BSD" |
105 |
SLOT="0" |
106 |
KEYWORDS="~amd64 ~ppc64 ~sparc ~x86" |
107 |
IUSE="binary doc ghcbootstrap" |
108 |
|
109 |
RDEPEND=" |
110 |
!dev-lang/ghc-bin |
111 |
>=sys-devel/gcc-2.95.3 |
112 |
>=sys-devel/binutils-2.17 |
113 |
>=dev-lang/perl-5.6.1 |
114 |
>=dev-libs/gmp-4.1 |
115 |
!<dev-haskell/haddock-2.4.2" |
116 |
# earlier versions than 2.4.2 of haddock only works with older ghc releases |
117 |
|
118 |
DEPEND="${RDEPEND} |
119 |
ghcbootstrap? ( doc? ( ~app-text/docbook-xml-dtd-4.2 |
120 |
app-text/docbook-xsl-stylesheets |
121 |
>=dev-libs/libxslt-1.1.2 ) )" |
122 |
# In the ghcbootstrap case we rely on the developer having |
123 |
# >=ghc-5.04.3 on their $PATH already |
124 |
|
125 |
PDEPEND="!ghcbootstrap? ( =app-admin/haskell-updater-1.0* )" |
126 |
|
127 |
# use undocumented feature STRIP_MASK to fix this issue: |
128 |
# http://hackage.haskell.org/trac/ghc/ticket/3580 |
129 |
STRIP_MASK="*/HSffi.o" |
130 |
|
131 |
append-ghc-cflags() { |
132 |
local flag compile assemble link |
133 |
for flag in $*; do |
134 |
case ${flag} in |
135 |
compile) compile="yes";; |
136 |
assemble) assemble="yes";; |
137 |
link) link="yes";; |
138 |
*) |
139 |
[[ ${compile} ]] && GHC_CFLAGS="${GHC_CFLAGS} -optc${flag}" |
140 |
[[ ${assemble} ]] && GHC_CFLAGS="${GHC_CFLAGS} -opta${flag}" |
141 |
[[ ${link} ]] && GHC_CFLAGS="${GHC_CFLAGS} -optl${flag}";; |
142 |
esac |
143 |
done |
144 |
} |
145 |
|
146 |
ghc_setup_cflags() { |
147 |
# We need to be very careful with the CFLAGS we ask ghc to pass through to |
148 |
# gcc. There are plenty of flags which will make gcc produce output that |
149 |
# breaks ghc in various ways. The main ones we want to pass through are |
150 |
# -mcpu / -march flags. These are important for arches like alpha & sparc. |
151 |
# We also use these CFLAGS for building the C parts of ghc, ie the rts. |
152 |
strip-flags |
153 |
strip-unsupported-flags |
154 |
filter-flags -fPIC |
155 |
|
156 |
GHC_CFLAGS="" |
157 |
for flag in ${CFLAGS}; do |
158 |
case ${flag} in |
159 |
|
160 |
# Ignore extra optimisation (ghc passes -O to gcc anyway) |
161 |
# -O2 and above break on too many systems |
162 |
-O*) ;; |
163 |
|
164 |
# Arch and ABI flags are what we're really after |
165 |
-m*) append-ghc-cflags compile assemble ${flag};; |
166 |
|
167 |
# Debugging flags don't help either. You can't debug Haskell code |
168 |
# at the C source level and the mangler discards the debug info. |
169 |
-g*) ;; |
170 |
|
171 |
# Ignore all other flags, including all -f* flags |
172 |
esac |
173 |
done |
174 |
|
175 |
# hardened-gcc needs to be disabled, because the mangler doesn't accept |
176 |
# its output. |
177 |
gcc-specs-pie && append-ghc-cflags compile link -nopie |
178 |
gcc-specs-ssp && append-ghc-cflags compile -fno-stack-protector |
179 |
|
180 |
# prevent from failind building unregisterised ghc: |
181 |
# http://www.mail-archive.com/debian-bugs-dist@××××××××××××.org/msg171602.html |
182 |
use ppc64 && append-ghc-cflags compile -mminimal-toc |
183 |
} |
184 |
|
185 |
pkg_setup() { |
186 |
if use ghcbootstrap; then |
187 |
ewarn "You requested ghc bootstrapping, this is usually only used" |
188 |
ewarn "by Gentoo developers to make binary .tbz2 packages for" |
189 |
ewarn "use with the ghc ebuild's USE=\"binary\" feature." |
190 |
use binary && \ |
191 |
die "USE=\"ghcbootstrap binary\" is not a valid combination." |
192 |
[[ -z $(type -P ghc) ]] && \ |
193 |
die "Could not find a ghc to bootstrap with." |
194 |
fi |
195 |
} |
196 |
|
197 |
src_unpack() { |
198 |
# Create the ${S} dir if we're using the binary version |
199 |
use binary && mkdir "${S}" |
200 |
|
201 |
base_src_unpack |
202 |
ghc_setup_cflags |
203 |
|
204 |
if use binary; then |
205 |
|
206 |
# Move unpacked files to the expected place |
207 |
mv "${WORKDIR}/usr" "${S}" |
208 |
else |
209 |
if ! use ghcbootstrap; then |
210 |
# Relocate from /usr to ${WORKDIR}/usr |
211 |
sed -i -e "s|/usr|${WORKDIR}/usr|g" \ |
212 |
"${WORKDIR}/usr/bin/ghc-${PV}" \ |
213 |
"${WORKDIR}/usr/bin/ghci-${PV}" \ |
214 |
"${WORKDIR}/usr/bin/ghc-pkg-${PV}" \ |
215 |
"${WORKDIR}/usr/bin/hsc2hs" \ |
216 |
"${WORKDIR}/usr/$(get_libdir)/${P}/package.conf.d/"* \ |
217 |
|| die "Relocating ghc from /usr to workdir failed" |
218 |
|
219 |
# regenerate the binary package cache |
220 |
"${WORKDIR}/usr/bin/ghc-pkg" recache |
221 |
fi |
222 |
|
223 |
sed -i -e "s|\"\$topdir\"|\"\$topdir\" ${GHC_CFLAGS}|" \ |
224 |
"${S}/ghc/ghc.wrapper" |
225 |
|
226 |
cd "${S}" # otherwise epatch will break |
227 |
|
228 |
epatch "${FILESDIR}/ghc-${PV}-configure-CHOST.patch" |
229 |
|
230 |
# fix configure.ac to detect libm need |
231 |
# http://bugs.gentoo.org/show_bug.cgi?id=293208 |
232 |
# http://hackage.haskell.org/trac/ghc/ticket/3730 |
233 |
epatch "${FILESDIR}/ghc-6.10.4-libm-detection.patch" |
234 |
|
235 |
# old-time-1.1.4 on hackage lacked this piece while |
236 |
# darcs repo had it |
237 |
# fixes: |
238 |
# QA Notice: command not found: |
239 |
# configure: line 3817: FP_DECL_ALTZONE: command not found |
240 |
cp "${S}/libraries/time/aclocal.m4" \ |
241 |
"${S}/libraries/old-time/aclocal.m4" \ |
242 |
|| die "unable to copy 'time/aclocal.m4' to 'old-time/aclocal.m4'" |
243 |
|
244 |
# as we have changed the build system with the readline patch |
245 |
eautoreconf |
246 |
fi |
247 |
} |
248 |
|
249 |
src_compile() { |
250 |
if ! use binary; then |
251 |
|
252 |
# initialize build.mk |
253 |
echo '# Gentoo changes' > mk/build.mk |
254 |
|
255 |
# Put docs into the right place, ie /usr/share/doc/ghc-${PV} |
256 |
echo "docdir = /usr/share/doc/${P}" >> mk/build.mk |
257 |
echo "htmldir = /usr/share/doc/${P}" >> mk/build.mk |
258 |
|
259 |
# We also need to use the GHC_CFLAGS flags when building ghc itself |
260 |
echo "SRC_HC_OPTS+=${GHC_CFLAGS}" >> mk/build.mk |
261 |
echo "SRC_CC_OPTS+=${CFLAGS} -Wa,--noexecstack" >> mk/build.mk |
262 |
|
263 |
# We can't depend on haddock except when bootstrapping when we |
264 |
# must build docs and include them into the binary .tbz2 package |
265 |
if use ghcbootstrap && use doc; then |
266 |
echo XMLDocWays="html" >> mk/build.mk |
267 |
echo HADDOCK_DOCS=YES >> mk/build.mk |
268 |
else |
269 |
echo XMLDocWays="" >> mk/build.mk |
270 |
echo HADDOCK_DOCS=NO >> mk/build.mk |
271 |
fi |
272 |
|
273 |
sed -e "s|utils/haddock_dist_INSTALL_SHELL_WRAPPER = YES|utils/haddock_dist_INSTALL_SHELL_WRAPPER = NO|" \ |
274 |
-i utils/haddock/ghc.mk |
275 |
|
276 |
# circumvent a very strange bug that seems related with ghc producing |
277 |
# too much output while being filtered through tee (e.g. due to |
278 |
# portage logging) reported as bug #111183 |
279 |
echo "SRC_HC_OPTS+=-w" >> mk/build.mk |
280 |
|
281 |
# GHC build system knows to build unregisterised on alpha and hppa, |
282 |
# but we have to tell it to build unregisterised on some arches |
283 |
# ppc64: EvilMangler currently does not understand some TOCs |
284 |
if use alpha || use hppa || use ppc64; then |
285 |
echo "GhcUnregisterised=YES" >> mk/build.mk |
286 |
echo "GhcWithInterpreter=NO" >> mk/build.mk |
287 |
echo "GhcWithNativeCodeGen=NO" >> mk/build.mk |
288 |
echo "SplitObjs=NO" >> mk/build.mk |
289 |
echo "GhcRTSWays := debug" >> mk/build.mk |
290 |
echo "GhcNotThreaded=YES" >> mk/build.mk |
291 |
fi |
292 |
# Have "ld -r --relax" problem with split-objs on sparc: |
293 |
if use sparc; then |
294 |
echo "SplitObjs=NO" >> mk/build.mk |
295 |
fi |
296 |
|
297 |
# Get ghc from the unpacked binary .tbz2 |
298 |
# except when bootstrapping we just pick ghc up off the path |
299 |
if ! use ghcbootstrap; then |
300 |
export PATH="${WORKDIR}/usr/bin:${PATH}" |
301 |
fi |
302 |
|
303 |
econf || die "econf failed" |
304 |
|
305 |
emake all || die "make failed" |
306 |
|
307 |
fi # ! use binary |
308 |
} |
309 |
|
310 |
src_install() { |
311 |
if use binary; then |
312 |
mv "${S}/usr" "${D}" |
313 |
|
314 |
# Remove the docs if not requested |
315 |
if ! use doc; then |
316 |
rm -rf "${D}/usr/share/doc/${P}/*/" \ |
317 |
"${D}/usr/share/doc/${P}/*.html" \ |
318 |
|| die "could not remove docs (P vs PF revision mismatch?)" |
319 |
fi |
320 |
else |
321 |
local insttarget="install" |
322 |
|
323 |
# We only built docs if we were bootstrapping, otherwise |
324 |
# we copy them out of the unpacked binary .tbz2 |
325 |
if use doc; then |
326 |
if ! use ghcbootstrap; then |
327 |
mkdir -p "${D}/usr/share/doc" |
328 |
mv "${WORKDIR}/usr/share/doc/${P}" "${D}/usr/share/doc" \ |
329 |
|| die "failed to copy docs" |
330 |
fi |
331 |
fi |
332 |
|
333 |
emake -j1 ${insttarget} \ |
334 |
DESTDIR="${D}" \ |
335 |
|| die "make ${insttarget} failed" |
336 |
|
337 |
dodoc "${S}/README" "${S}/ANNOUNCE" "${S}/LICENSE" "${S}/VERSION" |
338 |
|
339 |
dobashcompletion "${FILESDIR}/ghc-bash-completion" |
340 |
|
341 |
cp -rp "${D}/usr/$(get_libdir)/${P}/package.conf.d"{,.shipped} \ |
342 |
|| die "failed to copy package.conf.d" |
343 |
fi |
344 |
} |
345 |
|
346 |
pkg_postinst() { |
347 |
ghc-reregister |
348 |
|
349 |
ewarn "IMPORTANT:" |
350 |
ewarn "If you have upgraded from another version of ghc," |
351 |
ewarn "once app-admin/haskell-updater has installed please run:" |
352 |
ewarn " /usr/sbin/haskell-updater --upgrade" |
353 |
ewarn "to re-build all ghc-based Haskell libraries." |
354 |
|
355 |
bash-completion_pkg_postinst |
356 |
} |
357 |
|
358 |
pkg_prerm() { |
359 |
# Be very careful here... Call order when upgrading is (according to PMS): |
360 |
# * src_install for new package |
361 |
# * pkg_preinst for new package |
362 |
# * pkg_postinst for new package |
363 |
# * pkg_prerm for the package being replaced |
364 |
# * pkg_postrm for the package being replaced |
365 |
# so you'll actually be touching the new packages files, not the one you |
366 |
# uninstall, due to that or installation directory ${P} will be the same for |
367 |
# both packages. |
368 |
|
369 |
# Call order for reinstalling is (according to PMS): |
370 |
# * src_install |
371 |
# * pkg_preinst |
372 |
# * pkg_prerm for the package being replaced |
373 |
# * pkg_postrm for the package being replaced |
374 |
# * pkg_postinst |
375 |
|
376 |
# Overwrite the (potentially) modified package.conf with a copy of the |
377 |
# original one, so that it will be removed during uninstall. |
378 |
|
379 |
PKGDIR="${ROOT}/usr/$(get_libdir)/${P}/package.conf.d" |
380 |
rm -rf "${PKGDIR}" |
381 |
|
382 |
cp -pr "${PKGDIR}"{.shipped,} |
383 |
} |