(Updated) Gitweb Setup on Mac OS X
I wrote a post about setting up Gitweb on Mac OS X 2 years ago. Today I was reading it again to setup gitweb on another Mac and the steps have slightly changed.
It assumes that Git is installed in /usr/bin (otherwise, modify the bindir property accordingly).
You just need to modify GITWEB_PROJECTROOT to point to the root of your Git projects.
To install gitweb (from Git 1.7.2.1) on Mac OS X 10.6.4, the steps are now:
# define the projects root export GITWEB_PROJECTROOT="/Users/jmesnil/Git/" # retrieve the latest version of git git clone git://git.kernel.org/pub/scm/git/git.git cd git/ # install gitweb.cgi sudo make GITWEB_PROJECTROOT=$GITWEB_PROJECTROOT \ GITWEB_CSS="/gitweb/gitweb.css" \ GITWEB_LOGO="/gitweb/git-logo.png" \ GITWEB_FAVICON="/gitweb/git-favicon.png" \ GITWEB_JS="/gitweb/gitweb.js" \ bindir=/usr/bin \ gitwebdir=/Library/WebServer/CGI-Executables/gitweb \ install-gitweb # move the static files to the proper folder mkdir -p /Library/WebServer/Documents/gitweb cd /Library/WebServer/ mv CGI-Executables/gitweb/static/* Documents/gitweb
and go to http://localhost/cgi-bin/gitweb/gitweb.cgi
Cocoa Programming
I just received my copy of Cocoa Programming. At first glance, the book seems a good update for Mac OS X development.
It has been quite a few months since I did Mac (and iPhone) programming. I have not looked deeply at Core Data and Grand Central Dispatch yet. I also want to experiment with Objective-C blocks.
I need to find a suitable idea for a Mac application to prototype and experiment. Any idea or suggestion is welcome!
In-Depth Snow Leopard Review by Ars Technica
As usual, the review of Mac OS X 10.6 by Ars Technica is awesome and full of gold nuggets.
It gives a nice description of the changes under hood. I was particularly interested by:
- the explanation of LLVM and Clang (and the code analyzer provided by Xcode 3.2)
- the addition of Closures to C and C-derived languages
- the design and implementation of Grand Central Dispatch.
Now, I just need to find another pet project to play with all these new features.
Gitweb setup on Mac OS X
Update: I have written a new post for an updated setup with a more recent version of Git.
This post is for future references since I had to slightly adapt what is written in the INSTALL file to run Gitweb on my MacBook.
Assuming all my Git projects are in /Users/jmesnil/Work/ and I’ve already installed Git using MacPorts (sudo port install git-core), the steps to create gitweb.cgi is:
cd ~/Work # retrieve the latest version of git git clone git://git.kernel.org/pub/scm/git/git.git cd git/ make GITWEB_PROJECTROOT="/Users/jmesnil/Work/" \ GITWEB_CSS="/gitweb/gitweb.css" \ GITWEB_LOGO="/gitweb/git-logo.png" \ GITWEB_FAVICON="/gitweb/git-favicon.png" \ bindir=/opt/local/bin gitweb/gitweb.cgi # CGI scripts are located in /Library/WebServer/CGI-Executables mkdir -p /Library/WebServer/CGI-Executables/gitweb sudo cp gitweb/gitweb.cgi /Library/WebServer/CGI-Executables/gitweb/ # And the other resources are in /Library/WebServer/Documents/ mkdir -p /Library/WebServer/Documents/gitweb sudo cp gitweb/gitweb.css gitweb/git-logo.png gitweb/git-favicon.png \ /Library/WebServer/Documents/gitweb/
Once everything is copied to the right place, Gitweb is up and running: http://localhost/cgi-bin/gitweb/gitweb.cgi?
Spaces & Expose in Mac OS X 10.5.3
As explained by John Gruber, Apple has improved Spaces support in Mac OS X 10.5.3 but there are still some broken features.
When I’m reordering my windows, instinctively, I want to activate Spaces then use Expose All Windows feature to rearrange them. But this does not work: I have to first use Expose then Spaces.
Before 10.5.3, it was not possible to use Expose when Spaces was active. Now, we can activate Spaces and then display All Windows in Expose using the screen corners or the keyboard’s function keys:

