Re: [Haskell-cafe] Libraries in home dir

2008-10-09 Thread Dougal Stanton
On Thu, Oct 9, 2008 at 2:08 PM, Mauricio [EMAIL PROTECTED] wrote:
 Hi,

 I want to use a few libraries from hackage
 and have already download and built them. Can
 I install those libraries somewhere in my
 home dir (I want to avoid installing as root)
 so that ghc can find them?

 If so, which options should I give to Setup.hs
 (with main=defaultMain) so that the libraries
 are going to be copy to that dir?

Dpeending on whether you have (and are using) cabal-install, either

$ cabal install diagrams --prefix=$HOME --user

or

$ runhaskell Setup.lhs configure --prefix=$HOME --user


That will (a) put the libraries etc in $HOME/lib and (b) register
these packages locally.

Hope that helps!


D
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Libraries in home dir

2008-10-09 Thread allan
Hi,

In addition if you want to do this all or most of the time, that is there are 
few/no cabalised libraries you DO wish to install globally, then you can tell 
'cabal' to do this all the time by editing your ~/.cabal/config file. Here is 
mine:

repos: hackage.haskell.org:http://hackage.haskell.org/packages/archive
cachedir: /home/USERNAME/.cabal/packages
hackage-username: 
hackage-password: 
compiler: ghc
user-install: True
user-prefix: /home/USERNAME/install/

regards
allan


Dougal Stanton wrote:
 On Thu, Oct 9, 2008 at 2:08 PM, Mauricio [EMAIL PROTECTED] wrote:
 Hi,

 I want to use a few libraries from hackage
 and have already download and built them. Can
 I install those libraries somewhere in my
 home dir (I want to avoid installing as root)
 so that ghc can find them?

 If so, which options should I give to Setup.hs
 (with main=defaultMain) so that the libraries
 are going to be copy to that dir?
 
 Dpeending on whether you have (and are using) cabal-install, either
 
 $ cabal install diagrams --prefix=$HOME --user
 
 or
 
 $ runhaskell Setup.lhs configure --prefix=$HOME --user
 
 
 That will (a) put the libraries etc in $HOME/lib and (b) register
 these packages locally.
 
 Hope that helps!
 
 
 D
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe
 


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Libraries in home dir

2008-10-09 Thread Daniel Fischer
Am Donnerstag, 9. Oktober 2008 15:08 schrieb Mauricio:
 Hi,

 I want to use a few libraries from hackage
 and have already download and built them. Can
 I install those libraries somewhere in my
 home dir (I want to avoid installing as root)
 so that ghc can find them?

runghc ./Setup.hs configure --user --prefix=$HOME
runghc ./Setup.hs build
runghc ./Setup.hs install

I'm afraid you would have to build again to get a correct 
$TOP/dist/build/autogen/Paths_${library}.hs

 If so, which options should I give to Setup.hs
 (with main=defaultMain) so that the libraries
 are going to be copy to that dir?

 Thanks,
 Maurício


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Libraries in home dir

2008-10-09 Thread Alfonso Acosta
On Thu, Oct 9, 2008 at 3:08 PM, Mauricio [EMAIL PROTECTED] wrote:
 I want to use a few libraries from hackage
 and have already download and built them. Can
 I install those libraries somewhere in my
 home dir (I want to avoid installing as root)
 so that ghc can find them?

Sure, just write:

runhaskell Setup.hs configure --user
--prefix=personal/directory/where/to/install/the/package

--user tells cabal to install the package in the user package-database

You might want to use cabal-install [1] in order to automatize the
insallation of Cabal packages. By default it uses the --user flag and
copies the package files under $HOME/.cabal/.

Important caveat: Make sure to also supply the --user flag when
compiling other packages which depend on your library. Otherwise Cabal
will only look for it in the global package-dabatase and won¡t be able
to find it.

[1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/cabal-install
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Libraries in home dir

2008-10-09 Thread Duncan Coutts
On Thu, 2008-10-09 at 10:08 -0300, Mauricio wrote:
 Hi,
 
 I want to use a few libraries from hackage
 and have already download and built them. Can
 I install those libraries somewhere in my
 home dir (I want to avoid installing as root)
 so that ghc can find them?
 
 If so, which options should I give to Setup.hs
 (with main=defaultMain) so that the libraries
 are going to be copy to that dir?

$ cabal instsll xmonad

Does exactly that by default. No other flags are required.


By default it stores files under $HOME/.cabal and registers the packages
in ghc's per-user db. So no special permissions are required.

If you want to change the defaults then you can use command line flags
or edit the $HOME/.cabal/config file.

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe