diff -urN enigma.orig/Portfile enigma/Portfile
--- enigma.orig/Portfile	2009-12-28 14:16:18.000000000 +0100
+++ enigma/Portfile	2009-12-28 14:17:28.000000000 +0100
@@ -26,15 +26,42 @@
     sha1 2f9f5aaf3d233c248d818c3a2fd5ea873d34135f \
     rmd160 671971415e8d96bc84e2a823d66359025e158128
 
+patchfiles \
+    patch-src-lev-ScoreManager.cc.diff
+
+post-patch {
+    reinplace s/-lxerces/-lxerces-c/ ${worksrcpath}/configure
+
+    reinplace s/bundle.*/bundle/ ${worksrcpath}/Makefile.in
+    reinplace -E {/\/Frameworks/d} ${worksrcpath}/src/Makefile.in
+
+    reinplace {s/unsigned int/XMLSize_t/} \
+        ${worksrcpath}/src/Utf8ToXML.cc \
+        ${worksrcpath}/src/XMLToUtf8.cc
+}
+
 depends_lib \
     port:gettext \
     port:libpng \
     port:libsdl \
-    port:libsdl-framework \
-    port:libsdl_image-framework \
-    port:libsdl_mixer-framework \
-    port:libsdl_ttf-framework \
-    port:xercesc \
+    port:libsdl \
+    port:libsdl_image \
+    port:libsdl_mixer \
+    port:libsdl_ttf \
+    port:xercesc3 \
     port:zlib
 
+use_parallel_build      yes
+
 build.target            all macapp
+
+destroot {
+    copy ${worksrcpath}/etc/macfiles/Enigma.app \
+        ${destroot}${applications_dir}/
+    xinstall ${worksrcpath}/src/enigma \
+        ${destroot}${applications_dir}/Enigma.app/Contents/MacOS/Enigma
+}
+
+livecheck.type          regex
+livecheck.url           ${homepage}download.html
+livecheck.regex         {Stable Release \(Version (\d+(?:\.\d+)*)\)}
diff -urN enigma.orig/files/patch-src-lev-ScoreManager.cc.diff enigma/files/patch-src-lev-ScoreManager.cc.diff
--- enigma.orig/files/patch-src-lev-ScoreManager.cc.diff	1970-01-01 01:00:00.000000000 +0100
+++ enigma/files/patch-src-lev-ScoreManager.cc.diff	2009-12-28 02:49:08.000000000 +0100
@@ -0,0 +1,67 @@
+--- src/lev/ScoreManager.cc.orig	2009-12-28 02:36:23.000000000 +0100
++++ src/lev/ScoreManager.cc	2009-12-28 02:44:18.000000000 +0100
+@@ -65,14 +65,14 @@
+     class ScoreDomSerFilter : public DOMWriterFilter {
+ #endif
+         public:
+-            virtual short acceptNode(const DOMNode *node) const;
++            virtual DOMNodeFilter::FilterAction acceptNode(const DOMNode *node) const;
+             virtual unsigned long getWhatToShow () const {
+                 return DOMNodeFilter::SHOW_ALL;
+             }
+             virtual void setWhatToShow (unsigned long toShow) {}
+     };
+     
+-    short ScoreDomSerFilter::acceptNode(const DOMNode *node) const {
++    DOMNodeFilter::FilterAction ScoreDomSerFilter::acceptNode(const DOMNode *node) const {
+         if (node->getNodeType () == DOMNode::ELEMENT_NODE &&
+                  std::string(XMLtoUtf8(node->getNodeName()).c_str()) == "level") {
+             const DOMElement *e = dynamic_cast<const DOMElement *>(node);
+@@ -119,7 +119,7 @@
+         
+         if (stateUserId.length() == 16 && 
+                 stateUserId.find_first_not_of("0123456789ABCDEF") == std::string::npos) {
+-            unsigned i1, i2, i3, i4; 
++            unsigned long i1, i2, i3, i4; 
+             std::istringstream s1(stateUserId.substr(0, 4));
+             std::istringstream s2(stateUserId.substr(4, 4));
+             std::istringstream s3(stateUserId.substr(8, 4));
+@@ -233,7 +233,7 @@
+                         hasValidUserId = true;
+                     } else {
+                         // create first part of user id based on time stamp
+-                        unsigned id;
++                        unsigned long id;
+                         if (RAND_MAX > 0x10000) {
+                             id = std::rand() & 0xFFFFFFFF;
+                         } else {
+@@ -319,7 +319,7 @@
+     }
+     
+     void ScoreManager::finishUserId(unsigned id3) {
+-        unsigned i1, i2, i3, i4; 
++        unsigned long i1, i2, i3, i4; 
+         std::istringstream s1(userId.substr(0, 4));
+         std::istringstream s2(userId.substr(4, 4));
+         s1 >> std::hex >> i1;
+@@ -334,7 +334,7 @@
+     
+     std::string ScoreManager::sec(std::string target) {
+         int len = target.size();
+-        unsigned r = 0;
++        unsigned long r = 0;
+         const char *p = target.c_str();
+         
+         while (len--)
+@@ -362,9 +362,9 @@
+             Log << "ReId Windows 1.00 User Id: " << userId << "\n";
+             setProperty("UserId1.00", userId);
+             app.state->setProperty("UserId1.00", userId);
+-            unsigned id1 = std::rand() & 0xFFFF;
++            unsigned long id1 = std::rand() & 0xFFFF;
+             userId.replace(0, 4, ecl::strf("%.4lX",id1));
+-            unsigned id2, id3, id4;
++            unsigned long id2, id3, id4;
+             std::istringstream s2(userId.substr(4, 4));
+             std::istringstream s3(userId.substr(8, 4));
+             s2 >> std::hex >> id2;
