# $Id: Portfile,v 1.7 2003/08/05 09:29:14 jkh Exp $ PortSystem 1.0 name cm3 version 5.2.4 categories lang platforms darwin maintainers landonf@opendarwin.org homepage http://www.elegosoft.com/cm3/ description Critical Mass Modula-3 Compiler long_description CM3 5.1 is the first open source release of \ Critical Mass Modula-3. It is a complete easy-to-use \ and easy-to-install Modula-3 system that contains \ considerable enhancements over its ancestor DEC SRC \ Modula-3. master_sites ${homepage} distfiles cm3-src-all-${version}.tgz checksums cm3-src-all-${version}.tgz md5 \ d7ce529bc6bffc87ade367c7c0d79256 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-${version}.tgz checksums-append cm3-min-POSIX-PPC_DARWIN-${version}.tgz md5 \ b12f68341a97f2af1eac0c77929af77a # Work-around "poisoned calloc" error building gcc backend patchfiles 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" } destroot { # create a link to cm3 (m3 compiler) in ${prefix}/cm3/bin cd ${destroot}/${prefix}/cm3/bin/ system "ln -s \ ../pkg/cm3/PPC_DARWIN/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 }