Blog Archives

Installing Hugs98 (Haskell) on Mac 10.6 Snow Leopard

i have to use a program called hugs as part of one of my university modules, getting it installed on my mac proved to be a challenge, but i got it working. here is a brief guide on getting it working on 10.6. NOTE: if you are a 10.5 user the default macports install should be fine for you.

Lets Begin

hugs98 is the package available in macports to install the hugs program, so to get it you need to install macports, i wont go into the detail of that but point you to the instructions available here

to install hugs98 it should be as simple as running this command in

[bash]sudo port install hugs98[/bash]

but it should error out pretty quickly with a build error similar to:

—> Building hugs98
Error: Target returned: shell command ” cd “/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_hugs98/work/hugs98-plus-Sep2006″ && /usr/bin/make -j2 all ” returned error 2
Command output: cd src; /usr/bin/make all
make[1]: Nothing to be done for `all’.
cd libraries; /usr/bin/make all
cd ../cpphs; HUGSFLAGS=-P../libraries/bootlib HUGSDIR=../hugsdir ../src/runhugs -98 ../packages/Cabal/examples/hapax.hs configure –verbose –hugs –prefix=’/opt/local’ –scratchdir=’../hugsdir/packages/cpphs’ –with-compiler=../src/ffihugs
runhugs: Error occurred
ERROR “../libraries/bootlib/Foreign/Ptr.hs” – Error while importing DLL “../libraries/bootlib/Foreign/”:
dlopen(../libraries/bootlib/Foreign/, 9): image not found

make[1]: *** [../hugsdir/programs/cpphs/Main.hs] Error 1
make: *** [all] Error 2

Error: Status 1 encountered during processing.

all is not lost however the macports bug reporter has some patches that fix the issue below are the instructions and files if you dont want to browse to the issue page and manually go and get the files, so you get hugs 98 working on your 10.6 machine:

download the 2 patch files from the issue tracker or here: patch-hugs98-Portfile, patch-libraries-tools-make-bootlib

make sure to download them to your ~/Downloads folder or amend the following instructions with the different path to the files, now run the following commands in

cd $(port dir hugs98)
sudo cp ~/Downloads/patch-libraries-tools-make-bootlib.diff files
sudo patch < ~/Downloads/patch-hugs98-Portfile.diff
sudo port clean hugs98
sudo port install hugs98

this should take a while and your terminal window should look like this:
[bash]anthonysomerset@Anthony-Somersets-MacBook:~$ cd $(port dir hugs98)
ant@ASMB:/opt/local/var/macports/sources/$ sudo cp ~/Downloads/patch-libraries-tools-make-bootlib.diff files
ant@ASMB:/opt/local/var/macports/sources/$ sudo patch < ~/Downloads/patch-hugs98-Portfile.diff patching file Portfile ant@ASMB:/opt/local/var/macports/sources/$ sudo port clean hugs98 —> Cleaning hugs98
ant@ASMB:/opt/local/var/macports/sources/$ sudo port install hugs98
—> Computing dependencies for hugs98
—> Fetching hugs98
—> Verifying checksum(s) for hugs98
—> Extracting hugs98
—> Applying patches to hugs98
—> Configuring hugs98
—> Building hugs98
—> Staging hugs98 into destroot
—> Installing hugs98 @plus-Sep2006_0
—> Activating hugs98 @plus-Sep2006_0
—> Cleaning hugs98
ant@ASMB:/opt/local/var/macports/sources/$ [/bash]

to launch hugs just type the following in the terminal 🙂


now go and enjoy your hugs98 geekery 🙂

  • hi a friend sent my wife ecocash despite her nt being registered - his account says success - she hasn’t received anything, help?,
  • Hey my application 01706210019 said would be sent by courier within 4 days - its now day 5 - how can i track delivery?,
  • Just found out I have to wait 21 days. This is an absolute joke… wasted at least 90 minutes of my time today,
  • Sent you a small,
  • Well the bank manager isn’t picking up their phone. You might want to fix that…,