MacPorts After Mavericks

You’ve finally upgraded your Macbook pro to Mavericks. Sure the other kids have been slinging the fancy new OS for a while now but you’ve been a straggler. You wanted to make sure the water was indeed safe before toe dipping. Maybe you’re just cautious, maybe you’ve been down this road before and bitten. Whatever the case, hey there! I’m Cliff. You’re here because one of your command line tools suddenly stopped working. I’m here because I just fixed it for you. Read on to find out what you should do after taking on Mavericks on your trusty silver laptop.

Say you’ve typed the name of a command you were using last month which was called… oh I dunno, asciidoc. Go ahead, say it… right now, audibly. I’ll wait… Did you say it? Of course you didn’t because that would be a ridiculous thing to do, especially at X o’clock during your work day/personal time after performing the Google search which landed you on this page.  Here you are just looking for an answer to why your command line isn’t giving you the respect that Aretha Franklin demanded back in 1967 and here I go sitting on standby waiting for you to make a goon of yourself by speaking out loud to absolutely nobody. We could go on like this for ages or I could just get to the point and say what I set out to say. Now what was I saying??? Oh, right! Say you have just typed the name of… [wait I already said that] say you just typed asciidoc into your terminal and say the terminal was like, “Whaaa? I don’t understand your French, cousin!” Now why would your terminal respond that way? I mean it’s not like you are actually related to the terminal or anything. It’s just a program, rather a collection of 1s and 0s spinning on your magnetic disk… unless you have a solid state drive. (Don’t most people have SSDs these days?) Then for you and these 1s and 0s to be actual cousins would mean that your parents were somehow siblings and since the parent of most computer programs is some hacker with bad hygiene one might assume his siblings have similar hygiene problems which, though possible, would lessen the probability of pro-creation leading to your birth.

I had a point somewhere about one or two sentences back but now I’m a bit lost. Where was I? Something about your terminal acting all confused like, “whaaa…?” wasn’t it? Okay, now say your terminal was like “whaaa…?” and you were all like, “you know, ‘asciidoc’!! Now gimme my converted output!” And then the terminal was still like “whaaaa…?” How does this happen? I mean, you were just speaking “asciidoc” in all of its PDF flavors a month ago and now it’s like your terminal doesn’t even know you despite the fact that it refers to you as a cousin, implying some sort of biological relation. It just doesn’t make sense… your binary flesh and blood acting like a random citizen from another country. Here’s where it all went wrong.

Mavericks Upgrade

After upgrading to Mavericks software installed with MacPorts stops behaving. The simple solution is to reinstall MacPorts. The best way to do this is to run “Xcode-select –install” from your terminal which will trigger an install/update of the Xcode Command line tools. This is important because MacPorts still thinks the tools it used before the upgrade (like /usr/bin/gnutar) are available. After reinstalling the tools you should reinstall MacPorts using the binary package which will see the upgraded command line tools. Read how to migrate MacPorts here. After upgrading your command line tools and reinstalling MacPorts you and your terminal will be on speaking terms again. Thanks for stopping to read my foolishness and remember to tip your waiter… because if you don’t tip then the waiter leaves nasty stuff in your food and stuff. That nasty stuff leads to diseases like foot and hand-mouth disease. I don’t know if that’s a real disease or not, its something that my father in law complained to my wife about when she was younger. She’s older now and has never caught foot and hand-mouth because she leaves nice tips. The waiters sometimes smile at her too, though I don’t necessarily think it’s because of the tips. I think they smile at her because she has a nice smile. Speaking of her smile, don’t forget to run your system updates after the Mavericks upgrade because apple has other fixes for you. I don’t really know what that has to do with my wife’s smile. It seemed related when I first typed it but now it just looks silly. My whole post is silly and probably hasn’t helped anyone. I’m rambling because I’m on my 3rd cup of coffee today. I should just stop typing now. Did you tip your waiter? I’m just sayin’…

Create Windows 7 Install Disc On a Macbook Pro

I was trying to install Windows 7 on my Mac this morning and it turned out to be an all day affair! My biggest issue was trying to create a Windows 7 install disc on a USB flash drive using Boot Camp. (Boot Camp is software included with OS X Lion so you can run compatible versions of Microsoft Windows on an Intel-based Mac.) For reasons known only to Steve and finally now me, the checkbox that enables this magic was greyed out and disabled under Boot Camp. I found a thread in a forum discussing the issue and was able to fix it. (I lost the link to the thread but I’ll repeat the important parts here.) The fix involves editing an “Info.plist” file under the Boot Camp application bundle. For those that are not Mac savvy, apps on the Mac are simply folders (commonly referred to as bundles) with a “.app” suffix which causes the “Finder” application to treat them differently. You can right click any “.app” bundle and chose to “Show Package Contents” to look inside them.

