X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2Fusers_guide%2Fpackages.sgml;h=e2b53e304d8275dfccb6b52f79e1eb5949037c74;hb=fa92604ad897cfd18cfea8be1b0b58334adb1e4f;hp=db33b77af6858d60c88699e577a9733baa9b6ab3;hpb=baec65d34d4a92c27c69dfb5fd170b1a0b3915e1;p=ghc-hetmet.git diff --git a/ghc/docs/users_guide/packages.sgml b/ghc/docs/users_guide/packages.sgml index db33b77..e2b53e3 100644 --- a/ghc/docs/users_guide/packages.sgml +++ b/ghc/docs/users_guide/packages.sgml @@ -14,8 +14,8 @@ layer over a C library. GHC comes with several packages (see ), and packages can be added/removed from an - existing GHC installation, using the supplied + linkend="book-hslibs">), and packages can be added to or removed + from an existing GHC installation, using the supplied ghc-pkgghc-pkg tool, described in . @@ -50,6 +50,39 @@ automatically get -package lang too. + + Maintaining a local set of packages + + When GHC starts up, it automatically reads the default set + of packages from a configuration file, normally named + package.conf in your GHC installation + directory. + + You can load in additional package configuration files + using the option: + + + + + + + + Read in the package configuration file + file in addition to the system + default file. This allows the user to have a local set of + packages in addition to the system-wide ones. + + + + + To create your own package configuration file, just create + a new file and put the string + [] in it. Packages can be + added to the new configuration file using the + ghc-pkg tool, described in . + + Building a package from Haskell source packages @@ -142,14 +175,46 @@ ld -r --whole-archive -o HSfoo.o libHSfoo.a packages management - GHC uses a package configuration file, called - packages.conf, which can be found in your GHC - install directory. This file isn't intended to be edited - directly, instead packages can be added or removed using GHC's - package management tool, ghc-pkg. + The ghc-pkg tool allows packages to be + added or removed from a package configuration file. By default, + the system-wide configuration file is used, but alternatively + packages can be added or removed from a user-specified + configuration file using the + option. An empty package configuration file consists of the + string []. + + The ghc-pkg program accepts the + following options: + + + + + + Reads a package specification (see below) on stdin, + and adds it to the database of installed packages. The + package specification must be a package that isn't already + installed. + + + + + + + + + + Use file instead of the + default package configuration file. This, in conjunction + with GHC's option, allows + a user to have a local set of packages in addition to the + system-wide installed set. + + + + @@ -176,19 +241,6 @@ ld -r --whole-archive -o HSfoo.o libHSfoo.a - - - - - - Reads a package specification (see below) on stdin, - and adds it to the database of installed packages. The - package specification must be a package that isn't already - installed. - - - - @@ -200,11 +252,11 @@ ld -r --whole-archive -o HSfoo.o libHSfoo.a - In both cases, the old package configuration file is saved - in packages.conf.old in your GHC install - directory, so in an emergency you can always copy this file into - package.conf to restore the old - settings. + When modifying the configuration file + file, a copy of the original file is + saved in file.old, + so in an emergency you can always restore the old settings by + copying the old file back again. A package specification looks like this: