Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; CBlacklist has a deprecated constructor in /home/saltybanana/www/blog/peel/scripts/sb_blacklist.php on line 6

Warning: session_start(): Cannot start session when headers already sent in /home/saltybanana/www/blog/peel/index.php on line 11

Warning: strpos(): needle is not a string or an integer in /home/saltybanana/www/blog/peel/index.php on line 31

Warning: strpos(): needle is not a string or an integer in /home/saltybanana/www/blog/peel/index.php on line 37

Warning: strpos(): needle is not a string or an integer in /home/saltybanana/www/blog/peel/index.php on line 43

Warning: strpos(): needle is not a string or an integer in /home/saltybanana/www/blog/peel/index.php on line 49
The Banana Peel
vi, jEdit, and Smultron 
Friday, December 24, 2004, 6:13 AM
Since my college days, my favorite default text editor has been vi. I even have a version of vi installed on my Windows machines because ... well, it's so much better than Notepad.

After I installed Mac OS X, I also began to use vi (vim) a lot. However, vi on Mac OS X is restricted to the confines of a Terminal session, and the default installation doens't have the two features on my most wanted list: syntax highlighting and ftp.

These days syntax highlighting really helps reading the code easier, and with everything so connected in the 21st century, I often find myself needing to edit files stored on remote servers.

So, I found jEdit a couple of years ago, and have been using it whenever vi doesn't quite fit the bill. In addition to syntax highlighting, jEdit also sports some cool features such as tag completion for markup languages and the ability to edit files on remote servers via its FTP plug-in.

However, being a Java application, it can be a bit quirky, and it runs at a barely acceptable level on my Mac. On top of that, I find that jEdit runs very snappy on my Windows machines. Apple needs to do something about this....

In any case, I recently discovered Smultron. In the developer's own words:
Smultron is an open-source text editor written in Cocoa for Mac OS X Panther with many of the features that you might need. It features easy selection of the opened documents, line numbers, support for syntax colouring for many different languages, support for text encodings, code snippets, a toolbar, a status bar, HTML preview, multi-document find and replace with regular expressions, possibility to show invisible characters, authenticated saves, command-line utility, .Mac synchronisation of preferences and many more features.

I have been trying it out, and am liking it thus far. In fact, I used it to compose my last entry about compiling Freeciv. Smultron has syntax highlighting support and runs fast (relative to jEdit). While tag completion would be nice, the only thing I really want at the moment is built-in FTP support. If and when that feature is added, I will have to see about deprecating jEdit in favor of Smultron.

  |  permalink   |   ( 3 / 592 )

Compiling Freeciv for Mac OS X Panther 
Thursday, December 23, 2004, 5:35 PM
For those wondering how I built my Freeciv packages and how you might do the same, here's a quick write-up on how I compiled it from source. The contents below are written for someone with a development background. If this applies to you, or if you are simply curious, read on.

Requirements
  • Mac OS X Panther
  • BSD subsystem (installed by default)
  • X11
  • X11 SDK
  • Xcode (version 1.2 or 1.5)
  • DarwinPorts
  • Know your way around the command-line interface