So showing the contents of the “Boot Camp” app located under “/Applications/Utilities” will expose a “Contents” folder which contains the “Info.plist” file. Edit this file using the Dashcode app (I believe this installs with Xcode which is included on the Lion/Snow Leopard install media under the optional folder) and look for the “USBBootSupportedModels” setting in the left hand pane. Clicking the little triangle will expose/unfold a bunch of models that support USB booting. According to Apple, these are the only models that support the feature but you can alter this file to include the model of the Mac you currently use. Click the Apple icon in the top most menu and find the “About This Mac” option. click “More Info” then “System Report”. This is where you look to find your Model Identifier. Mine was MacBookPro6,2 which would translate to a MBP62 string. There is also a Boot Rom version in the same report a little further down that you should pay attention to. Mine was listed as MBP61.0057.B0C. I took this to mean that I should also include a MBP61 string in the list of supported models as well. Clicking the little plus icon next to “USBBootSupportedModels” will allow you to add strings for both your model and boot model. Save the file to your desktop. I was very carefully to rename the original file to something like Info.old.plist before copying the modified file back in place from my desktop. I also went in and changed the ownership of the file to “root:wheel” after copying. Follow these steps then when you restart Boot Camp the option should be available to you. Happy “Boot Camping!”

Didn’t get far

I was trying to develop J2ME with Maven on my Mac and blogging about it at the same time this past weekend. As an update I didn’t get too far. Fow what it’s worth, I did get a jar to build and I was able to manually upload it to a web server and then install it on my phone. The app worked but I still need to work out the kinks in automating the deployment process. I’m not sure if my Blackberry supports bluetooth installs and if it does I can’t find any documentation on it anywhere. On my drive in this morning I got to thinking about going the rest of the way and building a Blackberry plugin for Maven, one that would execute rapc and SignatureTool. I’ll have to prototype that from the command line first. More on that later. Back to regular work for now.

Run Progaurd Preverify os OSX?

Last night I went heads down researching and trying to figure out how to get passed the infamous preverify hurdle when building J2ME apps on OS X. I’m happy to report that I’m an idiot. I went through a boatload of trouble finding and almost attempting to fix a bug in the Antenna preverify task as it is slightly broken on OS X. I emailed everyone I could think of who had anything to do with Antenna, the Maven2-J2ME-plugin, and OS X. I submitted to blog posts along the way as I worked. Just moments ago I found what looks like a much more simple fix. The Pyx4ME project includes support for Progaurd which now includes a preverifier! I completely overlooked this option as I waded through mounds of documentation al from different sources regarding the best way to get past preverification on OS X.

I just ran a build with the Progaurd preverify option and it succeeded! I haven’t tried to run it or anything… that step comes next. I’m all too excited to see something actually run all the way through on my Mac.

I must admit that I’m slightly hesitant to take this approach due to the frailties our team has found with build time tools for J2ME. I’m speaking about issues with different JVMs, different obfuscators, too many obfuscators, lack of obfuscators, preverify configuration, application signing methodologies, and every other flaming hoop you have to leap through to get a decent build for a single device. I’d go into detail but I wanna keep plugging away to see how far my insanity can carry me.

Run WTK preverify on OSX!

In other breaking news I found a possible way to do true cross platform WTK development. If you’re not familiar OS X is the one platform where you really can’t do JavaME unless you’re really really savvy! The missing too is preverify. (An intel Mac compatible version can be found deep in the bowels of the PhoneME source download.) There’s the ol’ MPowerplayer preverify tool but that’s a little dated and out of synch with the WTK preverify tool. As a result you’ll find tools such as the EclipseME and Pyx4ME plugins won’t work with it. (Actually I believe EclipseME has Mpowerplayer support but I haven’t tried it.) I’m gonna keep this short so I can work on it. There’s this cat that’s blogging about doing cross platform JavaME development and I’m reading the blog now. On the blog he explains that the preverify tool in the PhoneME MR2 download under phoneme_feature/cldc/build/share/bin/darwin_powerpc/ will run on an Intel Mac. I just tried it on my 2.4Ghz MacPro running Leopard and I was able to bring up the help text from the command line. I’m loosely following his write up and a few other tutorials and links in an attempt to create a deployable Blackberry J2ME project using Maven on my Mac. We’ll see how far I get.

Run The Blackberry Compiler on Linux

Run rapc on Linux? Rapc for Mac? BSD and rapc?

Seriously, is this possible? I’ve been wondering for a while how feasible it would be to do J2ME development full time on a Mac or Linux machine and I dunno… it sounds reasonable at times and far fetched at other times. Today I found this gem. A guy supposedly got rapc, the Blackberry compiler, to work on a Linux machine. I’ve personally managed to sign Blackberry apps without requiring a full JDE install so maybe this is the other half of what I’ve been looking for? Here’s a shameless copy from the forum, in case it ever get deleted or lost:

