I found it not really straightforward to get Pugs up and running on my PowerBook, so I thought I'd share some installation instructions that worked for me. These instructions refer to GHC 6.4.1, hs-plugins as of 2005-09-24, parrot 0.2.3 and Pugs 6.2.9. Make sure you adapt the paths mentioned as needed.
Install parrot
This will enable parrot support in Pugs. Plus, who doesn't want a parrot?
- Download parrot
- Copy the parrot-0.2.3 directory to /usr/local (the built parrot will remember its path, so choose someplace where you can leave it, not a temporary location)
- perl Configure.pl
- make
- make test
Install DarwinPorts
DarwinPorts is needed to install GHC
- Download the binary installer for DarwinPorts (right now, version 1.0)
- Edit your ~/.profile, add the paths mentioned in the installation package. E.g.
# add the DarwinPorts path behind the standard path, so the # perl installed by DarwinPorts will not override your system perl :( export PATH=$PATH:/opt/local/bin export MANPATH=/opt/local/share/man:$MANPATH export INFOPATH=/opt/local/share/info:$INFOPATH
- sudo port -d selfupdate
Install GHC
The Glasgow Haskell Compiler is needed to compile Pugs
- sudo port install ghc. This will take quite a long while.
Install darcs
Darcs is a revision control system needed to retrieve hs-plugins
- sudo port install darcs
Install hs-plugins
This is a GHC plugin that is needed for Pugs' parrot support
- darcs get http://www.cse.unsw.edu.au/~dons/code/hs-plugins
- Change into hs-plugins directory and runhaskell Setup.hs configure
- runhaskell Setup.hs build
- runhaskell Setup.hs install
- I don't know why, but I had to do sudo ranlib /usr/local/lib/plugins-0.9.10/libHSplugins-0.9.10.a.
Install Pugs
- Download Pugs
- export PUGS_EMBED=perl5,parrot
- export PARROT_PATH=/usr/local/parrot-0.2.3
- Edit Makefile.PL: Remove the error message that GHC 6.4.0 won't work with GCC 4 (since we installed GHC 6.4.1)
- perl Makefile.PL
- make (again, this takes quite a while)
- make install
Et voilà!
$ pugs -e 'say "Hello, World!"' Hello, World!

Leave a comment