source: trunk/dports/lang/cm3/Portfile

Last change on this file was 129181, checked in by khindenburg@…, 3 years ago

cm3: update master_site and livecheck. Note that the download site only has 5.8.x versions; the sites archives only has 5.7.x #26676

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