Haskell平台上带有Cabal的Windows上的便携式软件包安装 [英] Portable package installation on Haskell Platform with Cabal on windows

查看:223
本文介绍了Haskell平台上带有Cabal的Windows上的便携式软件包安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了Windows XP和Haskell Platform 2013。当我想在一些没有安装Haskell平台的计算机上编译我的代码时,我不允许安装任何东西,我可以将我的Haskell平台复制到USB闪存卡上,然后在这台计算机上运行,很好。



但是有时我需要额外的软件包,它们不是标准Haskell平台版本的一部分。



我可以简单地将它安装在我的个人电脑上,但是我不知道,如何安装它们以使它们可以工作便携式。即从我的USB闪存卡上不是电脑。



我试过这个:

  cabal install gnuplot --prefixC:\ Program Files \Haskell Platform \2013.2.0.0

这个软件包安装到Haskell平台目录中,但是当我在另一台计算机上运行Haskell Platform时,它看不到它。



我想,我应该把配置文件安装在Haskell Platform目录中,但我不知道该怎么做。



请帮我解决这个问题。先谢谢您!







非常感谢, Mikhail Glushenkov!现在一切正常。



为了方便像我这样的新手寻找答案,我只描述指令,做什么,具有相同的结果:

在执行任何操作前阅读指令/ b / b
$ b

1)卸载所有附加软件包, (需要依赖):注销这个包

  ghc-pkg unregister gnuplot 

,然后从它存储的位置删除包文件。同时从package.conf.d文件夹中删除所有相关的文件。要搜索它们,请使用

  ghc-pkg list 



<2>运行(也许没有必要)

  ghc-pkg recache 



3)在haskell平台上的所需目录中安装软件包。我在C:\ Program
Files \Haskell Platform \2013.2.0.0\addlib中做到了这一点:

  cabal install gnuplot --prefixC:\ Program Files \Haskell Platform \2013.2.0.0\addlib--global 


$ b



4)更改与package.conf.d中已安装软件包相关的每个新文件:将C :\ Program Files \Haskell Platform \2013.2.0.0\addlib\utility-ht-0.0.9\ghc-7.6.3在它们中是这样的:$ topdir \..\addlib\\ \\ utility-ht-0.0.9 \ghc-7.6.3,i。即C:\ Program Files \Haskell Platform \2013.2.0.0\addlib\ - >$ topdir\\\\addlib\。



5)运行

  ghc-pkg recache 


  cabal install gnuplot --prefix$ topdir \。 。\addlib--global 





UPD *



我在这个指令中发现了一些愚蠢的错误(在3a和4中)。现在修正。

3a不能正常工作! 您需要用相对路径替换 $ GHCDIR \ lib \package.conf.d\ *。.conf 文件中的绝对路径,引用 $ topdir ,然后运行 ghc-pkg recache



看看 Haskell Platform的Windows安装程序可以完成这项工作


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!

解决方案

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.

这篇关于Haskell平台上带有Cabal的Windows上的便携式软件包安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