Hi

First of all, my apologies if this is not the correct list to report  
this.

I had problems using the binary distribution of wxhaskell for OSX. I  
get an error message indicating that the post-install step failed  
because /opt/local/bin/ghc-pkg was not found. Since I'm not using the  
macports version of ghc anymore, it is not surprising that ghc-pkg was  
not found there.

So I looked at /Volumes/wxhaskell/wxhaskell.pkg/Contents/Resources/ 
wxhaskell.post_install and saw this:

#!/bin/sh

GHCPKG=/opt/local/bin/ghc-pkg
# try these versions of GHC-PKG in turn
# would it maybe be best just to let the installer fail?
if test "$GHCPKG" = ""; then
   if test -f /usr/local/bin/ghc-pkg; then
     GHCPKG=/usr/local/bin/ghc-pkg
   elif test -f /opt/local/bin/ghc-pkg; then
     GHCPKG=/opt/local/bin/ghc-pkg
   elif test -f /sw/bin/ghc-pkg; then
     GHCPKG=/sw/bin/ghc-pkg
   else
     echo "I can't find ghc-pkg in the path ($PATH)!"
     echo "Is GHC even installed?"
     exit 1
   fi
fi
cat "$1/Contents/Resources/wxcore.pkg" | sed -e "s|\${wxhlibdir}|/usr/ 
local/wxhaskell/lib|" | $GHCPKG --global update -
cat "$1/Contents/Resources/wx.pkg" | sed -e "s|\${wxhlibdir}|/usr/ 
local/wxhaskell/lib|" | $GHCPKG --global update -

Now, since GHCPKG is initialized as "/opt/local/bin/ghc-pkg", the test  
"$GHCPKG" = "" will always fail. This means that the long chain of ifs  
is dead-code and, more importantly, this script is useless for anyone  
not using macports. This is particularly problematic now that the  
Haskell Platform is suggested as the main channel for ghc distribution.

My suggestion would be to change the script to:

#!/bin/sh

GHCPKG=$(which ghc-pkg)
# try these versions of GHC-PKG in turn
# would it maybe be best just to let the installer fail?
if test "$GHCPKG" = ""; then
     echo "I can't find ghc-pkg in the path ($PATH)!"
     echo "Is GHC even installed?"
     exit 1
fi
cat "$1/Contents/Resources/wxcore.pkg" | sed -e "s|\${wxhlibdir}|/usr/ 
local/wxhaskell/lib|" | $GHCPKG --global update -
cat "$1/Contents/Resources/wx.pkg" | sed -e "s|\${wxhlibdir}|/usr/ 
local/wxhaskell/lib|" | $GHCPKG --global update -

Thanks,
Daniel


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users

Reply via email to