Magellan Linux

Annotation of /trunk/extras/ghc/ghc-6.12.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5352 - (hide annotations) (download)
Wed May 5 18:57:30 2010 UTC (14 years, 1 month ago) by niro
File size: 2960 byte(s)
-try to fix cross-compile issues
1 niro 5348 # $Id$
2    
3     PNAME="ghc"
4     PVER="6.12.2"
5     PBUILD="r1"
6    
7     PCATEGORIE="dev-lang"
8     STATE="unstable"
9    
10     DESCRIPTION="Glasgow Haskell Compiler."
11     HOMEPAGE="http://www.haskell.org/ghc/"
12    
13     DEPEND=">= dev-lang/perl-5.10
14     >= sys-dev/gcc-4.3
15     >= dev-libs/gmp-4.3
16     >= sys-libs/readline-6"
17    
18     SRCFILE="${PNAME}-${PVER}-src.tar.bz2"
19     SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
20    
21     # binary sources
22     SRCFILE_BIN_x86="${PNAME}-${PVER}-i386-unknown-linux-n.tar.bz2"
23     SRCFILE_BIN_x86_64="${PNAME}-${PVER}-x86_64-unknown-linux-n.tar.bz2"
24     SRCFILE_BIN="$(eval echo \$SRCFILE_BIN_${ARCH/i*86/x86})"
25     SRCDIR_BIN="${BUILDDIR}/binary/${PNAME}-${PVER}"
26    
27     SRC_URI=(
28     http://www.haskell.org/ghc/dist/${PVER}/${SRCFILE}
29     http://www.haskell.org/ghc/dist/${PVER}/${SRCFILE_BIN_x86}
30     http://www.haskell.org/ghc/dist/${PVER}/${SRCFILE_BIN_x86_64}
31     mirror://${PNAME}/${SRCFILE}
32     mirror://${PNAME}/${SRCFILE_BIN_x86}
33     mirror://${PNAME}/${SRCFILE_BIN_x86_64}
34 niro 5349 mirror://${PNAME}/${PNAME}-${PVER}-chost-2.patch
35 niro 5348 )
36    
37     UP2DATE="updatecmd ${HOMEPAGE}download.html | grep 'Current Stable' | sed 's:.*(\(.*\)):\1:'"
38    
39     src_prepare()
40     {
41     munpack ${SRCFILE} || die
42    
43     install -d ${BUILDDIR}/binary || die
44     munpack ${SRCFILE_BIN} ${BUILDDIR}/binary || die
45 niro 5349
46 niro 5351 cd ${SRCDIR}
47 niro 5349
48     # fix broken chosts
49 niro 5351 mpatch ${PNAME}-${PVER}-chost-2.patch || die
50 niro 5349
51     # fixes configure: line 3817: FP_DECL_ALTZONE: command not found
52     cp libraries/{,old-}time/aclocal.m4 || die
53    
54     autoreconf --verbose --install --force || die
55 niro 5348 }
56    
57     src_compile()
58     {
59     # first setup the binary compiler to bootstrap ghc
60     cd ${SRCDIR_BIN}
61 niro 5349 # inplace doesn't work anymore
62     # mconfigure || die
63     # make in-place || die
64     #
65     # # setup the path to ghc
66     # local myarch="${ARCH}"
67     # [[ ${ARCH} = i*86 ]] && myarch="i386"
68     # export PATH="${PATH}:${SRCDIR_BIN}/bin/${myarch}-unknown-linux"
69     #
70     # install to ${BUILDDIR}/binary from now on
71     mconfigure --prefix=${BUILDDIR}/binary || die
72     make install || die
73     export PATH="${PATH}:${BUILDDIR}/binary/bin"
74 niro 5348
75     # now bootstrap ghc
76     cd ${SRCDIR}
77    
78 niro 5349 # initialize build.mk
79     echo '# Magellan build' > mk/build.mk || die
80    
81     # fix pathes
82     echo "docdir = /usr/share/doc/${PNAME}-${PVER}" >> mk/build.mk || die
83     echo "htmldir = /usr/share/doc/${PNAME}-${PVER}" >> mk/build.mk || die
84    
85 niro 5348 # disable the build of docs
86 niro 5349 echo HADDOCK_DOCS=NO >> mk/build.mk || die
87 niro 5348 echo XMLDocWays="" >> mk/build.mk || die
88    
89 niro 5349 # do not use shell wrapper
90     sed -i "s|utils/haddock_dist_INSTALL_SHELL_WRAPPER = YES|utils/haddock_dist_INSTALL_SHELL_WRAPPER = NO|" \
91     utils/haddock/ghc.mk || die
92 niro 5348
93 niro 5349 # taken from gentoo:
94     # circumvent a very strange bug that seems related with ghc producing
95     # too much output while being filtered through tee (e.g. due to
96     # portage logging) reported as bug #111183
97     echo "SRC_HC_OPTS+=-w" >> mk/build.mk || die
98 niro 5348
99 niro 5352 #mconfigure || die # wants to crosscompile
100     ./configure --prefix=/usr --libdir=/usr/$(mlibdir) || die
101 niro 5349 mmake -j1 all || die
102 niro 5348 }
103    
104     src_install()
105     {
106     cd ${SRCDIR}
107 niro 5349 mmake -j1 DESTDIR=${BINDIR} install || die
108 niro 5348 minstalldocs ANNOUNCE HACKING LICENSE README VERSION || die
109     }

Properties

Name Value
svn:keywords Id