However it still does not work using mouse keys.
As for Expose Application Windows, it does not work at all when activating Spaces.
The behaviour I’m expecting from Spaces & Expose is to be able to switch between Expose features (All Windows and Application Windows) and Spaces in any order using either screen corners, function keys or mouse keys.
Maybe I’ll have this behaviour in Snow Leopard…
How to include JavaScript engine in Apple’s Java 6 VM
After complaining in my previous post, here is a more constructive guide to use JavaScript with Apple’s Java 6 VM:
- Download JSR 223′s engines
- Copy
jsr223-engines/javascript/build/js-engine.jarto/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/lib/ext/ - Download Rhino
- Copy
rhino1_7R1/js.jarto/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/lib/ext/
You can now use a “JavaScript” engine from Apple’s Java 6 VM:
public class JavaScriptTest { public static void main(String[] args) throws Exception { ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("JavaScript"); engine.eval("print('hello, world!')"); } }
jrunscript is also working:
$ cd /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/ $ ./jrunscript rhino-nonjdk> print("hello, world"); hello, world rhino-nonjdk>
No JavaScript in Java 6 on Mac OS X
I had an idea about using JavaScript from Java 6 and I wanted to give it a try on my MacBook.
No such luck: Apple has recently released Java 6 for Mac OS X Leopard but somehow it does not include Rhino, the Mozilla’s JavaScript engine bundled in Sun Java 6 release.
Instead they provided only one engine for AppleScript but frankly:

public class AppleScriptTest { public static void main(String[] args) throws Exception { ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("AppleScript"); engine.eval("tell application \"Finder\"\n display dialog \"Who cares?\"\n end tell"); } }
Nuff said…
Mac OS X on X86: what will it mean for Java?
So now that the news is official that Apple will move its laptops to Intel X86 architecture, I’m wondering what it means for Java. I’m neither a hardware guy nor an OS one but if the architecture is based on X86 and the OS on an UNIX kernel, what are the implications for Java? Will it be simpler for Apple to develop their own JVM? Can they leverage Open Source projects (no, I’m not talking about Harmony!)?
My hope is that there will be less lag between Sun JVMs on Wintel and Linux and Apple one. However, since Apple seems committed to support both PowerPC and X86 architectures, will they accept to have two different versions of Java (the X86 one following closely Sun ones and the PowerPC one still lagging a few months behind)? Or will they keep only one version and, unfortunately but realistically, the older one? Java was much heralded by Steve Jobs when Apple released Mac OS X but it has never really become a first-class citizen for application development. Now with the move to Intel and the continuing support for PowerPC, it may renew the interest of developers.
That and the availability of SWT for Cocoa would mean a new age for Java application development on Apple boxes…
Using Java 1.5 on Mac OS X Tiger
Since I upgraded to Mac OS X Tiger, I also installed Java 1.5 on my PowerBook.
Apple provides a small application to change the default JVM to 1.5 instead of the standard 1.4.2. However it is only useful for Applets and WebStart applications.
To change the default JVM for the
$ cd /System/Library/Frameworks/JavaVM.framework/Versions
$ sudo mv Current Current.old
$ sudo ln -s 1.5 Current
Et voila!
$ java -version
java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-56)
Java HotSpot(TM) Client VM (build 1.5.0_02-36, mixed mode, sharing)
Ars Technica review of Mac OS X Tiger
A extensive review of Mac OS X Tiger has been published on Ars Technica.
The explanation of how metadata have been implemented and how Spotlight works under the hoods is the best I’ve seen so far. I’m eager to try Spotlight but after reading that article and figuring out what can be done if users could apply metadata to file, I’m already looking forward to Mac OS X 10.5 (lion?, wolverine?).


