Ticket #1721: Portfile

File Portfile, 3.0 KB (added by digdog@…, 21 years ago)

Portfile

Line 
1# $Id: Portfile,v 1.10 2003/11/30 03:19:15 landonf Exp $
2PortSystem 1.0
3name                    cm3
4version                 5.2.6
5categories              lang
6platforms               darwin
7maintainers             landonf@opendarwin.org
8homepage                http://www.elegosoft.com/cm3/
9description             Critical Mass Modula-3 Compiler
10long_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
14master_sites            ${homepage}
15distfiles               cm3-src-all-${version}.tgz
16
17checksums               cm3-src-all-${version}.tgz md5 \
18                             44fd8c9c905707e4f9835eaf6b747127
19
20worksrcdir              cm3
21extract.dir             ${worksrcpath}
22pre-extract             "file mkdir ${workpath}/${worksrcdir}"
23
24# Add a path entry for the bootstrap cm3 compiler
25build.env               PATH=$env(PATH):${workpath}/bootstrap/bin
26
27# M3 requires a bootstrap compiler to build
28# This port currently supports only Darwin/PPC
29variant 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
40variant 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
46post-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
52configure {
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
67build {
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
76destroot {
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}