# $Id: Portfile,v 1.3 2003/03/12 09:19:19 landonf Exp $ PortSystem 1.0 name cm3 version 5.2.0 categories lang maintainers landonf@opendarwin.org description Critical Mass Modula-3 Compiler platforms darwin master_sites http://www.elegosoft.com/cm3/ distfiles cm3-src-all-${portversion}.tgz checksums cm3-src-all-5.2.0.tgz md5 \ 362e5dc0c3952bdec87f5c671a7153a8 worksrcdir cm3 extract.dir ${worksrcpath} pre-extract "file mkdir ${workpath}/${worksrcdir}" # Add bootstrap/bin to our path set env(PATH) "$env(PATH):${workpath}/bootstrap/bin" # Create cm3-buildscript variable set cm3-buildscript "cd ${worksrcpath}/scripts && M3GC_SIMPLE=yes" # M3 requires a bootstrap compiler to build # This port currently supports only Darwin/PPC variant darwin powerpc { distfiles-append cm3-min-POSIX-PPC_DARWIN-5.2.0.tgz checksums-append cm3-min-POSIX-PPC_DARWIN-5.2.0.tgz md5 \ 4632a1b5ed13536b3fde8913ca551e87 # Work-around safeFP restFP issue patchfiles patch-saveFP-restFP # Work-around "poisoned calloc" error building gcc backend patchfiles-append patch-gcc-stmt.c } post-extract { # Create bootstrap directory and extract the cm3 bootstrap to it file mkdir ${workpath}/bootstrap system "tar -C ${workpath}/bootstrap -zxf ${worksrcpath}/system.tgz" } configure { # Configure the bootstrap file copy -force \ ${filespath}/bootstrap.cm3.cfg ${workpath}/bootstrap/bin/cm3.cfg reinplace \ s|@USE_ROOT@|${workpath}/bootstrap/|g \ ${workpath}/bootstrap/bin/cm3.cfg reinplace \ s|@INSTALL_ROOT@|${destroot}${prefix}/cm3/|g \ ${workpath}/bootstrap/bin/cm3.cfg } build { # build core distribution system "${cm3-buildscript} ./do-cm3-core.sh buildship" # build tcp package system "${cm3-buildscript} ./do-pkg.sh buildship tcp" } install { # create a link to cm3 (m3 compiler) in ${prefix}/cm3/bin system "ln -s \ ${destroot}/${prefix}/cm3/pkg/cm3/PPC_DARWIN/cm3 ${destroot}/${prefix}/cm3/bin/cm3" # copy bootstrap configuration file to destroot file copy -force \ ${filespath}/bootstrap.cm3.cfg ${destroot}/${prefix}/cm3/bin/cm3.cfg # update file paths to reflect final installation paths reinplace \ s|@INSTALL_ROOT@|${prefix}/cm3/|g \ ${destroot}/${prefix}/cm3/bin/cm3.cfg reinplace \ s|@USE_ROOT@|${prefix}/cm3/|g \ ${destroot}/${prefix}/cm3/bin/cm3.cfg }