1 | # $Id: Portfile,v 1.10 2003/11/30 03:19:15 landonf Exp $ |
---|
2 | PortSystem 1.0 |
---|
3 | name cm3 |
---|
4 | version 5.2.6 |
---|
5 | categories lang |
---|
6 | platforms darwin |
---|
7 | maintainers landonf@opendarwin.org |
---|
8 | homepage http://www.elegosoft.com/cm3/ |
---|
9 | description Critical Mass Modula-3 Compiler |
---|
10 | long_description CM3 5.2 is an open source release of Critical Mass Modula-3. \ |
---|
11 | It is a complete easy-to-use and easy-to-install Modula-3 system \ |
---|
12 | that contains considerable enhancements over its ancestor DEC SRC Modula-3. |
---|
13 | |
---|
14 | master_sites ${homepage} |
---|
15 | distfiles cm3-src-all-${version}.tgz |
---|
16 | |
---|
17 | checksums cm3-src-all-${version}.tgz md5 \ |
---|
18 | 44fd8c9c905707e4f9835eaf6b747127 |
---|
19 | |
---|
20 | worksrcdir cm3 |
---|
21 | extract.dir ${worksrcpath} |
---|
22 | pre-extract "file mkdir ${workpath}/${worksrcdir}" |
---|
23 | |
---|
24 | # Add a path entry for the bootstrap cm3 compiler |
---|
25 | build.env PATH=$env(PATH):${workpath}/bootstrap/bin |
---|
26 | |
---|
27 | # M3 requires a bootstrap compiler to build |
---|
28 | # This port currently supports only Darwin/PPC |
---|
29 | variant darwin powerpc { |
---|
30 | distfiles-append cm3-min-POSIX-PPC_DARWIN-${version}.tgz |
---|
31 | checksums-append cm3-min-POSIX-PPC_DARWIN-${version}.tgz md5 \ |
---|
32 | 6b1421b926731c36c0fc98e86f08c24c |
---|
33 | |
---|
34 | # Apple's cpp-precomp in Jaguar (10.2) incorrectly handles |
---|
35 | # gcc 'poisoned' tokens, so we turn it off. |
---|
36 | # It only makes the build take longer anyway. |
---|
37 | patchfiles patch-fix-cpp-precomp.diff |
---|
38 | } |
---|
39 | |
---|
40 | variant freebsd i386 { |
---|
41 | distfiles-append cm3-min-POSIX-FreeBSD4-${version}.tgz |
---|
42 | checksums-append cm3-min-POSIX-FreeBSD4-${version}.tgz md5 \ |
---|
43 | 162156b414ffebd24c8f0ab9b71ee5e8 |
---|
44 | } |
---|
45 | |
---|
46 | post-extract { |
---|
47 | # Create bootstrap directory and extract the cm3 bootstrap to it |
---|
48 | file mkdir ${workpath}/bootstrap |
---|
49 | system "tar -C ${workpath}/bootstrap -zxf ${worksrcpath}/system.tgz" |
---|
50 | } |
---|
51 | |
---|
52 | configure { |
---|
53 | # Configure the bootstrap |
---|
54 | file copy -force \ |
---|
55 | ${filespath}/${os.platform}-cm3.cfg ${workpath}/bootstrap/bin/cm3.cfg |
---|
56 | reinplace \ |
---|
57 | s|@USE_ROOT@|\"${workpath}/bootstrap\"|g \ |
---|
58 | ${workpath}/bootstrap/bin/cm3.cfg |
---|
59 | reinplace \ |
---|
60 | s|@INSTALL_ROOT@|\"${destroot}${prefix}/cm3\"|g \ |
---|
61 | ${workpath}/bootstrap/bin/cm3.cfg |
---|
62 | reinplace \ |
---|
63 | s|@PREFIX@|\"${prefix}/cm3\"|g \ |
---|
64 | ${workpath}/bootstrap/bin/cm3.cfg |
---|
65 | } |
---|
66 | |
---|
67 | build { |
---|
68 | set cm3-buildscript "cd ${worksrcpath}/scripts && env ${build.env}" |
---|
69 | # build core distribution |
---|
70 | system "${cm3-buildscript} ./do-cm3-core.sh buildship" |
---|
71 | |
---|
72 | # build tcp package |
---|
73 | system "${cm3-buildscript} ./do-pkg.sh buildship tcp" |
---|
74 | } |
---|
75 | |
---|
76 | destroot { |
---|
77 | # create a link to cm3 (m3 compiler) in ${prefix}/cm3/bin |
---|
78 | system "cd ${destroot}${prefix}/cm3/bin/ && ln -s ../pkg/cm3/PPC_DARWIN/cm3" |
---|
79 | |
---|
80 | # copy bootstrap configuration file to destroot |
---|
81 | file copy -force \ |
---|
82 | ${workpath}/bootstrap/bin/cm3.cfg ${destroot}${prefix}/cm3/bin/cm3.cfg |
---|
83 | |
---|
84 | # update file paths to reflect final installation paths |
---|
85 | reinplace \ |
---|
86 | s|@INSTALL_ROOT@|\"${prefix}/cm3\"|g \ |
---|
87 | ${destroot}${prefix}/cm3/bin/cm3.cfg |
---|
88 | reinplace \ |
---|
89 | s|@USE_ROOT@|\"${prefix}/cm3\"|g \ |
---|
90 | ${destroot}${prefix}/cm3/bin/cm3.cfg |
---|
91 | reinplace \ |
---|
92 | s|@PREFIX@|\"${prefix}/cm3\"|g \ |
---|
93 | ${destroot}${prefix}/cm3/bin/cm3.cfg |
---|
94 | } |
---|