Going retro

I’ve been looking for some really light games, ones that don’t suck up too much of time and are yet fun to play. I’ve already played the standard games you usually play on Linux: TuxRacer, BZFlag, Neverball, Armagetron AD, Frozen Bubble, Battle for Wesnoth, Pingus; and DotA was getting a little too heavy. I highly recommend these games if you haven’t played them, by the way.

I was reminded of the Win’ 95 days (my first computer) – we used to have a lot of great DOS games back then which had no eye-candy, but great gameplay. After a little Googling, I came across DOSBox, and its smooth OS X wrapper, Boxer. DOSBox is an emulator that can be used to play DOS-based games – neat, eh? I managed to get some of my really old favorites: Bio Menace, SkyRoads and Major Stryker. I used to play shareware versions of Apogee games before, but was really happy to know that Apogee (now 3DRealms) released full versions of Bio Menace and Major Stryker for free (as in beer). SkyRoads is also put up as a download on the creator’s website. Yay, now I can play those fun-filled levels that were previously hidden to me :)

Bio Menace running in DOSBox SkyRoads on DOSBox Major Stryker on DOSBox

While we’re on the topic, I should also mention Alex 4. Alex the allegator is a series of games by Johan Peitz (of Free Lunch Design fame – I still can’t forget Icy Tower!). The Alex series is special in the sense that the source is also available (it’s written using Allegro), so it has been ported to Mac OS X and BeOS

Have fun!

Command History

Looks like everyone’s doing one of these around the blogosphere lately, so I’m joining in the fun:

[theghost ~]$ uname -a
Darwin theghost.local 9.2.2 Darwin Kernel Version 9.2.2: Tue Mar  4 21:17:34 PST 2008;
root:xnu-1228.4.31~1/RELEASE_I386 i386
[theghost ~]$ history|awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
118 ls
81 cd
61 hg
39 exit
29 vi
24 ssh
24 mate
23 grep
19 rm
9 wget

And for the Linux virtual machine:

anant@tg-nix ~ $ uname -a
Linux tg-nix 2.6.24-gentoo-r1 #32 SMP Sun Apr 13 09:15:20 IST 2008
i686 Genuine Intel(R) CPU T2600 @ 2.16GHz GenuineIntel GNU/Linux

anant@tg-nix ~ $ history|awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
142 ls
88 cd
83 sudo
48 vi
33 emerge
30 exit
8 rm
8 mv
7 startx
7 cmake

I’m going to leave it for you to figure out what mate is :)

Leopard: A first look

I couldn’t help but notice that close to 70% of developers who attended foss.in had Macs with them. And half of them had even upgraded to Leopard, giving me a few glimpses of what Apple’s new operating system looked like.

I decided to upgrade to Leopard too, and got myself a copy from the iStore on M.G. Road. It cost me Rs. 6,200 which is (suprisingly?) a little more than the dollar-converted rate. Anyway, I decided to do a clean install after backing up all my data – it was the perfect chance to remove all the cruft in the system.

The installation went smoothly and the traditional multi-lingual ‘Welcome’ was simply stunning. Now I began installing the applications one by one:

  • QuickSilver: The first app that anyone would need. It worked with all the standard plug-ins on Leopard without any glitches. I did notice, however, that it wouldn’t launch any applications that you just installed (specifically, those that you downloaded; yes, Leopard keeps track of that!). You have to manually launch the application once (you get a dialog asking you whether you really want to) before it appears in QuickSilver’s catalog. Mildly irritating, but it’s a one-time thing for every app.
  • Macports: I compiled this one, also worked out-of-the-box without any problems. All the ports I used so far work fine, although I will expect some of them to fail (which isn’t a macports, but rather an upstream problem).
  • Adium/Colloquy: Clean install, no trouble. Imported old logs just fine.
  • iScrobbler: Version 1.5.2 wouldn’t post to last.fm for some reason, version 2.0beta works great (and has a bunch of new features).
  • VMWare Fusion: Works great, but it looks like you’d need some small tweaks to get the tools for Linux to work fine. I’m going to give Fusion a try for sometime to see how it measures up to Parallels (which is what I was using earlier).
  • Poisoned: This one doesn’t work on Leopard. It starts up fine, and gIFT appears to start but none of the networks connect. After searching the forums for a bit, I settled for FrostWire which works fine.