Steps
  1. Make sure all Panther components are installed (the first five items in previous list)

  2. Install DarwinPorts. This will get you the port command, related documentation (man pages), and the port files. The DarwinPorts site has excellent documentation on installation, so I won't repeat them here.

    Alternatively, you can compile the Xaw client, which is supported by Apple's X11 installation. I used to build this client, but it is quirky and not Mac-like. If you want to go this route, skip this step and the step about installing components needed by the game client. Additionally, the bit about /opt/local/lib (near the end) doesn't apply as well.

  3. Download Freeciv 2.0.0 Beta 5 source code. I had trouble with the .tar.gz archive, so I used the .tar.bz2 one instead.

  4. Extract the archive, and read the INSTALL file at the top-levle directory of the archive. You can glean some information about how to build Freeciv for Mac OS X here.

  5. To build the Gtk+ 1.2 game client, we need to install the components, or ports, needed. Assuming you have DarwinPorts set up properly, you need to issue these port commands in the order provided:

    % sudo port install glib1
    % sudo port install gtk1
    % sudo port install imlib


    Freeciv requires these components in order to compile. These components in turn require other components, which will be automatically downloaded, compiled, and installed when you execute the above commands.

  6. Now, we are ready to configure the source tree for compilation. Using Terminal.app, navigate to the top-level directory of the source you've extracted from the archive, and type the following command (this is one long command). Note that the command is for C shell (csh or tcsh). You'll have to modify it appropriately if you are using another shell:

    % env CC="gcc -no-cpp-precomp" CFLAGS="-O3" \
    ./autogen.sh --with-included-gettext --disable-nls \
    --enable-client=gtk \
    --prefix=/Users/your_user_name/freeciv-2.0.0-beta5

  7. Now, we aredy to compile Freeciv. Issue the following command:

    % make

  8. If the make command terminated without any errors, issue the following command to install the executables and data files:

    % make install
If all went well, you should have a working installation of Freeciv in your home directory. You can launch the client by double-clicking on

/Users/your_user_name/freeciv-2.0.0-beta5/bin/civclient

from the Finder.

To run the server, you can do so from Terminal.app using this command:

% ~/freeciv-2.0.0-beta5/bin/civserver

Now, the installation you've just made has some limitations:
  • Location specific.

    This means if you rename the freeciv-2.0.0-beta-5 folder or move it to another place, it will fail to run. However, this can be overcome by setting the FREECIV_PATH environment variable to point to the share/freeciv subdirectory of wherever your installation is. My package, in fact, does this.

  • Hard-coded library paths.

    The required components you installed from DarwinPorts consist, among other things, dynamic libraries that are loaded at run-time. By default, they are installed in /opt/local/lib. This means when you run the game client, it is expecting to find the libraries it needs in that directory. This, too, can be overcome. But I will save this one for another day.

  • Uncertain multi-lingual suppport.

    I am not at all familiar on how to support languages other than English. You might want to leave out the --disable-nls option during the configuration step to see how that works out for you.
Hope this helps.
  |  permalink   |   ( 3 / 707 )

Battle for Wesnoth 
Tuesday, December 14, 2004, 8:36 AM


Some time ago, a thread at the Freeciv forum pointed out that Freeciv was no longer ranked the #1 open source game at The Linux Game Tome. That position now belongs to another game named Battle for Wesnoth. Freeciv now holds the #2 spot.

I found some time to try it over the weekend, and I must say, I am impressed. When asked to describe it, my first response is that it reminds me of WarCraft II, but turn-based. However, that is far from the whole truth.

I highly recommend that you try the game out for yourself. Pre-built binaries are available on several platforms, including Mac OS X. And unlike Freeciv, the OS X version runs natively on top of Aqua (that is right, no X11 required).

  |  permalink   |   ( 3 / 696 )

Freeciv 2.0.0 Beta 5 
Monday, December 13, 2004, 10:55 AM
While part of me is anxious to see 2.0.0 released, another part of me is also glad to see the developers doing their due diligence to squash as many bugs as possible. Or, at least that's what I think they are doing. :-)

Anyway, the fifth beta was posted on December 10th, and my package for Mac OS X Panther is here.

Some have asked about Jaguar support. However, I don't have the resources to spin up a Jaguar system to support it. Now, if you are interested in compiling it yourself, feel free to ask, and I can help you get started.
  |  permalink   |   ( 3.1 / 797 )

Freeciv 2.0.0 Beta 4 
Wednesday, November 24, 2004, 2:22 AM
With the fourth beta released so close to Thanksgiving, one wonders if the final release of 2.0.0 will be pushed out to December!

Nonetheless, here is my beta 4 package for Mac OS X Panther.

Enjoy, and happy Thanksgiving!
  |  permalink   |   ( 3 / 693 )


Back Next