Ticket #13407: Portfile.diff.Tiger

File Portfile.diff.Tiger, 10.3 KB (added by olsner@…, 16 years ago)

Portfile patch, modified for compilation on Tiger with the ghc 6.6 bootstrap

Line 
1--- Portfile.bak        2008-01-20 01:44:07.000000000 +0100
2+++ Portfile.test       2008-01-20 19:26:15.000000000 +0100
3@@ -2,7 +2,7 @@
4 
5 PortSystem 1.0
6 name           ghc
7-version                6.6.1
8+version                6.8.2
9 categories     lang
10 maintainers    gwright@macports.org
11 platforms      darwin
12@@ -28,12 +28,12 @@
13 distfiles      ${name}-${version}-src.tar.bz2          \
14                ${name}-${version}-src-extralibs.tar.bz2
15 
16-checksums      ${name}-${version}-src.tar.bz2                  md5 ba9f4aec2fde5ff1e1548ae69b78aeb0 \
17-               ${name}-${version}-src-extralibs.tar.bz2        md5 43a26b81608b206c056adc3032f7da2a
18+checksums      ${name}-${version}-src.tar.bz2                  md5 43108417594be7eba0918c459e871e40 \
19+               ${name}-${version}-src-extralibs.tar.bz2        md5 d199c50814188fb77355d41058b8613c
20 
21-patchfiles     patch-configure.ac      \
22-               patch-GHC.hs            \
23-               patch-package.conf.in
24+patchfiles     patch-Install.hs \
25+        patch-configure.ac
26+#              patch-package.conf.in
27 
28 depends_lib    port:readline \
29                port:gmp
30@@ -74,35 +74,6 @@
31 
32                depends_lib-append      port:readline-5
33 
34-               pre-configure   {
35-                       system "cd ${worksrcpath} && autoreconf"
36-
37-                       set cfg [open "${worksrcpath}/mk/build.mk" w]
38-                       puts $cfg "#"
39-                       puts $cfg "# Local configuration overrides for MacPorts"
40-                       puts $cfg "#"
41-                       puts $cfg "SRC_CC_OPTS += -I${prefix}/include"
42-                       puts $cfg "SRC_HC_OPTS += -I${prefix}/include -I/usr/include -L${prefix}/lib -L/usr/lib"
43-                       puts $cfg "EXTRA_HSC2HS_OPTS += -I${prefix}/include"
44-                       puts $cfg "EXTRA_LD_OPTS += -L${prefix}/lib"
45-                       puts $cfg "EXTRA_LD_OPTS += -L/usr/lib"
46-                       close $cfg
47-
48-                       reinplace "s|/opt/local|${workpath}/ghc-bootstrap|g" ${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}/package.conf
49-
50-                       reinplace "s|GHCBIN=\"/opt/local|GHCBIN=\"${workpath}/${name}-bootstrap|" ${workpath}/${name}-bootstrap/bin/ghc
51-
52-                       reinplace "s|TOPDIROPT=\"-B/opt/local|TOPDIROPT=\"-B${workpath}/${name}-bootstrap|" ${workpath}/${name}-bootstrap/bin/ghc
53-
54-                       reinplace "s|-L/opt/local|-L${prefix}|" ${workpath}/${name}-bootstrap/bin/ghc
55-
56-                       reinplace "s|-I/opt/local|-I${prefix}|" ${workpath}/${name}-bootstrap/bin/ghc
57-
58-                       reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-asm
59-
60-                       reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-split
61-               }
62-
63                configure.args-append --with-ghc='${workpath}/${name}-bootstrap/bin/ghc'
64                build.cmd       gmake
65        }
66@@ -122,35 +93,6 @@
67                                        ${name}-${version}-src-extralibs.tar.bz2 \
68                                        ${name}-${ghc_bootversion}-darwin-bootstrap-tiger.tar.bz2
69 
70-               pre-configure   {
71-                       system "cd ${worksrcpath} && autoreconf"
72-
73-                       set cfg [open "${worksrcpath}/mk/build.mk" w]
74-                       puts $cfg "#"
75-                       puts $cfg "# Local configuration overrides for MacPorts"
76-                       puts $cfg "#"
77-                       puts $cfg "SRC_CC_OPTS += -I${prefix}/include"
78-                       puts $cfg "SRC_HC_OPTS += -I${prefix}/include -I/usr/include -L${prefix}/lib -L/usr/lib"
79-                       puts $cfg "EXTRA_HSC2HS_OPTS += -I${prefix}/include"
80-                       puts $cfg "EXTRA_LD_OPTS += -L${prefix}/lib"
81-                       puts $cfg "EXTRA_LD_OPTS += -L/usr/lib"
82-                       close $cfg
83-
84-                       reinplace "s|/opt/local|${workpath}/ghc-bootstrap|g" ${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}/package.conf
85-
86-                       reinplace "s|GHCBIN=\"/opt/local|GHCBIN=\"${workpath}/${name}-bootstrap|" ${workpath}/${name}-bootstrap/bin/ghc
87-
88-                       reinplace "s|TOPDIROPT=\"-B/opt/local|TOPDIROPT=\"-B${workpath}/${name}-bootstrap|" ${workpath}/${name}-bootstrap/bin/ghc
89-
90-                       reinplace "s|-L/opt/local|-L${prefix}|" ${workpath}/${name}-bootstrap/bin/ghc
91-
92-                       reinplace "s|-I/opt/local|-I${prefix}|" ${workpath}/${name}-bootstrap/bin/ghc
93-
94-                       reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-asm
95-
96-                       reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-split
97-               }
98-
99                configure.args-append --with-ghc='${workpath}/${name}-bootstrap/bin/ghc'
100        }
101 
102@@ -169,37 +111,61 @@
103                                        ${name}-${version}-src-extralibs.tar.bz2 \
104                                        ${name}-${ghc_bootversion}-i386-apple-darwin-bootstrap.tar.bz2
105 
106-               pre-configure   {
107-                       system "cd ${worksrcpath} && autoreconf"
108+               configure.args-append --with-ghc='${workpath}/${name}-bootstrap/bin/ghc'
109+       }
110 
111-                       set cfg [open "${worksrcpath}/mk/build.mk" w]
112-                       puts $cfg "#"
113-                       puts $cfg "# Local configuration overrides for MacPorts"
114-                       puts $cfg "#"
115-                       puts $cfg "SRC_CC_OPTS += -I${prefix}/include"
116-                       puts $cfg "SRC_HC_OPTS += -I${prefix}/include -I/usr/include -L${prefix}/lib -L/usr/lib"
117-                       puts $cfg "EXTRA_HSC2HS_OPTS += -I${prefix}/include"
118-                       puts $cfg "EXTRA_LD_OPTS += -L${prefix}/lib"
119-                       puts $cfg "EXTRA_LD_OPTS += -L/usr/lib"
120-                       close $cfg
121+platform darwin 9 i386 {
122+               global ghc_bootversion
123+               set ghc_bootversion     6.8.2
124 
125-                       reinplace "s|/opt/local|${workpath}/ghc-bootstrap|g" ${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}/package.conf
126+               master_sites-append     ${homepage}/dist/${ghc_bootversion}/:bootstrap
127 
128-                       reinplace "s|GHCBIN=\"/opt/local|GHCBIN=\"${workpath}/${name}-bootstrap|" ${workpath}/${name}-bootstrap/bin/ghc
129+               distfiles-append        ${name}-${ghc_bootversion}-darwin-i386-leopard-bootstrap.tar.bz2:bootstrap
130 
131-                       reinplace "s|TOPDIROPT=\"-B/opt/local|TOPDIROPT=\"-B${workpath}/${name}-bootstrap|" ${workpath}/${name}-bootstrap/bin/ghc
132+               checksums-append        ${name}-${ghc_bootversion}-darwin-i386-leopard-bootstrap.tar.bz2 md5 735a6dca41f36044199784d5bd1ece69
133 
134-                       reinplace "s|-L/opt/local|-L${prefix}|" ${workpath}/${name}-bootstrap/bin/ghc
135+               extract.only            ${name}-${version}-src.tar.bz2 \
136+                                              ${name}-${version}-src-extralibs.tar.bz2 \
137+                                              ${name}-${ghc_bootversion}-darwin-i386-leopard-bootstrap.tar.bz2
138 
139-                       reinplace "s|-I/opt/local|-I${prefix}|" ${workpath}/${name}-bootstrap/bin/ghc
140+               configure.args-append --with-ghc='${workpath}/${name}-bootstrap/bin/ghc'
141+       }
142 
143-                       reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-asm
144+pre-configure  {
145+       system "cd ${worksrcpath} && autoreconf"
146 
147-                       reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-split
148-               }
149+       set cfg [open "${worksrcpath}/mk/build.mk" w]
150+       puts $cfg "#"
151+       puts $cfg "# Local configuration overrides for MacPorts"
152+       puts $cfg "#"
153+       puts $cfg "SRC_CC_OPTS += -I${prefix}/include"
154+       puts $cfg "SRC_HC_OPTS += -I${prefix}/include -I/usr/include -L${prefix}/lib -L/usr/lib"
155+       puts $cfg "EXTRA_HSC2HS_OPTS += -I${prefix}/include"
156+       puts $cfg "EXTRA_LD_OPTS += -L${prefix}/lib"
157+       puts $cfg "EXTRA_LD_OPTS += -L/usr/lib"
158+       puts $cfg "CPPFLAGS += -I${prefix}/include"
159+       puts $cfg "LDFLAGS += -L${prefix}/lib"
160+       close $cfg
161+
162+    # Prepare bootstrap compiler for use in building current GHC
163+       reinplace "s|/opt/local|${workpath}/ghc-bootstrap|g" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/package.conf
164+       reinplace "s|GHCBIN=/opt/local\\(.*\\)|GHCBIN=${workpath}/${name}-bootstrap\\1|" ${workpath}/${name}-bootstrap/bin/ghc
165+       reinplace "s|TOPDIROPT=-B/opt/local\\(.*\\)|TOPDIROPT=-B${workpath}/${name}-bootstrap\\1|" ${workpath}/${name}-bootstrap/bin/ghc
166+       reinplace "s|-L/opt/local\\(.*\\)|-L${prefix}\\1|" ${workpath}/${name}-bootstrap/bin/ghc
167+       reinplace "s|-I/opt/local\\(.*\\)|-I${prefix}\\1|" ${workpath}/${name}-bootstrap/bin/ghc
168+       reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-asm
169+       reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-split
170+
171+       # Deal with GMP
172+       reinplace "s|GHC_CC_OPTS += \\(.*\\)|GHC_CC_OPTS += ${prefix}/include \\1|" ${worksrcpath}/libraries/Cabal/Distribution/Simple/GHC/Makefile.in
173+       system "ln -sf ${prefix}/include/gmp.h ${worksrcpath}/libraries/base/include"
174+       system "ln -sf ${prefix}/include/gmpxx.h ${worksrcpath}/libraries/base/include"
175+       system "ln -sf ${prefix}/include/gmp.h ${worksrcpath}/includes"
176+       system "ln -sf ${prefix}/include/gmpxx.h ${worksrcpath}/includes"
177+
178+       reinplace "s|\\(SUBDIRS += \$\(wildcard OpenAL\).*\\)|#\\1|" ${worksrcpath}/libraries/Makefile
179+}
180 
181-               configure.args-append --with-ghc='${workpath}/${name}-bootstrap/bin/ghc'
182-       }
183 
184 
185 #bugs          GHC does not support DESTDIR. Instead, we install       \
186@@ -207,14 +173,17 @@
187 #              the five scripts which actually have the installation   \
188 #              path hard coded.
189 
190-configure.ldflags-append       "-L/usr/lib"
191+configure.ldflags-append       "-L/usr/lib -L${prefix}/lib"
192 configure.cflags-append                "-I${prefix}/include"
193-configure.env          DYLD_FALLBACK_LIBRARY_PATH=${prefix}/lib
194+configure.env          DYLD_FALLBACK_LIBRARY_PATH=${prefix}/lib \
195+                    CFLAGS=-I${prefix}/include
196 
197-configure.args --prefix=${destroot}/${prefix}                  \
198-               --mandir=${destroot}/${prefix}/share/man/       \
199+configure.args --prefix=${destroot}${prefix}                   \
200+               --mandir=${destroot}${prefix}/share/man/        \
201                --with-readline-includes=${prefix}/include      \
202                --with-readline-libraries=${prefix}/lib         \
203+               --with-gmp-libraries=${prefix}/lib \
204+               --with-gmp-includes=${prefix}/include \
205                --disable-openal                                \
206                --disable-alut
207 
208@@ -224,22 +193,24 @@
209        system "env DYLD_FALLBACK_LIBRARY_PATH=${prefix}/lib ${build.cmd} ${build.target}"
210 }
211 
212-
213+destroot {
214+       system "${build.cmd} install"
215+}
216 
217 # Note the middle "/" in the ${destroot}/${prefix} pattern. It is required,
218 # because the actual text we are trying to match has a "//" between the
219 # destroot and the prefix pieces.
220 
221 post-destroot  {
222-       reinplace s|${destroot}/${prefix}|${prefix}|g ${destroot}/${prefix}/bin/ghc
223-       reinplace s|${destroot}/${prefix}|${prefix}|g ${destroot}/${prefix}/bin/ghci
224-       reinplace s|${destroot}/${prefix}|${prefix}|g ${destroot}/${prefix}/bin/ghc-pkg
225-       reinplace s|${destroot}/${prefix}|${prefix}|g ${destroot}/${prefix}/bin/ghcprof
226-       reinplace s|${destroot}/${prefix}|${prefix}|g ${destroot}/${prefix}/bin/hsc2hs
227+       reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}/${prefix}/bin/ghc
228+       reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}/${prefix}/bin/ghci
229+       reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}/${prefix}/bin/ghc-pkg
230+       reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}/${prefix}/bin/ghcprof
231+       reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}/${prefix}/bin/hsc2hs
232 
233        reinplace "s|\\\$@\"\}|\\\$@\"\} -L${prefix}/lib -I${prefix}/include |" ${destroot}/${prefix}/bin/ghc
234 
235-       reinplace s|${destroot}/${prefix}|${prefix}|g ${destroot}${prefix}/lib/${name}-${version}/package.conf
236+       reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/lib/${name}-${version}/package.conf
237 
238        system "cd ${destroot}${prefix}/lib/ghc-${version} && ranlib *.a"
239 }