4

I'm trying to install the xmonad. So firstly, I install the ghc complier using the following comands:

zypper ar http://download.opensuse.org/repositories/devel:/languages:/haskell/openSUSE_12.1/devel:languages:haskell.repo  
zypper in ghc  

After that, I try to install the cabal-install-0.14.0 using the following commands:

wget http://hackage.haskell.org/packages/archive/cabal-install/0.14.0/cabal-install-0.14.0.tar.gz
tar zxfv cabal-install-0.10.2.tar.gz
cd cabal-install-0.10.2
sh bootstrap.sh  

But when I run the last command, it got the error:

Setup: The program hsc2hs is required but it could not be found

Error during cabal-install bootstrap:
Building the network package failed.  

Obviously, I need the hsc2hs program and I can see it in the directory "/usr/lib/ghc-7.4.2/hsc2hs", so I add this directory in the PATH. But it still doesn't work.

Is there anyone could give me some advice? Thanks.

PS: My OS is openSUSE 12.1

leftaroundabout
  • 117,950
  • 5
  • 174
  • 319
ShihaoLiu
  • 101
  • 1
  • 6

1 Answers1

1

A few ideas:

  1. I believe there is a zypper package called haskell-platform. If you install that, it will install and configure cabal-install and a few other tools for you. It will probably sort out the hs2sc issue for you.

  2. Is there a zypper package for xmonad? If so, I recommend you use that rather than trying to use cabal directly.

There are basically three main ways of installing Haskell stuff on Linux.

Option 1 (recommended for most users): Use your linux distro's package manager to install stuff, rather than using the cabal command directly. And if a package you want isn't available yet on your distro, request it. This approach is the safest, because all of the dependencies have been sorted out for you. The disadvantage is that you won't usually have the latest release. You can still use the cabal command for any packages that you develop.

Option 2: Use your package manager to install ghc and the haskell-platform, but after that use the cabal command to install any haskell-y stuff. You'll still use your package manager to install things that can't be installed using cabal (e.g., non-haskell stuff). If you do this, you can avoid a lot of cabal hell by never running cabal as root (or alternatively, configuring cabal-install to install everything as root), and never letting your package manager do anything that can be done using cabal. The main disadvantage of this approach is that you might have to deal with some library dependencies yourself.

Option 3: Install ghc (and optionally, the Haskell platform) manually, and use cabal-install (the cabalcommand) to install everything else you need. If you really want to stay on the bleeding edge of everything, and you don't mind manually installing stuff, this is a feasible option.

mhwombat
  • 8,026
  • 28
  • 53