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>

  • have that problem all the time when talking about our sans :),
  • RT : When you are the guru of failovers - by astlock and sstave ,
  • RT : Ah, have seen sense. "I just asked our technical director now and he told me that we'll disable SSLv3 tonight.",
  • RT : . have told me that they can't disable SSLv3 on their servers and their recommendation is to "not use IE6": ,
  • RT : My strategy this week is to go out drinking with people that have iPhone 6 - they want to pay for drinks to show off ApplePay :),
  • So proud of my little girl, she slept for 6 hours last night no waking up… at 4 weeks old! :) ,
  • Does anyone know where I can buy some fennel tea from in Harare? Can’t seem to find it anywhere.,
  • RT : This Sunday at ONEchurch Rory will be preaching from Acts 3-6 where Persecution lead the early church to Boldness... ,
  • RT : Excellent piece on the importance of fathers by Natasha Devon ,
  • Happy Birthday Sha!! Thinking of you… hope you have an extra special day today!! :) Love Ramie xx,