You've already forked macports-ports
mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
mars: Update to version 4.5.1
The original MARS web site got moved to GitHub. The patch for the jedit-based editor is dropped, as it is fixed upstream. universalJavaApplicationStub replaces the JavaApplicationStube removed from macOS.
This commit is contained in:
committed by
Renee Otten
parent
ce7afb10bb
commit
ef86185d76
+32
-43
@@ -3,9 +3,9 @@
|
||||
PortSystem 1.0
|
||||
|
||||
name mars
|
||||
version 4.4
|
||||
set releasedate Aug2013
|
||||
set fileversion [join [split ${version} .] _]
|
||||
version 4.5.1
|
||||
set releasedate Oct2024
|
||||
set fileversion [join [lrange [split ${version} .] 0 1] _]
|
||||
revision 0
|
||||
categories java devel
|
||||
platforms {darwin any}
|
||||
@@ -20,14 +20,26 @@ long_description MARS is a lightweight interactive development environment \
|
||||
for educational-level use with Patterson and Hennessy's \
|
||||
Computer Organization and Design.
|
||||
|
||||
homepage http://courses.missouristate.edu/kenvollmar/mars/
|
||||
master_sites ${homepage}MARS_${fileversion}_${releasedate}/
|
||||
homepage https://dpetersanderson.github.io/
|
||||
master_sites https://github.com/dpetersanderson/MARS/releases/download/v.${version}:mars \
|
||||
https://github.com/tofi86/universalJavaApplicationStub/raw/refs/tags/v3.3.0/src:jappstub
|
||||
|
||||
distname Mars${fileversion}
|
||||
distfiles Mars${fileversion}.jar:mars \
|
||||
universalJavaApplicationStub:jappstub
|
||||
|
||||
use_zip yes
|
||||
extract.only ${distname}.jar
|
||||
extract.suffix .jar
|
||||
|
||||
checksums sha1 54544a2f212cc5cc96868efe7ea8973be3f778fb \
|
||||
rmd160 15480082329e9b9cc8d7ea81dc84cd3922dfbefc
|
||||
checksums Mars4_5.jar \
|
||||
rmd160 1d87e3fbe0c06af5917f56c4e282db89223b1b49 \
|
||||
sha256 ac340b676ba2b62246b9df77e62f81ad4447bcfd329ab539716bcd09950b7096 \
|
||||
size 4169142 \
|
||||
universalJavaApplicationStub \
|
||||
rmd160 45726412bc0c8c67fd8dd4282316dce871fe6c09 \
|
||||
sha256 49bd31b90d41b1afd2d0e47636fea2461f5d16c2a55e0147fd82d77305514151 \
|
||||
size 37008
|
||||
|
||||
depends_lib bin:java:kaffe
|
||||
|
||||
@@ -36,50 +48,27 @@ use_configure no
|
||||
build {}
|
||||
|
||||
# The only reason we extract the zip file is to get the image for the
|
||||
# OS X app icon (and patch the sources for the OS-X-specific jedit bug),
|
||||
# so we don't need to extract it on other platforms.
|
||||
# macOS app icon, so we don't need to extract it on other platforms.
|
||||
if {${os.platform} ne "darwin"} {
|
||||
extract.only
|
||||
destroot {
|
||||
# Install Mars JAR
|
||||
xinstall -m 755 -d ${destroot}${prefix}/share/java
|
||||
xinstall -m 644 -W ${distpath} ${distname}.jar ${destroot}${prefix}/share/java
|
||||
}
|
||||
|
||||
# Install and configure mars command line wrapper
|
||||
xinstall -m 755 ${filespath}/mars.in ${destroot}${prefix}/bin/mars
|
||||
reinplace "s|@MARSJARPATH@|${prefix}/share/java/${distname}.jar|g" ${destroot}${prefix}/bin/mars
|
||||
}
|
||||
destroot {
|
||||
# Install Mars JAR
|
||||
xinstall -m 755 -d ${destroot}${prefix}/share/java
|
||||
xinstall -m 644 -W ${distpath} ${distname}.jar ${destroot}${prefix}/share/java
|
||||
|
||||
# Install and configure mars command line wrapper
|
||||
xinstall -m 755 ${filespath}/mars.in ${destroot}${prefix}/bin/mars
|
||||
reinplace "s|@MARSJARPATH@|${prefix}/share/java/${distname}.jar|g" ${destroot}${prefix}/bin/mars
|
||||
}
|
||||
|
||||
platform darwin {
|
||||
depends_build-append port:makeicns
|
||||
|
||||
extract.mkdir yes
|
||||
# As long as the OS-X-specific jedit bug is present in the editor of Mars,
|
||||
# we have to unpack the whole JAR.
|
||||
# pre-extract {
|
||||
# extract.post_args-append images/MarsThumbnail.gif
|
||||
# }
|
||||
|
||||
# The jedit-based editor of MARS requires a patch on OS X to enable
|
||||
# entering characters requiring the ALT key.
|
||||
patchfiles patch-mars-venus-editors-jeditsyntax-DefaultInputHandler.java
|
||||
build {
|
||||
# Recompile patched source file
|
||||
# mars/venus/editors/jeditsyntax/DefaultInputHandler.java
|
||||
system "cd ${worksrcpath} && javac ${worksrcpath}/mars/venus/editors/jeditsyntax/DefaultInputHandler.java"
|
||||
# Create new JAR archive
|
||||
system "cd ${worksrcpath} && sh ${worksrcpath}/CreateMarsJar.bat"
|
||||
}
|
||||
|
||||
destroot {
|
||||
# Install Mars JAR
|
||||
xinstall -m 755 -d ${destroot}${prefix}/share/java
|
||||
xinstall -m 644 ${worksrcpath}/Mars.jar ${destroot}${prefix}/share/java/${distname}.jar
|
||||
|
||||
# Install and configure mars command line wrapper
|
||||
xinstall -m 755 ${filespath}/mars.in ${destroot}${prefix}/bin/mars
|
||||
reinplace "s|@MARSJARPATH@|${prefix}/share/java/${distname}.jar|g" ${destroot}${prefix}/bin/mars
|
||||
pre-extract {
|
||||
extract.post_args-append images/MarsThumbnail.gif
|
||||
}
|
||||
|
||||
# Build a nice .app
|
||||
@@ -101,7 +90,7 @@ platform darwin {
|
||||
ln -s ${prefix}/share/java/${distname}.jar \
|
||||
${MarsAppPath}/Contents/Resources/Java/${distname}.jar
|
||||
# Copy the stub app
|
||||
xinstall -m 755 "/System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/MacOS/JavaApplicationStub" \
|
||||
xinstall -m 755 ${distpath}/universalJavaApplicationStub \
|
||||
${MarsAppPath}/Contents/MacOS
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<key>CFBundleAllowMixedLocalizations</key>
|
||||
<string>true</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>JavaApplicationStub</string>
|
||||
<string>universalJavaApplicationStub</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
--- mars/venus/editors/jeditsyntax/DefaultInputHandler.java.orig 2013-03-07 17:51:06.000000000 +0100
|
||||
+++ mars/venus/editors/jeditsyntax/DefaultInputHandler.java 2013-03-07 18:21:45.000000000 +0100
|
||||
@@ -14,6 +14,7 @@
|
||||
import java.awt.Toolkit;
|
||||
import java.util.Hashtable;
|
||||
import java.util.StringTokenizer;
|
||||
+ import java.util.Properties;
|
||||
|
||||
/**
|
||||
* The default input handler. It maps sequences of keystrokes into actions
|
||||
@@ -232,19 +233,45 @@
|
||||
// matches KeyEvent.META_MASK. DPS 30-Nov-2010
|
||||
if ((modifiers & KeyEvent.META_MASK) != 0)
|
||||
return;
|
||||
- // DPS 9-Jan-2013. Umberto Villano from Italy describes Alt combinations
|
||||
- // not working on Italian Mac keyboards, where # requires Alt (Option).
|
||||
- // This is preventing him from writing comments. Similar complaint from
|
||||
- // Joachim Parrow in Sweden, only for the $ character. Villano pointed
|
||||
- // me to this method. Plus a Google search on "jeditsyntax alt key"
|
||||
- // (without quotes) took me to
|
||||
- // http://compgroups.net/comp.lang.java.programmer/option-key-in-jedit-syntax-package/1068227
|
||||
- // which says to comment out the second condition in this IF statement:
|
||||
- // if(c != KeyEvent.CHAR_UNDEFINED && (modifiers & KeyEvent.ALT_MASK) == 0)
|
||||
- // So let's give it a try!
|
||||
- // (...later) Bummer, it results in keystroke echoed into editing area when I use Alt
|
||||
- // combination for shortcut menu access (e.g. Alt+f to open the File menu).
|
||||
- if(c != KeyEvent.CHAR_UNDEFINED && (modifiers & KeyEvent.ALT_MASK) == 0)
|
||||
+ // DPS 9-Jan-2013. Umberto Villano from Italy describes Alt combinations
|
||||
+ // not working on Italian Mac keyboards, where # requires Alt (Option).
|
||||
+ // This is preventing him from writing comments. Similar complaint from
|
||||
+ // Joachim Parrow in Sweden, only for the $ character. Villano pointed
|
||||
+ // me to this method. Plus a Google search on "jeditsyntax alt key"
|
||||
+ // (without quotes) took me to
|
||||
+ // http://compgroups.net/comp.lang.java.programmer/option-key-in-jedit-syntax-package/1068227
|
||||
+ // which says to comment out the second condition in this IF statement:
|
||||
+ // if(c != KeyEvent.CHAR_UNDEFINED && (modifiers & KeyEvent.ALT_MASK) == 0)
|
||||
+ // So let's give it a try!
|
||||
+ // (...later) Bummer, it results in keystroke echoed into editing area when I use Alt
|
||||
+ // combination for shortcut menu access (e.g. Alt+f to open the File menu).
|
||||
+ //
|
||||
+ // Torsten Maehne: This is a shortcoming of the menu
|
||||
+ // shortcuts handling in the jedit component: It assumes that
|
||||
+ // modifier keys are the same across all platforms. However,
|
||||
+ // the menu shortcut keymask varies between OS X and
|
||||
+ // Windows/Linux, it is Cmd + <key> instead of Alt +
|
||||
+ // <key>. The "Java Development Guide for Mac" explicitly
|
||||
+ // discusses the issue in:
|
||||
+ // <https://developer.apple.com/library/mac/#documentation/Java/Conceptual/Java14Development/07-NativePlatformIntegration/NativePlatformIntegration.html#//apple_ref/doc/uid/TP40001909-211884-TPXREF130>
|
||||
+ //
|
||||
+ // As jedit always considers Alt + <key> as a keyboard
|
||||
+ // shortcut, they block their output in the editor, which
|
||||
+ // prevents the entry of special characters on OS X that uses
|
||||
+ // Alt + <key> for this purpose instead of AltGr + <key>, as
|
||||
+ // on Windows or Linux.
|
||||
+ //
|
||||
+ // For the latest jedit version (5.0.0), the menu
|
||||
+ // accelerators don't work on OS X, at least the special
|
||||
+ // characters can be entered using Alt + <key>. The issue is
|
||||
+ // still open, but there seems to be progress:
|
||||
+ //
|
||||
+ // http://sourceforge.net/tracker/index.php?func=detail&aid=3558572&group_id=588&atid=300588
|
||||
+ // http://sourceforge.net/tracker/?func=detail&atid=300588&aid=3604532&group_id=588
|
||||
+ //
|
||||
+ // Until this is resolved upstream, don't ignore characters
|
||||
+ // on OS X, which have been entered with the ALT modifier:
|
||||
+ if(c != KeyEvent.CHAR_UNDEFINED && (((modifiers & KeyEvent.ALT_MASK) == 0) || System.getProperty("os.name").contains("OS X")))
|
||||
{
|
||||
if(c >= 0x20 && c != 0x7f)
|
||||
{
|
||||
Reference in New Issue
Block a user