Building WebDSL on Mac (developers)

WebDSL compilation from source on Mac OS X (tested on 10.6 Snow Leopard).

Nix requirements

Apple Xcode: install from your DVD.

MacPorts: download and install MacPorts.
If you already had ports installed, you may need to do an update:

sudo port -d selfupdate

Install the required ports:

sudo port install curl m4 autoconf automake pkgconfig libtool subversion

Add to your ~/.profile:

export PATH=/opt/local/bin/:$PATH

To make sure the ports version of these tools is used instead of the older ones in XCode (assuming the default MacPorts install directory).

Nix installation

The Nix package manager needs to be installed, version 0.13 or higher.

Download the latest nix build: Download -> Latest unstable release -> Source distribution nix-0.13*.tar.gz. Untar it

tar -xzf nix-*.tar.gz

configure it (no –prefix!)

cd nix-*
./configure

and then make && sudo make install.

make && sudo make install

To start using nix using your regular (non-root) account, do the following:

sudo chown -R $USER /nix

Next, run the shell script to configure the correct paths (and add
this line to your ~/.profile file):

. /usr/local/etc/profile.d/nix.sh

and restart bash or source the .profile file.

. ~/.profile

Installation of WebDSL requirements with Nix

Install the Stratego/XT packages:

nix-channel --add http://hydra.nixos.org/jobset/strategoxt/strategoxt-packages/channel/latest

nix-channel --update

Then (should have at least Mac OS X 10.6 Snow Leopard):

nix-env --system-filter x86_64-darwin -i aterm java-front sdf2-bundle strategoxt strc-java

Then, update your ~/.profile again and add:

export PKG_CONFIG_PATH=~/.nix-profile/lib/pkgconfig

and restart bash or source the .profile file.

. ~/.profile

Updating WebDSL requirements (not required for initial installation)

nix-channel --update
nix-env -u '*' --system-filter x86_64-darwin

Checkout and install WebDSL

Do a checkout of the latest version of WebDSL with your favorite subversion client (be it subversion itself, or git-svn):

svn co https://svn.strategoxt.org/repos/WebDSL/webdsls/trunk webdsl

And compile it:

cd webdsls
./bootstrap
./configure --enable-java-backend --prefix=/usr/local
make
make install

Known Issues When Compiling WebDSL

Under Snow Leopard, the Stratego compiler is missing these two libraries:

/usr/lib/libreadline.6.0.dylib
/usr/lib/libhistory.6.0.dylib

You can fix this by installing the readline libraries with MacPorts and creating symbolic links for the missing libraries:

sudo port install readline
sudo ln -s /opt/local/lib/libreadline.6.0.dylib /usr/lib/
sudo ln -s /opt/local/lib/libhistory.6.0.dylib /usr/lib/

or, if 6.1 but not 6.0 is available:

sudo ln -s /opt/local/lib/libreadline.6.1.dylib /usr/lib/libreadline.6.0.dylib
sudo ln -s /opt/local/lib/libhistory.6.1.dylib /usr/lib/libhistory.6.0.dylib

Known Issues When Running WebDSL

If you run into segmentation faults when using Snow Leopard (64bit Stratego, also holds for Leopard with 64bit Stratego), the stack size must be set higher, add

ulimit -s 64000

to your ~/.profile and source it.

Java 6

You may have to enable Java 6 SE, open

/Applications/Utilities/Java Preferences

to configure your Java version (drag Java 6 SE to the top). Add the JAVA_HOME and PATH environment variables in your ~/.profile file:

export PATH=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands:$PATH
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home

and restart bash or source the .profile file.

. ~/.profile

Tomcat

Download Tomcat 6.x, Binary Distributions, Core, tar.gz direct link

extract tar.gz file

tar -xzf apache-tomcat-*.tar.gz

and add bin dir to path, e.g.:

export PATH=/Users/someone/apache-tomcat-6.0.20/bin/:$PATH

and restart bash or source the .profile file.

. ~/.profile

Make the catalina.sh file executable:

chmod +x catalina.sh

Start tomcat using:

catalina.sh run

Mysql

Mysql, tar package

Extract tar.gz file:

tar -xzf mysql*.tar.gz

and add bin dir to path, e.g.:

export PATH=/Users/someone/mysql*/bin/:$PATH

Start mysql using:

mysqld&

Known Mysql installation issues

If extracting the tar and running mysqld directly results in errors, try installing mysql using the .DMG and starting it using the prefpane or startup item included in the installation.