Difference between revisions of "Cabal-Install"
Jump to navigation
Jump to search
Benmachine (talk | contribs) (Category:Cabal) |
(Remove outdated stuff) |
||
(28 intermediate revisions by 10 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{Stub}} |
||
⚫ | |||
+ | |||
− | by automating the fetching, configuration, compilation and installation of Haskell libraries and programs. |
||
⚫ | |||
Those packages must be prepared using [[Cabal]] and should be present at [http://hackage.haskell.org/ Hackage]. |
Those packages must be prepared using [[Cabal]] and should be present at [http://hackage.haskell.org/ Hackage]. |
||
+ | See https://cabal.readthedocs.io/ for more info. |
||
− | == Usage == |
||
− | |||
− | Once you have the tool installed then installing other packages easy. To install Cabal packages from Hackage use: |
||
− | cabal install foo |
||
− | |||
− | Other common variations: |
||
− | cabal install Package in the current directory |
||
− | cabal install foo Package from the hackage server |
||
− | cabal install foo-1.0 Specific version of a package |
||
− | cabal install 'foo < 2' Constrained package version |
||
− | cabal install foo bar baz Several packages at once |
||
− | cabal install foo --dry-run Show what would be installed |
||
− | |||
− | Occasionally you need to update the list of available packages: |
||
− | cabal update |
||
− | |||
− | You can edit the cabal configuration file to set defaults: |
||
− | ~/.cabal/config |
||
− | |||
− | Or on Windows the config file lives at: |
||
− | C:\Documents and Settings\username\Application Data\cabal\config |
||
− | |||
− | == Installation == |
||
− | |||
− | === Windows === |
||
− | |||
− | Get a pre-built <code>cabal.exe</code> from: |
||
− | http://www.haskell.org/cabal/download.html |
||
− | |||
− | You must put the <code>cabal.exe</code> in a directory that is on your <code>%PATH%</code>, for example <code>C:\Program Files\Haskell\bin</code>. |
||
− | |||
− | === Unix === |
||
− | |||
− | Download the latest cabal-install tarball from: |
||
− | http://www.haskell.org/cabal/download.html |
||
− | |||
− | It includes a shell script <code>bootstrap.sh</code> that you can run to download and install the other dependencies. |
||
− | |||
− | Note this assumes you have the zlib C library and its header files installed. Those header files are usually in a native system package like <code>zlib-devel</code> (On debian-based systems it is <code>zlib1g-dev</code>). You should also have the Haskell packages <code>parsec</code> and <code>network</code> installed. If you installed GHC via your native system package manager then you may also need to use it to install these two packages. (On debian-based systems they are called <code>libghc6-parsec-dev</code> and <code>libghc6-network-dev</code>.) |
||
− | |||
− | tar -zxf cabal-install-0.6.2.tar.gz |
||
− | cd cabal-install-0.6.2 |
||
− | ./bootstrap.sh |
||
− | |||
− | If this completes successfully you will have the cabal binary in <code>~/.cabal/bin</code>. You should either add this directory to your <code>$PATH</code> or copy the cabal program to some location that is on your <code>$PATH</code>, eg <code>~/bin</code>. |
||
− | |||
− | to get the current list of package from hackage you should now run: |
||
− | |||
− | cabal update |
||
− | |||
− | By default the cabal tool will install programs in <code>~/.cabal/bin</code>. If you decided not to put this directory on your <code>$PATH</code> then you can get cabal to symlink binaries into another directory, eg <code>~/bin</code>. To use this feature edit <code>~/.cabal/config</code> and see the <code>symlink-bindir field</code>. Note that the <code>~/.cabal/config</code> file is not created until you run a cabal command for the first time, eg <code>cabal update</code>. |
||
− | |||
− | === Linux on Intel === |
||
− | |||
− | There are also [http://code.haskell.org/~thielema/cabal/ unofficial binaries] for Intel-Linux. |
||
− | |||
− | == See also == |
||
− | |||
− | * [http://hackage.haskell.org/trac/hackage/wiki/CabalInstall cabal-install] page on the Cabal/Hackage development site. |
||
[[Category:Tools]] |
[[Category:Tools]] |
Latest revision as of 10:10, 10 March 2021
This article is a stub. You can help by expanding it.
The cabal-install package provides the cabal
command-line tool which simplifies the process of managing Haskell software by automating the fetching, configuration, compilation and installation of Haskell libraries and programs.
Those packages must be prepared using Cabal and should be present at Hackage.
See https://cabal.readthedocs.io/ for more info.