Ticket #13407: Portfile.diff
File Portfile.diff, 10.5 KB (added by bfulgham@…, 17 years ago) |
---|
-
Portfile
2 2 3 3 PortSystem 1.0 4 4 name ghc 5 version 6. 6.15 version 6.8.2 6 6 categories lang 7 7 maintainers gwright@macports.org 8 8 platforms darwin … … 28 28 distfiles ${name}-${version}-src.tar.bz2 \ 29 29 ${name}-${version}-src-extralibs.tar.bz2 30 30 31 checksums ${name}-${version}-src.tar.bz2 md5 ba9f4aec2fde5ff1e1548ae69b78aeb0 \32 ${name}-${version}-src-extralibs.tar.bz2 md5 43a26b81608b206c056adc3032f7da2a31 checksums ${name}-${version}-src.tar.bz2 md5 43108417594be7eba0918c459e871e40 \ 32 ${name}-${version}-src-extralibs.tar.bz2 md5 d199c50814188fb77355d41058b8613c 33 33 34 patchfiles patch- configure.ac\35 patch-GHC.hs \ 36 patch-package.conf.in34 patchfiles patch-Install.hs \ 35 patch-configure.ac 36 # patch-package.conf.in 37 37 38 38 depends_lib port:readline \ 39 39 port:gmp … … 74 74 75 75 depends_lib-append port:readline-5 76 76 77 pre-configure {78 cd ${worksrcpath}79 system "autoreconf"80 81 set cfg [open "${worksrcpath}/mk/build.mk" w]82 puts $cfg "#"83 puts $cfg "# Local configuration overrides for MacPorts"84 puts $cfg "#"85 puts $cfg "SRC_CC_OPTS += -I${prefix}/include"86 puts $cfg "SRC_HC_OPTS += -I${prefix}/include -I/usr/include -L${prefix}/lib -L/usr/lib"87 puts $cfg "EXTRA_HSC2HS_OPTS += -I${prefix}/include"88 puts $cfg "EXTRA_LD_OPTS += -L${prefix}/lib"89 puts $cfg "EXTRA_LD_OPTS += -L/usr/lib"90 close $cfg91 92 reinplace "s|/opt/local|${workpath}/ghc-bootstrap|g" ${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}/package.conf93 94 reinplace "s|GHCBIN=\"/opt/local|GHCBIN=\"${workpath}/${name}-bootstrap|" ${workpath}/${name}-bootstrap/bin/ghc95 96 reinplace "s|TOPDIROPT=\"-B/opt/local|TOPDIROPT=\"-B${workpath}/${name}-bootstrap|" ${workpath}/${name}-bootstrap/bin/ghc97 98 reinplace "s|-L/opt/local|-L${prefix}|" ${workpath}/${name}-bootstrap/bin/ghc99 100 reinplace "s|-I/opt/local|-I${prefix}|" ${workpath}/${name}-bootstrap/bin/ghc101 102 reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-asm103 104 reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-split105 }106 107 77 configure.args-append --with-ghc='${workpath}/${name}-bootstrap/bin/ghc' 108 78 build.cmd gmake 109 79 } … … 123 93 ${name}-${version}-src-extralibs.tar.bz2 \ 124 94 ${name}-${ghc_bootversion}-darwin-bootstrap-tiger.tar.bz2 125 95 126 pre-configure {127 cd ${worksrcpath}128 system "autoreconf"129 130 set cfg [open "${worksrcpath}/mk/build.mk" w]131 puts $cfg "#"132 puts $cfg "# Local configuration overrides for MacPorts"133 puts $cfg "#"134 puts $cfg "SRC_CC_OPTS += -I${prefix}/include"135 puts $cfg "SRC_HC_OPTS += -I${prefix}/include -I/usr/include -L${prefix}/lib -L/usr/lib"136 puts $cfg "EXTRA_HSC2HS_OPTS += -I${prefix}/include"137 puts $cfg "EXTRA_LD_OPTS += -L${prefix}/lib"138 puts $cfg "EXTRA_LD_OPTS += -L/usr/lib"139 close $cfg140 141 reinplace "s|/opt/local|${workpath}/ghc-bootstrap|g" ${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}/package.conf142 143 reinplace "s|GHCBIN=\"/opt/local|GHCBIN=\"${workpath}/${name}-bootstrap|" ${workpath}/${name}-bootstrap/bin/ghc144 145 reinplace "s|TOPDIROPT=\"-B/opt/local|TOPDIROPT=\"-B${workpath}/${name}-bootstrap|" ${workpath}/${name}-bootstrap/bin/ghc146 147 reinplace "s|-L/opt/local|-L${prefix}|" ${workpath}/${name}-bootstrap/bin/ghc148 149 reinplace "s|-I/opt/local|-I${prefix}|" ${workpath}/${name}-bootstrap/bin/ghc150 151 reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-asm152 153 reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-split154 }155 156 96 configure.args-append --with-ghc='${workpath}/${name}-bootstrap/bin/ghc' 157 97 } 158 98 … … 171 111 ${name}-${version}-src-extralibs.tar.bz2 \ 172 112 ${name}-${ghc_bootversion}-i386-apple-darwin-bootstrap.tar.bz2 173 113 174 pre-configure { 175 cd ${worksrcpath} 176 system "autoreconf" 114 configure.args-append --with-ghc='${workpath}/${name}-bootstrap/bin/ghc' 115 } 177 116 178 set cfg [open "${worksrcpath}/mk/build.mk" w] 179 puts $cfg "#" 180 puts $cfg "# Local configuration overrides for MacPorts" 181 puts $cfg "#" 182 puts $cfg "SRC_CC_OPTS += -I${prefix}/include" 183 puts $cfg "SRC_HC_OPTS += -I${prefix}/include -I/usr/include -L${prefix}/lib -L/usr/lib" 184 puts $cfg "EXTRA_HSC2HS_OPTS += -I${prefix}/include" 185 puts $cfg "EXTRA_LD_OPTS += -L${prefix}/lib" 186 puts $cfg "EXTRA_LD_OPTS += -L/usr/lib" 187 close $cfg 117 platform darwin 9 i386 { 118 global ghc_bootversion 119 set ghc_bootversion 6.8.2 188 120 189 reinplace "s|/opt/local|${workpath}/ghc-bootstrap|g" ${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}/package.conf121 master_sites-append ${homepage}/dist/${ghc_bootversion}/:bootstrap 190 122 191 reinplace "s|GHCBIN=\"/opt/local|GHCBIN=\"${workpath}/${name}-bootstrap|" ${workpath}/${name}-bootstrap/bin/ghc123 distfiles-append ${name}-${ghc_bootversion}-darwin-i386-leopard-bootstrap.tar.bz2:bootstrap 192 124 193 reinplace "s|TOPDIROPT=\"-B/opt/local|TOPDIROPT=\"-B${workpath}/${name}-bootstrap|" ${workpath}/${name}-bootstrap/bin/ghc125 checksums-append ${name}-${ghc_bootversion}-darwin-i386-leopard-bootstrap.tar.bz2 md5 735a6dca41f36044199784d5bd1ece69 194 126 195 reinplace "s|-L/opt/local|-L${prefix}|" ${workpath}/${name}-bootstrap/bin/ghc 127 extract.only ${name}-${version}-src.tar.bz2 \ 128 ${name}-${version}-src-extralibs.tar.bz2 \ 129 ${name}-${ghc_bootversion}-darwin-i386-leopard-bootstrap.tar.bz2 196 130 197 reinplace "s|-I/opt/local|-I${prefix}|" ${workpath}/${name}-bootstrap/bin/ghc 131 configure.args-append --with-ghc='${workpath}/${name}-bootstrap/bin/ghc' 132 } 198 133 199 reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-asm 134 pre-configure { 135 system "cd ${worksrcpath} && autoreconf" 200 136 201 reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-split 202 } 137 set cfg [open "${worksrcpath}/mk/build.mk" w] 138 puts $cfg "#" 139 puts $cfg "# Local configuration overrides for MacPorts" 140 puts $cfg "#" 141 puts $cfg "SRC_CC_OPTS += -I${prefix}/include" 142 puts $cfg "SRC_HC_OPTS += -I${prefix}/include -I/usr/include -L${prefix}/lib -L/usr/lib" 143 puts $cfg "EXTRA_HSC2HS_OPTS += -I${prefix}/include" 144 puts $cfg "EXTRA_LD_OPTS += -L${prefix}/lib" 145 puts $cfg "EXTRA_LD_OPTS += -L/usr/lib" 146 puts $cfg "CPPFLAGS += -I${prefix}/include" 147 puts $cfg "LDFLAGS += -L${prefix}/lib" 148 close $cfg 203 149 204 configure.args-append --with-ghc='${workpath}/${name}-bootstrap/bin/ghc' 205 } 150 # Prepare bootstrap compiler for use in building current GHC 151 reinplace "s|/opt/local|${workpath}/ghc-bootstrap|g" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/package.conf 152 reinplace "s|GHCBIN=/opt/local\\(.*\\)|GHCBIN=${workpath}/${name}-bootstrap\\1|" ${workpath}/${name}-bootstrap/bin/ghc 153 reinplace "s|TOPDIROPT=-B/opt/local\\(.*\\)|TOPDIROPT=-B${workpath}/${name}-bootstrap\\1|" ${workpath}/${name}-bootstrap/bin/ghc 154 reinplace "s|-L/opt/local\\(.*\\)|-L${prefix}\\1|" ${workpath}/${name}-bootstrap/bin/ghc 155 reinplace "s|-I/opt/local\\(.*\\)|-I${prefix}\\1|" ${workpath}/${name}-bootstrap/bin/ghc 156 reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-asm 157 reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-split 206 158 159 # Deal with GMP 160 reinplace "s|GHC_CC_OPTS += \\(.*\\)|GHC_CC_OPTS += ${prefix}/include \\1|" ${worksrcpath}/libraries/Cabal/Distribution/Simple/GHC/Makefile.in 161 system "ln -sf ${prefix}/include/gmp.h ${worksrcpath}/libraries/base/include" 162 system "ln -sf ${prefix}/include/gmpxx.h ${worksrcpath}/libraries/base/include" 163 system "ln -sf ${prefix}/include/gmp.h ${worksrcpath}/includes" 164 system "ln -sf ${prefix}/include/gmpxx.h ${worksrcpath}/includes" 207 165 166 reinplace "s|\\(SUBDIRS += \$\(wildcard OpenAL\).*\\)|#\\1|" ${worksrcpath}/libraries/Makefile 167 } 168 169 170 208 171 #bugs GHC does not support DESTDIR. Instead, we install \ 209 172 # everything into ${destroot}/${prefix}, and then fix up \ 210 173 # the five scripts which actually have the installation \ 211 174 # path hard coded. 212 175 213 configure.ldflags-append "-L/usr/lib "176 configure.ldflags-append "-L/usr/lib -L${prefix}/lib" 214 177 configure.cflags-append "-I${prefix}/include" 215 configure.env DYLD_FALLBACK_LIBRARY_PATH=${prefix}/lib 178 configure.env DYLD_FALLBACK_LIBRARY_PATH=${prefix}/lib \ 179 CFLAGS=-I${prefix}/include 216 180 217 configure.args --prefix=${destroot} /${prefix} \218 --mandir=${destroot} /${prefix}/share/man/ \181 configure.args --prefix=${destroot}${prefix} \ 182 --mandir=${destroot}${prefix}/share/man/ \ 219 183 --with-readline-includes=${prefix}/include \ 220 184 --with-readline-libraries=${prefix}/lib \ 185 --with-gmp-libraries=${prefix}/lib \ 186 --with-gmp-includes=${prefix}/include \ 221 187 --disable-openal \ 222 188 --disable-alut 223 189 … … 227 193 system "env DYLD_FALLBACK_LIBRARY_PATH=${prefix}/lib ${build.cmd} ${build.target}" 228 194 } 229 195 196 destroot { 197 system "${build.cmd} install" 198 } 230 199 231 232 200 # Note the middle "/" in the ${destroot}/${prefix} pattern. It is required, 233 201 # because the actual text we are trying to match has a "//" between the 234 202 # destroot and the prefix pieces. 235 203 236 204 post-destroot { 237 reinplace s|${destroot} /${prefix}|${prefix}|g ${destroot}/${prefix}/bin/ghc238 reinplace s|${destroot} /${prefix}|${prefix}|g ${destroot}/${prefix}/bin/ghci239 reinplace s|${destroot} /${prefix}|${prefix}|g ${destroot}/${prefix}/bin/ghc-pkg240 reinplace s|${destroot} /${prefix}|${prefix}|g ${destroot}/${prefix}/bin/ghcprof241 reinplace s|${destroot} /${prefix}|${prefix}|g ${destroot}/${prefix}/bin/hsc2hs205 reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}/${prefix}/bin/ghc 206 reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}/${prefix}/bin/ghci 207 reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}/${prefix}/bin/ghc-pkg 208 reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}/${prefix}/bin/ghcprof 209 reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}/${prefix}/bin/hsc2hs 242 210 243 211 reinplace "s|\\\$@\"\}|\\\$@\"\} -L${prefix}/lib -I${prefix}/include |" ${destroot}/${prefix}/bin/ghc 244 212 245 reinplace s|${destroot} /${prefix}|${prefix}|g ${destroot}${prefix}/lib/${name}-${version}/package.conf213 reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/lib/${name}-${version}/package.conf 246 214 247 cd ${destroot}${prefix}/lib/ghc-${version} 248 system "ranlib *.a" 215 system "cd ${destroot}${prefix}/lib/ghc-${version} && ranlib *.a" 249 216 }