# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
homepage https://modula3.elegosoft.com/cm3
description Critical Mass Modula-3 Compiler
long_description CM3 5.2 is an 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 https://modula3.elegosoft.com/cm3/releng/
distfiles cm3-src-all-${version}.tgz
checksums cm3-src-all-${version}.tgz md5 \
44fd8c9c905707e4f9835eaf6b747127
extract.dir ${worksrcpath}
pre-extract "file mkdir ${workpath}/${worksrcdir}"
# Add a path entry for the bootstrap cm3 compiler
build.env PATH=$env(PATH):${workpath}/bootstrap/bin
# M3 requires a bootstrap compiler to build
# This port currently supports only Darwin/PPC
platform darwin powerpc {
distfiles-append cm3-min-POSIX-PPC_DARWIN-${version}.tgz
checksums-append cm3-min-POSIX-PPC_DARWIN-${version}.tgz md5 \
6b1421b926731c36c0fc98e86f08c24c
# Apple's cpp-precomp in Jaguar (10.2) incorrectly handles
# gcc 'poisoned' tokens, so we turn it off.
# It only makes the build take longer anyway.
patchfiles patch-fix-cpp-precomp.diff
distfiles-append cm3-min-POSIX-FreeBSD4-${version}.tgz
checksums-append cm3-min-POSIX-FreeBSD4-${version}.tgz md5 \
162156b414ffebd24c8f0ab9b71ee5e8
# Create bootstrap directory and extract the cm3 bootstrap to it
file mkdir ${workpath}/bootstrap
system "tar -C ${workpath}/bootstrap -zxf ${worksrcpath}/system.tgz"
# Configure the bootstrap
${filespath}/${os.platform}-cm3.cfg ${workpath}/bootstrap/bin/cm3.cfg
s|@USE_ROOT@|\"${workpath}/bootstrap\"|g \
${workpath}/bootstrap/bin/cm3.cfg