harry | 25 Jul 21:14 2013
Picon

change location of user's package directory

How can I change the location that ghc and ghc-pkg use for the user's package
directory? I'm running GHC in a very restricted environment where I don't
have access to $HOME, but I can use specific subdirectories.

--
View this message in context: http://haskell.1045720.n5.nabble.com/change-location-of-user-s-package-directory-tp5733451.html
Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.
Albert Y. C. Lai | 26 Jul 00:02 2013
Picon

Re: change location of user's package directory

On 13-07-25 03:14 PM, harry wrote:
> How can I change the location that ghc and ghc-pkg use for the user's package
> directory? I'm running GHC in a very restricted environment where I don't
> have access to $HOME, but I can use specific subdirectories.

Cannot. But you have another option. GHC and cabal-install support 
further package databases than global and user.

To initialize:

     mkdir /joy (or other ways to make /joy exist and be empty)
     ghc-pkg --package-db=/joy recache

Note: two hyphens, -- not -

To cabal-install:

     cabal --package-db=/joy --prefix=/delight install acme-dont

Note: you must provide a custom --prefix. The default is $HOME/.cabal 
which is exactly what you can't use.

To ghc-pkg:

     ghc-pkg --global --package-db=/joy list
     ghc-pkg --package-db=/joy unregister acme-dont

However, beware of http://ghc.haskell.org/trac/ghc/ticket/5442

To ghc or ghci:
(Continue reading)

harry | 28 Jul 11:35 2013
Picon

Re: change location of user's package directory

Albert Y. C. Lai wrote
> On 13-07-25 03:14 PM, harry wrote:
>> How can I change the location that ghc and ghc-pkg use for the user's
>> package
>> directory? I'm running GHC in a very restricted environment where I don't
>> have access to $HOME, but I can use specific subdirectories.
> 
> Cannot. But you have another option. GHC and cabal-install support 
> further package databases than global and user.
> 
> To initialize:
> 
>      mkdir /joy (or other ways to make /joy exist and be empty)
>      ghc-pkg --package-db=/joy recache
> 
> Note: two hyphens, -- not -
> 
> 
> To cabal-install:
> 
>      cabal --package-db=/joy --prefix=/delight install acme-dont
> 
> Note: you must provide a custom --prefix. The default is $HOME/.cabal 
> which is exactly what you can't use.
> 
> 
> To ghc-pkg:
> 
>      ghc-pkg --global --package-db=/joy list
>      ghc-pkg --package-db=/joy unregister acme-dont
(Continue reading)

harry | 28 Jul 12:53 2013
Picon

Re: change location of user's package directory

harry wrote
> $ ghc-pkg check --package-db=~/cabal
> ghc-pkg: ~/cabal: openFile: does not exist (No such file or directory)
> $ ls ~/cabal
> package.cache

Ah, the ~ seems to have been tripping it up. Thank you.

--
View this message in context: http://haskell.1045720.n5.nabble.com/change-location-of-user-s-package-directory-tp5733451p5733514.html
Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.
Brandon Allbery | 28 Jul 16:19 2013
Picon

Re: change location of user's package directory

On Sun, Jul 28, 2013 at 5:35 AM, harry <voldermort <at> hotmail.com> wrote:
$ ghc-pkg check --package-db=~/cabal
ghc-pkg: ~/cabal: openFile: does not exist (No such file or directory)
$ ls ~/cabal
package.cache

Yet another reason to avoid ~... it's (a) only expanded by the shell, and (b) not reliably expanded even by the shell if it's not the very start of a word (as here where it is after =). Use $HOME instead.

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b <at> gmail.com                                  ballbery <at> sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users <at> haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Gmane