Installing Weblocks on Mac OS X

Post written by Deepak Surti

Posted: 11-Aug-2009

Contents

Here are the steps that I followed to successfully install weblocks on Mac OS X 10.4. Though I have not tried it, but the same steps should work on 10.5 and 10.6 as well.

First let us look at the pre-requisites for this installation.

1 Pre-requisite 1: Install Macports

Macports is the package management system for Mac OS X. It is similar to the BSD ports collection. Follow the steps described here to install Macports on your machine if you have not yet done so.

2 Pre-requisite 2: Install darcs

Now install darcs using macports with the following command at your terminal:

sudo port install darcs

With the above done, we are now ready to install weblocks.

3 Step 1: Installing SBCL with thread support

Weblocks needs SBCL with thread support. With macports installed, the simplest way to install sbcl with thread support is by executing the following command at your terminal:

sudo port install sbcl +threads

4 Step 2: Install clbuild with darcs

With darcs installed via macports, use darcs to install clbuild.

darcs get http://common-lisp.net/project/clbuild/clbuild

Check the clbuild installation with the following command

./clbuild check

When I ran this check, I found that I did not have the following softwares:svn,wget. Both of these are available in Macports and can be installed just as we installed darcs above.

To install svn, run

sudo port install subversion

To install wget, run

sudo port install wget

Just install all the softwares that the clbuild check returns as not found. The details of clbuild can be found here.

5 Step 3: Install weblocks with clbuild

My initial attempt to install weblocks with clbuild failed as I did not have git, mercurial on my machine. Again git, mercurial are available on Macports. Note that mercurial command is known as hg. Use macports to search and install these as follows.

sudo port install mercurial
sudo port install git-core

Now just run the following at your terminal

./clbuild install weblocks

6 Step 4: Install cl-prevalence with clbuild

Again run the following at your terminal

./clbuild install cl-prevalence

Without cl-prevalence installed you will not be able to run the weblocks demos.

7 Step 5: Update your .sbclrc file

Open your .sbclrc file in your home directory and add the following so that all lisp libraries installed via clbuild are available to sbcl:

* (pushnew ”/your-path-to/clbuild/systems/” asdf:*central-registry* :test #’equal)

clbuild installs all libraries in system folder. Please change your-path-to with your actual path to the clbuild’s systems folder.

8 Step 6: Verifying your installation

Run sbcl at your terminal. At the sbcl prompt, do the following:

* (asdf:oos ’asdf:load-op ’weblocks)
* (asdf:oos ’asdf:load-op ’weblocks-demo)
* (weblocks-demo:start-weblocks-demo :port 3455)

Now open your browser and check the weblocks home page

You will see a page which shows all the currently running weblocks applications. In our case there will be only 1 demo application as shown in the image below.


PIC

Figure 1: Weblocks Admin Page

.

By following the above steps, you can easily install weblocks and get up and running in virtually no time. I have never come across a simpler setup to get going especially after my nightmarish Java web application frameworks experiences.