Let’s take a look at all the new features that caught my eye:

  • Tabbed Terminal.app! There’s no need to use iTerm now. I did, however, have to spend a couple of hours in trying to get the key combinations to work in a sane manner. This post proved to be very helpful, DoubleCommand didn’t.
  • Uniform interface. Finally. I was getting sick of the varied brushed-metal/grey/what-not styled interfaces. Leopard finally has a smooth grey across all applications. No need for UNO anymore.
  • Spaces. Eliminates the need for VirtueDesktops (Notice the pattern here?). Really nifty if you run a Fusion virtual machine in full-screen on every space and assign sane keyboard shortcuts to switch.
  • Stacks: Snazzy looking way of representing Downloads and Documents. You can add your own folders to ‘stack’. I like the new Downloads directory, I used to create one in Tiger anyway :)
  • dtrace. The all-encompassing debugger from OpenSolaris made easy. I haven’t used it for anything useful yet but I like what I see.
  • Mail 3.0. Slicker interface, and I really love the Mail Activity area which tells me exactly what Mail is upto – Mail 2.0 always left you wondering!

I haven’t had a chance to look at Quick Look yet, but that should be another thing to look forward to. All-in-all a good experience so far, but was it worth the 6 grand? I’ll wait and see.

KDE 4, Umbrello et. al. on Mac OS X!

I needed a decent UML modeller that was capable of converting my class diagrams into PHP 5 code. I usually use ArgoUML on my Mac; it’s a great product but lacks the code-generation feature that I needed. (It does generate C++ and Java code though). (EDIT: As noted in comment below, ArgoUML indeed supports PHP code generation as a seperate module!). So I rebooted into Linux and emerged Umbrello. However, I had heard about the Qt/Mac edition, which is essentially Qt4 but with a native Mac interface. I was very tempted to try this out – KDE 4 without X with a native Mac look is absolutely exciting!

Check out this yummy screenshot (click for the full version):

Umbrello with KDE 4 on Mac OS X!

That’s Umbrello on Mac OS X, complete with an Apple style menu and a Dock Icon! Read on for compilation instructions…

This page provided lots of useful info to get started. I downloaded the Qt/Mac Open Source edition, version 4.3. After applying the patches mentioned in the KDE for Mac OS X build page (not all of them applied cleanly, but I guess those patches were for a older version of Qt) I began compiling Qt. Here are the exact steps:

