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 terminal.app:

[bash]sudo port install hugs98[/bash]

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

[bash]
—> Building hugs98
Error: Target org.macports.build 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/Ptr.so”:
dlopen(../libraries/bootlib/Foreign/Ptr.so, 9): image not found

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

Error: Status 1 encountered during processing.
[/bash]

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 terminal.app

[bash]
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
[/bash]

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/rsync.macports.org/release/ports/lang/hugs98$ sudo cp ~/Downloads/patch-libraries-tools-make-bootlib.diff files
ant@ASMB:/opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/hugs98$ sudo patch < ~/Downloads/patch-hugs98-Portfile.diff patching file Portfile ant@ASMB:/opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/hugs98$ sudo port clean hugs98 —> Cleaning hugs98
ant@ASMB:/opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/hugs98$ 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/rsync.macports.org/release/ports/lang/hugs98$ [/bash]

to launch hugs just type the following in the terminal :)

[bash]hugs[/bash]

now go and enjoy your hugs98 geekery :)

About

Anthony is a Freelance Systems Administrator for Somerset Technical Solutions LTD, with over 7 years experience in the sector


2 comments on “Installing Hugs98 (Haskell) on Mac 10.6 Snow Leopard
  1. shiny says:

    Very Very Thanks!!

  2. adil blanco says:

    thank you :)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • RT : we are back up now, thanks for your patience ,
  • RT : We have multiple fibre breaks on our International links which are being worked on we hope to return to service asap,
  • RT : We are currently down due to a major fault on our international links, engineers are working to bring service back as quickly as possible,
  • the i fc queue is out the door for foot traffic and right down the street for drive thru. Might be regretting the choice tonight,
  • RT : One of the only guys who can get away with drinking Chateaux Neuf Du Pap straight from the bottle ,
  • Brushed my teeth this evening with my son’s ‘milk teeth’ toothpaste (bedtime for me I think),
  • : Serv & encourage people & they will follow you, 1 Kings 12:7. Harshness in leadership is counter productive. 1 Kings 12.”,
  • RT : Don't miss this Sunday at ONEchurch. Rob Manjengwa is preaching in the morning - 10am and Ruthless are leading us... ,
  • Am actually woddling around like a real pregnant woman now (wasn’t like this with Ronnie) ,
  • I'm totally loving this song lately! ,