Question

I have Windows XP and Haskell Platform 2013 installed on it. When I want to compile my code on some computer, which has not Haskell Platform installed on it, and I'm not allowed to install anything, I can copy my Haskell Platform on USB flashcard, and run on this computer, and it's work just fine.

But sometimes I need additional packages, that are not part of the standard Haskell Platform build.

I can simply install it on my personal computer with Cabal, but I don't know, how to install them in such a way that they could work portable, i. e. from my USB flashcard on not my computer.

I tried this:

cabal install gnuplot --prefix "C:\Program Files\Haskell Platform\2013.2.0.0"

This installed package into Haskell platform directory, but when I run Haskell Platform on another computer, it don't see it.

I think, I should make configuration file to be installed in Haskell Platform directory, but I don't how to do it.

Please, help me to solve this problem. Thank you in advance!



Thank you very much, Mikhail Glushenkov! All work fine now.

For convenience of newbies like me, that looking for answers, I merely describe the instruction, what to do, to have same result:

0) Read the instruction before doing anything/

1) Uninstall all additional packages, that is needed to be installed portable (with dependencies): unregister this packages with

ghc-pkg unregister gnuplot

, and then delete package-files from where it stores. Also delete all related files from "package.conf.d" folders. To search them, use

ghc-pkg list

.

2) Run (maybe it's unnecessary)

ghc-pkg recache

.

3) Install package in desired directory in haskell platform. I did it in "C:\Program Files\Haskell Platform\2013.2.0.0\addlib":

cabal install gnuplot --prefix "C:\Program Files\Haskell Platform\2013.2.0.0\addlib" --global

.

4) Change every new file, related to installed packages in "package.conf.d": replace "C:\Program Files\Haskell Platform\2013.2.0.0\addlib\utility-ht-0.0.9\ghc-7.6.3" in them like that: "$topdir\..\addlib\utility-ht-0.0.9\ghc-7.6.3", i. e. "C:\Program Files\Haskell Platform\2013.2.0.0\addlib\" -> "$topdir\..\addlib\".

5) Run

ghc-pkg recache

.

3a) Maybe, this would work better, then 3 (I did not tested it). If so, don't do 3, 4, and 5.

cabal install gnuplot --prefix "$topdir\..\addlib" --global

.

End.

*UPD*

I found some stupid mistakes in this instructions (in 3a and 4). Fixed now.

3a is not working!

Was it helpful?

Solution

You need to replace the absolute paths in $GHCDIR\lib\package.conf.d\*.conf files with relative paths referencing $topdir and then run ghc-pkg recache.

Take a look at how the Haskell Platform's Windows installer does it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top