$ mkdir ~/kde.build
$ cd ~/kde.build
$ wget ftp://ftp.trolltech.com/qt/source/qt-mac-opensource-src-4.3.0.tar.gz
$ tar xvzf qt-mac-opensource-src-4.3.0.tar.gz
$ svn co svn://anonsvn.kde.org/home/kde/trunk/qt-copy/patches/
$ cd qt-mac-opensource-src-4.3.0
$ for patch in ../patches/*.diff; do patch -p0 < $patch; done
$ ./configure  –prefix=/opt/qt4 -qt-gif -fast -qdbus
$ make all
$ sudo make install

Note that you need DBus installed before you try this. I highly recommend MacPorts for all you Mac OS X users out there, its chock-full of useful open source software for your Mac. ‘port install dbus’ to get Dbus. Qt took about an hour to build on my Macbook Pro.

Now onto KDE 4. All of the pre-requisites mentioned on the KDE 4 for Mac OS X page can easily be got through MacPorts – with the exception of Strigi. You can easily build Strigi from source though, make sure you get a recent SVN checkout. Strigi depends on CLucene, there’s a version in MacPorts but it’s not new enough for strigi. Anyway this wasn’t so difficult either:

$ cd ~/kde.build$ wget http://downloads.sourceforge.net/clucene/clucene-core-0.9.16a.tar.bz2
$ tar xvjf clucene-core-0.9.16a.tar.bz2
$ cd clucene-core-0.9.16a
$ ./configure –prefix=/opt/kde4-deps
$ make
$ sudo make install

KDE 4 requires a recent SVN build of Strigi:

$ cd ~/kde.build
$ svn co svn://anonsvn.kde.org/home/kde/trunk/kdesupport/strigi
$ cd strigi
$ export CMAKE_INCLUDE_PATH=”/opt/kde4-deps/include:/opt/local/include”
$ export CMAKE_LIBRARY_PATH=”/opt/kde4-deps/lib:/opt/local/lib”
$ mkdir build
$ cd build
$ cmake ../ -DCMAKE_INSTALL_PREFIX=/opt/kde4-deps
$ make
$ sudo make install

Now, we’re all set to build the base KDE libs:

$ cd ~/kde.build
$ svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs
$ export PATH=”/opt/qt4/bin:/opt/kde4/bin:/opt/kde4-deps/bin:$PATH”
$ export PKG_CONFIG_PATH=”/opt/qt4/lib:/opt/local/lib”
$ cd kdelibs
$ mkdir build
$ cd build
$ cmake ../ -DCMAKE_INSTALL_PREFIX=/opt/kde4
$ make
$ sudo make install

Voila! All done. Now you can build your additional KDE components quite easily. Umbrello, for example, is part of kdesdk, which depends on kdepimlib. To build Umbrello:

$ cd ~/kde.build
$ svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdepimlib
$ cd kdepimlib
$ mkdir build
$ cd build
$ cmake ../ -DCMAKE_INSTALL_PREFIX=/opt/kde4
$ make
$ sudo make install

$ cd ~/kde.build
$ svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdesdk
$ cd kdesdk
$ mkdir build
$ cmake ../ -DCMAKE_INSTALL_PREFIX=/opt/kde4
$ cd umbrello
$ make
$ sudo make install

Now just run umbrello.app from /opt/kde4/bin! It may fail the first time you run because you haven’t initialized DBus yet:

$ sudo mkdir -p /opt/local/var/lib/dbus
$ sudo dbus-uuidgen –ensure

Have fun! I’m going to try and build Amarok now ;)

Compiling SystemC with GCC 4 (and Mac OS X)

I’m having to use SystemC for a project involving simulation of Network-On-Chip applications. Turned out that it didn’t quite compile cleanly on my GNU/Linux machine:

sc_process_int.cpp: In member function
  'virtual void sc_core::sc_thread_process::prepare_for_simulation()':
sc_process_int.cpp:441: error:
  'sc_thread_cor_fn' was not declared in this scope
sc_process_int.cpp: In member function
  'virtual void sc_core::sc_cthread_process::prepare_for_simulation()':
sc_process_int.cpp:630: error:
  'sc_cthread_cor_fn' was not declared in this scope

My friend pointed me to a patch for this, which I later modified slightly. Turns out that GCC4 is a bit more stricter about friend functions than its old counterpart.

That problem solved, I went on to compiling SystemC on the Mac. My Macbook Pro has an Intel processor so it shouldn’t have been much trouble. Needless to say, configure couldn’t even detect the build type:

checking build system type...
  configure: error: cannot guess build type; you must specify one

And after specifying one explicitely:

$ ./configure --build=i386-pc-macosx
configure: error: "sorry...architecture not supported"

Not a problem. After adding a case…esac block to configure.in (setting the CXXFLAGS etc. to the the same as the case for linux), we were up and running :)

In summary, here’s what you have to do after grabbing the SystemC sources (requires registration and acceptance of license):

$ tar xvzf systemc-2.1.v1.tgz
$ cd systemc-2.1.v1
$ wget 

http://www.kix.in/misc/patch_systemc-2.1.v1-gcc4-osx

$ patch -p0

Those of you trying to compile SystemC on GNU/Linux with GCC4 do the same; but leave out the `build’ argument to the configure statement.

Unholy Union of the Big Three

ZOMG. Parallels‘ latest build brings along with it some nifty features. Which ultimately leads your desktop to look something like this:

Unholy Union of the Big Three

No, that’s not some fabricated image made in GIMP. It’s for real; you can now run all the big 3 OSes side by side, just as if they’ve known each other for years ;)

Here’s how you do it:

  • Get yourself a powerful Intel Mac with 2Gigs of RAM (okay you may not really need this, but it’s always a good idea)
  • Buy a copy of the latest Parallels Desktop. More than worth it!
  • Install your favourite Linux Distro and Windows on two Parallels VM’s
  • Or, if you already have BootCamp and want to use the native Windows already installed, Parallels allows you to boot from that too! I already had a native Windows running on Boot Camp, and I was up and running in no time with the useful guide you can find here
  • Fire up the Linux VM, start the X server bundled with OS X. SSH to your Linux VM with X forwarding enabled, and start your favourite desktop: I chose XFCE, but Gnome/KDE will run equally well
  • Fire up your Windows VM and enable the “Coherence” mode
  • Start using Windows/OS X/Linux applications side by side, all within the comfort of your OS X desktop :)
  • If you’re really insane create virtual machines for FreeBSD and Solaris too…

This has got to be the most coolest thing I’ve ever done with a computer :)

(In the screenshot: Windows Start menu just below the Apple menu; XFCE-Terminal on Linux; Safari on OS X; IE on Windows; XFCE-Panel (on Linux) just to the right of the OS X Dock. Windows applications even have their own Dock items; All Linux apps will be shown as only one X app though)

Follow

Get every new post delivered to your Inbox.