source: trunk/dports/java/mars/Portfile

Last change on this file was 111147, checked in by ryandesign@…, 4 years ago

mars: update to 4.4 (#40444)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.4 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 111147 2013-09-16 01:26:49Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                mars
7version             4.4
8set releasedate     Aug2013
9set fileversion     [join [split ${version} .] _]
10revision            0
11categories          java devel
12platforms           darwin
13supported_archs     noarch
14license             MIT
15maintainers         gmx.de:Torsten.Maehne openmaintainer
16
17description         MARS (MIPS Assembler and Runtime Simulator)
18
19long_description    MARS is a lightweight interactive development environment \
20                    (IDE) for programming in MIPS assembly language, intended \
21                    for educational-level use with Patterson and Hennessy's \
22                    Computer Organization and Design.
23
24homepage            http://courses.missouristate.edu/kenvollmar/mars/
25master_sites        ${homepage}MARS_${fileversion}_${releasedate}/
26distname            Mars${fileversion}
27use_zip             yes
28extract.suffix      .jar
29
30checksums           sha1    54544a2f212cc5cc96868efe7ea8973be3f778fb \
31                    rmd160  15480082329e9b9cc8d7ea81dc84cd3922dfbefc
32
33depends_lib         bin:java:kaffe
34
35use_configure       no
36
37build               {}
38
39# The only reason we extract the zip file is to get the image for the
40# OS X app icon (and patch the sources for the OS-X-specific jedit bug),
41# so we don't need to extract it on other platforms.
42if {${os.platform} ne "darwin"} {
43    extract.only
44    destroot {
45        # Install Mars JAR
46        xinstall -m 755 -d ${destroot}${prefix}/share/java
47        xinstall -m 644 -W ${distpath} ${distname}.jar ${destroot}${prefix}/share/java
48
49        # Install and configure mars command line wrapper
50        xinstall -m 755 ${filespath}/mars.in ${destroot}${prefix}/bin/mars
51        reinplace "s|@MARSJARPATH@|${prefix}/share/java/${distname}.jar|g" ${destroot}${prefix}/bin/mars
52    }
53}
54
55platform darwin {
56    depends_build-append        port:makeicns
57
58    extract.mkdir               yes
59# As long as the OS-X-specific jedit bug is present in the editor of Mars,
60# we have to unpack the whole JAR.
61#    pre-extract {
62#        extract.post_args-append    images/MarsThumbnail.gif
63#    }
64
65    # The jedit-based editor of MARS requires a patch on OS X to enable
66    # entering characters requiring the ALT key.
67    patchfiles          patch-mars-venus-editors-jeditsyntax-DefaultInputHandler.java
68    build {
69        # Recompile patched source file
70        # mars/venus/editors/jeditsyntax/DefaultInputHandler.java
71        system "cd ${worksrcpath} && javac ${worksrcpath}/mars/venus/editors/jeditsyntax/DefaultInputHandler.java"
72        # Create new JAR archive
73        system "cd ${worksrcpath} && sh ${worksrcpath}/CreateMarsJar.bat"
74    }
75
76    destroot {
77        # Install Mars JAR
78        xinstall -m 755 -d ${destroot}${prefix}/share/java
79        xinstall -m 644 ${worksrcpath}/Mars.jar ${destroot}${prefix}/share/java/${distname}.jar
80
81        # Install and configure mars command line wrapper
82        xinstall -m 755 ${filespath}/mars.in ${destroot}${prefix}/bin/mars
83        reinplace "s|@MARSJARPATH@|${prefix}/share/java/${distname}.jar|g" ${destroot}${prefix}/bin/mars
84    }
85
86    # Build a nice .app
87    post-destroot {
88        set MarsAppPath ${destroot}${applications_dir}/MARS.app
89        # Build paths
90        xinstall -m 755 -d ${MarsAppPath}/Contents/Resources/Java \
91                           ${MarsAppPath}/Contents/MacOS
92        # Basic package information
93        xinstall -m 644 ${filespath}/PkgInfo ${MarsAppPath}/Contents/PkgInfo
94        xinstall -m 644 ${filespath}/Info.plist.in ${MarsAppPath}/Contents/Info.plist
95        # Set the version in the Info.plist
96        reinplace "s|@VERSION@|${version}|g" ${MarsAppPath}/Contents/Info.plist
97        # Set the JAR file name
98        reinplace "s|@MARSJARFILE@|${distname}.jar|g" ${MarsAppPath}/Contents/Info.plist
99        # Generate the icon
100        system "${prefix}/bin/makeicns -in ${worksrcpath}/images/MarsThumbnail.gif -out ${MarsAppPath}/Contents/Resources/Mars.icns"
101        # Link to the JAR file
102        ln -s ${prefix}/share/java/${distname}.jar \
103                        ${MarsAppPath}/Contents/Resources/Java/${distname}.jar
104        # Copy the stub app
105        xinstall -m 755 "/System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/MacOS/JavaApplicationStub" \
106                        ${MarsAppPath}/Contents/MacOS
107    }
108}
Note: See TracBrowser for help on using the repository browser.