1. Compile normal midp-2.0 midlet with J2ME SDK from Sun
2. set up $WTK_HOME to point to your J2ME install, $RIM to point to
your JDE/MDS/classpath, and $APPNAME to your app name
4. cd to $WTK_HOME/apps/$APPNAME
3. run
java -jar $RIM/rapc.jar import=$RIM/net_rim_api.jar \
codename=$APPNAME -midlet jad=bin/$APPNAME.jad bin/$APPNAME.jar

Your .cod file will end up in current dir. bin/$APPNAME.jad will be modified to contain all
BB-specific info.

I’m looking to do something with this knowledge. I’ll post back if I ever come up with something.



What is it? It’s a tool, much like VNC, GotoMyPC, FogCreek Co-Pilot, etc. which allows you to remote control a computer of your choice. The difference is RDC is a Microsoft product using Microsoft proprietary protocols for remoting. They offer a version for Mac users too. So if you own a Macintosh and need to do something like, oh, I dunno, control a Windows computer you can do so. I use RDC. I use it because I’m allergic to Chicken of the VNC. Truth be told, VNC from Mac to Windows sux! You can’t get your work done, your keys are all incorrectly mapped, there’s little option for customization, it’s terrible! With RDC you have most your your keys mapped correctly. There’s the Windows key, Alt+Tab works correctly, Ctrl copy/paste works, multi-select, just about everything except an insert key. (If you’re on a MacBook Pro you have to remember the trick with the fn+delete to get a true delete instead of a backspace and honestly why don’t the y just stick the extra button on the Mac keyboard? Are they so aesthetically overachieving that they’re afraid the general user community will be like, “Oh no! there’s two keys for deleting characters! I’m gonna haffta grow an extra finger to operate it!” Really would one more [two more, throw an insert key in there too] key ruin the shape of the keyboard or something?)

So yes, I use RDC because it maps my keys correctly. The other day I started RDC. I got a polite message informing me that my beta copy was outdated and suggesting that I upgrade. In my business one kinda understands the underpinnings of such a dialog, having worked on at least two auto-versioning systems just completing one recently it comes as no surprise that a piece of software may find the need to maintain itself. So I elect to upgrade. Now lets talk about auto versioning for a minute. I feel it should be as unintrusive as possible. I’ve seen at least two other good examples of such unobtrusiveness on the Mac. Adium occasionally updates itself and the whole process always runs smoothly. It fetches the latest version from the web, unpacks and installs itself, and restarts with little interruption. ZipEG is another such auto-versioning tool that causes little disruption. The tool I just wrote is also similar, however I’ve not figured out how to trigger a restart from J2ME and I fight with the unpredictability of the device that sometimes chooses to allow me to run an app after installing and sometimes forces a reboot. At any rate, that’s what auto-versioning should work like. Ask once, do the update, restart, and get the [insert four letter explitive here] outta my way.

Microsoft appears to choose extra dialogs bearing its icon over simplicity whenever possible. Let me back up a minute and explain the RDC upgrade process. The update warning appears giving you the option of upgrading or continuing. (Thank God for options, you’ll see why later.) You click “Download Latest Version” and instead of performing the upgrade it points your browser to the site where you can download and install the latest version. Not too bad, just extra steps for end users. Then you download and install. When I reopen my .rdc file (this is the file containing all of the settings, user name, password, etc. for my remote session) it seems to be associated with the older version of RDC because I continue to get the out of date dialog. I delete the older version which was saved in a non-standard sub-folder under “Applications”, I update my QuickSilver index because I use QuickSilver for just about everything short of filing my taxes though I think there is a 1040 and a 1040a QuickSilver plugin available, and I launch RDC again this time directly and still get the prompt. I delete all installs of RDC and reinstall from the downloaded .dmg file. (On the Mac a .dmg is kinda like an archive you open them and sometimes they include installers.) Same dialog. After accepting the reality of the dialog that is not going away, I click the continue button. Lo and behold I am patronized by another dialog telling me that RDC cannot verify the identity of the computer I want to connect to. Apparently, according to the dialog box, this problem can occur if the remote computer is running a version of Windows that is earlier than Windows Vista. Once again I am given the option of connecting anyway as if to say, “are you sure you want to connect to a Windows XP device? Wouldn’t you rather click no then download the latest version of Windows Vista and install before you continue? Thank you for using Windows products.”

Now I always get two dialog prompts whenever I launch RDC. The first one reminds me that I’m still using a beta copy and I should update to a release version that does not appear on the web site. The second one reminds me of how foolish I am for daring to still using a legacy Windows XP device of a remote connection. I use to be able to walk right into my Dell XP box from QuickSilver by keying RDC aqnd hitting enter twice, once to laucnh and once to bypass the standard AOL notice dialog that pops up on WinXP screen login. If ya’ got a Mac and your getting ill vibes from RDC hit me off with some lingo below.