Ticket #16666: Portfile

File Portfile, 2.0 KB (added by illogical1@…, 16 years ago)

Modified Portfile which builds apple-gcc42 with c++ support

Line 
1# $Id: Portfile 35833 2008-04-07 21:36:27Z ryandesign@macports.org $
2
3PortSystem 1.0
4
5name                    apple-gcc42
6version                 5564
7categories              lang
8platforms               darwin
9maintainers             mww
10description             Apple's version of gcc 4.2
11long_description        Apple's version of the GNU compiler collection, \
12                        version 4.2. Supports C and Objective-C.
13
14homepage                http://developer.apple.com/documentation/DeveloperTools/gcc-4.2/gcc/
15master_sites            http://www.opensource.apple.com/darwinsource/tarballs/other/
16distname                gcc_42-${version}
17checksums               md5 cc919b07776db1a209ccaa48b0e19da7
18
19# Unset for macports
20set prefix      /usr
21
22post-extract {
23                file mkdir ${worksrcpath}/debug
24                file mkdir ${workpath}/destroot
25}
26
27post-patch {
28            reinplace "s|MAKEFLAGS=\$\{LOCAL_MAKEFLAGS-\"-j \$SYSCTL\"\}|MAKEFLAGS=\$\{LOCAL_MAKEFLAGS-\"-j 4\"\}|" ${worksrcpath}/build_gcc
29            reinplace "s|MAKEINFO=\$\(MAKEINFO\) \$\(MAKEINFOFLAGS\)|MAKEINFO=makeinfo \$\(MAKEINFOFLAGS\)|" ${worksrcpath}/Makefile.in
30}
31
32use_configure   no
33# This will automatically build gcc 4.2 with c++ and obj-c++ support
34build.cmd               ${worksrcpath}/build_gcc \"ppc i386\" \"ppc i386\" \
35                ${worksrcpath} ${prefix} ${workpath}/destroot ${worksrcpath}/debug
36
37destroot        {}
38
39platform darwin 9 {
40# So I can use pkgs on 10.4 if built on 10.5
41    post-destroot {
42                        system "cd  ${destroot}${prefix}/libexec/gcc;ln -s i686-apple-darwin9 i686-apple-darwin8"
43                        system "cd  ${destroot}${prefix}/libexec/gcc;ln -s powerpc-apple-darwin9 powerpc-apple-darwin8"
44                        system "cd  ${destroot}${prefix}/lib/gcc;ln -s i686-apple-darwin9 i686-apple-darwin8"
45                        system "cd  ${destroot}${prefix}/lib/gcc;ln -s powerpc-apple-darwin9 powerpc-apple-darwin8"
46            # Delete docs dir because installing to the wrong location irks me and I don't want to fix it
47            # Bonus points to whoever reinplaces to correct location
48            system "rm -r ${destroot}/Developer"
49    }
50}
51
52destroot.violate_mtree yes
53
54livecheck.check         moddate
55livecheck.url           ${master_sites}
56